python-docraptor is an MIT Licensed wrapper for the docraptor API.
Synchronous Example
from docraptor import DocRaptor
docraptor = DocRaptor()
with open("test.pdf", "wb") as f:
f.write(docraptor.create({
'document_content': '<p>python-docraptor Test</p>',
'test': True
}).content)
Asynchronous Example
import time
from docraptor import DocRaptor
docraptor = DocRaptor()
resp = docraptor.create({
'document_content': '<p>python-docraptor Async Test</p>',
'test': True,
'async': True
})
status_id = resp['status_id']
resp = docraptor.status(status_id)
while resp['status'] != 'completed':
time.sleep(3)
resp = docraptor.status(status_id)
with open("test_async.pdf", "wb") as f:
f.write(docraptor.download(resp['download_key']).content)
Installation
To install python-docraptor, simply:
$ pip install python-docraptor
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file python-docraptor-1.2.3.tar.gz.
File metadata
- Download URL: python-docraptor-1.2.3.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
Python-urllib/3.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35edfa93e00016c4a960ae71c05f9c63b92c627cbcca266dba87cbfede074c61
|
|
| MD5 |
0b50dfe72c9c63235e4e595e0266e4aa
|
|
| BLAKE2b-256 |
683d9a4d7c29a5edb405ca42e5f7b7a9c6a9ec984809253395924d0773bcbae4
|