A Python web application for converting PDF forms into PDF-filling APIs.
You post an interactive PDF form, and the app will return a URL. If you post JSONs to that URL, the app will return the PDF and use the JSON to fill the form fields.
This app is a prototype. It is less than a month old. Don't use it in production.
Here are the current priorities for development.
This app idea originated from a common need to automatically fill PDF forms in various Code for America projects. Filling PDFs is an all-too-common need for many government and institutional services, and automatically populating forms can be a useful step in redesigning those services to better serve clients.
After an initial proof-of-concept in another project, I decided to spin this off into a separate project.
This was created by @bengolder at @CodeForAmerica with contributions from: @gauravmk, @zhoux10, @bhoeting, @samgensburg, @debrasol, and @joffemd
You need to download, install, and run the web app locally. Once the local server is running, you can upload PDFs to create APIs, and then fill those PDFs.
The following instructions assume:
brew install python3 # check the version python3 --version
git clone https://github.com/codeforamerica/pdfhook.git cd pdfhook python3 -m venv . # create the virtual environment source bin/activate make install
You do not need to set up a database, but you can create a custom one if you like. By default, the application will create and use an SQLite database. It only uses one database table. Upon the first request it checks if that table has been created. If not, it will create a table before processing the request.
make test # or if you'd like to run specific tests make test TEST_SCOPE=tests.integration.test_sample_pdfhook:TestPDFHook.test_fill_pdf
To deploy on Heroku use the button or:
git clone https://www.github/codeforamerica/pdfhook.git cd pdfhook heroku login heroku apps:create git push heroku master
To deploy on Cloud Foundry:
git clone https://www.github/codeforamerica/pdfhook.git cd pdfhook cp manifest.yml.example manifest.yml # make any changes to `manifest.yml`, if desired cf push -f manifest.yml
git clone https://www.github/codeforamerica/pdfhook.git cd pdfhook vagrant up