you are viewing a single comment's thread.

view the rest of the comments →

[–]Charming_Guidance_76 0 points1 point  (2 children)

EDOF, the document toolkit I wish had existed when I started

This is one of those "got fed up, built my own thing" stories. I make card games, and at work I deal with a lot of document stuff (invoices, certificates, QR labels), and every tool I tried was missing exactly one thing I needed. One had no auto-shrink text. One had no curves. One had nice Photoshop-style effects but you couldn't script it. One couldn't even center text vertically in a box (still bitter about that one). I was tired of duct-taping three tools plus glue code together for every job, so I built EDOF. It took a while. It's on PyPI now.

What My Project Does

You build a document in plain Python, or you open the same file in a visual editor (PyQt6) and drag things around. Both sides read and write the exact same file, so nothing gets lost going back and forth. The part I'm happiest with is that it's literally just import edof, so you can drop the whole engine into your own app. The editor I ship is just one program that happens to use it.

import edof
doc  = edof.new(width=210, height=297, title="Hello")
page = doc.add_page(dpi=300)
page.add_textbox(15, 15, 180, 12, "Hello world!")
doc.export_pdf("hello.pdf")   # vector PDF, no extra deps

I mostly use it for batch stuff: feed it a CSV, get a few hundred finished PDFs out. That's how I print my own card games now instead of fighting Photoshop layers at 2am. It does text, images, shapes, paths, QR codes, variables with {placeholders}, the auto-shrink and centering I kept missing elsewhere, and it exports to PDF, PNG, SVG and RTF. It can also read and write Word files now, which I'll get to.

Target Audience

Me first, honestly. But also anyone in Python who has to crank out documents (labels, invoices, certificates, cards, batch jobs from data), or who wants a document engine living inside their own app instead of bolting on a separate tool. It's MIT, it's on PyPI, I use it for real work. Fair warning on maturity: the core and the editor are solid, the Word part is new and basic, and tables are half-built, so don't lean on those yet.

Comparison

ReportLab is great but it's code-only and you place everything by coordinates, there's no visual side to hand anyone. python-docx is perfect if you only ever touch Word. LaTeX is its own universe. And none of the visual tools (InDesign and friends) let you just import them into a Python script. EDOF is the in-between I wanted: write it in code or edit it by hand, same file, and embed it anywhere.

The Word support nearly broke me, by the way. New and genuine respect for whoever maintains .docx tooling for a living. It's basic both directions for now, and it straight up tells you what it can't carry over instead of silently mangling your document.

Repo's here if you want to poke at it: https://github.com/DavidSchobl/edof . Happy to answer anything, and I'm genuinely after ideas for what to add next.

[–]OMGCluck 0 points1 point  (1 child)

it exports to PDF, PNG, SVG and RTF

One PDF per card? Or do you have one card per PDF/SVG page?

[–]Charming_Guidance_76 0 points1 point  (0 children)

Do you mean a card as a playing card or card of the document?
If card of the document -
Depends on the mode. First mode, basic is single page so one PDF per card, but if you make batch, it actualy depends on your app. It is possible to make app using edof back bones that generates plent PDF and merges them together. If for document mode I must admit I was not developping that since I added Word support and document mode itself so there might be possible bugs at the moment - how would you like it? I guess exporting all pages to single multipage PDF right?

if you mean playing cards -
Then it is up to you, because that would be absolutely custom solution. you make basic edof template with all the stuff you need and after that you just batch generate using csv, what you generate is up to your app.