DEV Community

Cover image for 39 Products, One 2 GB Server: The Four Python Scripts That Did the Packaging"**
Muhamad Revanza Rafif Hamdani

39 Products, One 2 GB Server: The Four Python Scripts That Did the Packaging"**

I ran the same batch twice on a Tuesday night and nearly flagged my own Adobe Stock account. That is the moment this post is about. I had 40 files ready, a CSV built by hand, and a script I thought was idempotent. It wasn't. The upload tracker did not exist yet, so nothing remembered what had already gone out. I caught it at item 12, closed the tab, and spent the next weekend writing the four small scripts that now do all of my packaging. This post is what they do and why each one exists.

The metadata header is a hard gate, not a suggestion

All three of my channels reject a wrong CSV instantly. Adobe wants a 5-column header, Vecteezy wants 4 columns, Dreamstime wants 15. Get one column wrong and the whole upload bounces before a human ever sees your work. Hand-editing a spreadsheet for 40 files is where I kept making copy-paste mistakes.

make_metadata.py writes exactly the header each platform demands and nothing else. You point it at a folder of files:

python make_metadata.py ./my-assets --platform adobe --out metadata.csv --ext .jpg
Enter fullscreen mode Exit fullscreen mode

It uses only the Python standard library, so there is nothing to install. By default it title-cases the filename as the title, which is fine for a first pass but you should replace it with real titles and keywords before submitting. Passing --titles titles.json does that. I learned the hard way that filename titles read as spam in review.

Double-posting is the fastest way to get flagged

This is the failure from the opening paragraph. Running a batch twice is not a small mistake, it is the kind of repeated identical submission that gets an account reviewed. upload_tracker.py is a tiny ledger:

python upload_tracker.py pending items.txt
python upload_tracker.py done "asset-001.jpg"
python upload_tracker.py status
Enter fullscreen mode Exit fullscreen mode

Before any batch run I check pending. After each successful upload I mark it done. A re-run now skips anything already posted. It is not clever, it is just a record that survives my own forgetfulness, and it uses the standard library too.

A document is not a product until it looks like one

I had a 30-page Markdown guide sitting in my research folder for weeks because turning it into a clean PDF felt like a chore. md2pdf.py handles headings, tables, lists and links, and renders through reportlab, one of only two third-party packages in the whole kit:

python md2pdf.py content.md product.pdf "My Product Title"
Enter fullscreen mode Exit fullscreen mode

One command and the doc looks like something a person would pay for instead of a raw text dump.

Packaging: a zip with a real cover sells, a bare file does not

pack_product.py bundles everything: it zips the files and renders a cover at 1280x720 and a thumbnail at 600x600, using Pillow:

python pack_product.py my-product "My Product" "A short subtitle" 9
Enter fullscreen mode Exit fullscreen mode

Output goes into a _system folder, or wherever you point --dir or PACK_ROOT. Covers are the difference between a listing that gets clicked and one that sits there. I do not have A/B numbers to prove that, but every product I have packaged with a real cover has looked more legitimate on the listing page, and that is enough reason to never ship a bare zip again.

How all of this ran on 1 vCPU and 2 GB of RAM

No GPU, no cloud account, one small server. The habits that made it work:

  • One process at a time. Never fan out image jobs in parallel on a single core.
  • Call gc.collect() after each asset to free memory between items.
  • Measure peak RSS with resource.getrusage(RUSAGE_SELF).ru_maxrss, not average usage. Peak is what kills you.
  • Run heavy render steps as one file per subprocess so memory goes back to the OS.
  • Inspect previews at 60 dpi instead of rendering at 300 when you only need to check layout.

These are boring rules, but they are why 39 products came out of a box that would fall over under a parallel batch.

Where the numbers actually stand

The four scripts packaged 39 products, about 856 MB of output, as part of a parent project with roughly 19,000 lines of pipeline code and over 300 pages of research behind the rules the scripts enforce. On the catalogue side I have made 1,860 assets, with 1,077 ready or submitted to stock platforms. The first paid sale came from this system itself: someone bought the Digital Asset Factory for $2.80. That is not a fortune, but it is real money from a pipeline that costs almost nothing to run.

The honest pointer

Those four scripts are the packaging layer of a bigger system I call the Digital Asset Factory. It includes the prompt engine that produced the assets, the folder structure that keeps a catalogue from turning into a junk drawer, and the notes on running everything on a 1 vCPU, 2 GB server. If you are a solo maker building stock art, stickers or templates and you want the whole pipeline rather than just these four files, that is what the kit is. It is not a get-rich promise, it is the working setup behind the numbers above.

Get digital asset factory


Building digital products? Free guides & kits for digital product sellers.

Top comments (0)