Turning a pdf dataset into CSV
In the rare occasion where researchers publish an entire dataset written in PDF format, such as in the case of this research paper, you need a quick tool to turn that PDF into a CSV file.
What happens under the hood
Embeded nodejs runtime
Using the nodejs-bin python node runtime, we are able to call npx to remove execute the pdf2json npm package
When you type
pdfdataprocess mkjson
The npx call applies on the first PDF in your directory. If not found, the path you provide to flag -f is considered.
Parsing the JSON-PDF
Then a highly hacky python processing is applied to the JSON-PDF file.
The JSON-PDF is a JSON file containing the content of the PDF.
The python script iterates through the JSON-PDF and extracts the text content of each page.
How this is done is quite simple:
- if your dataset is an actual CSV file that's printed into PDF, then on each page you will have, at same height (
topentry), a line of different values (leftentry changes,dataentry should be rearranged) - this requires a few layers of pre and post-processing
- the final result is a CSV file with the text content of each page
Usage
pdfdataprocess mkjson # outputs the json file
then
pdfdataprocess pjson # outputs the csv file
Metadata
Release files for pdfdataprocess 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pdfdataprocess-0.1.2.tar.gz | 3.0 kB | Without provenance | Details for pdfdataprocess-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pdfdataprocess-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for pdfdataprocess-0.1.2-py3-none-any.whl |
Total release size: 6.8 kB
Release files / pdfdataprocess-0.1.2.tar.gz
| Download URL | pdfdataprocess-0.1.2.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fcdbe18eab9e6203e234e46241264de15c3aa1c8b37c4a42537ccb8d736e74df
|
|
BLAKE2b-256 checksum How to use checksums |
70734d56b7fcd532e3ea71f76e464507adfaeca7d387d1853aa4f7d74dec71cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.11.3 Linux/6.2.0-20-generic
|
Release files / pdfdataprocess-0.1.2-py3-none-any.whl
| Download URL | pdfdataprocess-0.1.2-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d17368cc8bb1df5fe2b667388577a639cfacba2cf18bfe2092d28e04d3bf3693
|
|
BLAKE2b-256 checksum How to use checksums |
31800328d94cbf650e71610371a1945a3b1147e1578080125559ced2940b9fb9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.11.3 Linux/6.2.0-20-generic
|
Security for pdfdataprocess 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.