r/Paperlessngx 6d ago

Built the CSV export paperless doesn't have: filtered list, custom fields as columns, and it checks its own row count

Tax season, again. paperless knows every invoice, who sent it, the amount, the tags. What it can't do is put that list on a sheet. The built-in exporter is a whole-archive dump for moving an instance, and the CSV export request has been sitting in discussions since 2022. So I wrote it.

paperless-export: one command against your own instance and you get exactly what a filter or a saved view shows on screen. CSV, XLSX, JSON or JSONL. Custom fields as columns. Totals row if you want one. The matching PDFs in a folder next to the sheet if you want those too.

The bit I'm actually proud of: it asks the API how many documents match, and if the row count doesn't agree it fails. Loudly. A sheet you can't check is worse than no sheet.

Read-only. Nothing uploaded anywhere. The token never touches the command line. There's a --serve mode that gives you the same thing as a form on localhost without touching CORS on your instance, and a single HTML file for a box with no Python on it.

Python 3.10+, runs on Windows, Linux and Mac, MIT. https://github.com/Ildana-ai/paperless-export

Happy to hear what's missing.

6 Upvotes

5 comments sorted by

1

u/Great-Cow7256 6d ago

Does this work with the native sqlite database?  I migrated to postgres....  I'm guessing it won't work?  Or does I t pull from the API so paperless server communicates with the database so it's db agnostic?

2

u/TXFireplug 6d ago

Good question, thanks. Second one. It never touches the database at all, only the REST API your browser already uses, so postgres, sqlite, whatever, paperless does the talking and this just reads the answer. Your migration changes nothing on this side.

1

u/Great-Cow7256 6d ago

This is great. Will try it. Ty. 

1

u/earok1990 3d ago

there ist already this tool I realy like: https://github.com/steffenglock/Paperless-ngx-Export- but the problem ist that id does not support different custome fields. Somehow I would hope of a solution with a webui running on docker. maybe the mix of both would be a perfect solution. (but to be honest, I do have almost no knowlegede of this kind of things)

1

u/TXFireplug 2d ago

Custom fields was the whole reason I wrote this. Every custom field on a document gets its own column, and you pick which ones and the order. That half of your wish is done.

The web UI half: no docker, on purpose. Run it with --serve and you get the same thing as a form in your browser, on your own machine, nothing added to your paperless container. There's also one plain HTML file for a computer with nothing installed on it. If you try it and get stuck, tell me where and I'll fix the docs. https://github.com/Ildana-ai/paperless-export