Headless API
Headless API Python client, to be used for simple synchronous integration.
Configuration
| Name | Type | Default | Description |
|---|---|---|---|
| HEADLESS_BASE_URL | str |
https://headless.bemisc.com/ |
The base URL that is going to be used for API connections. |
| HEADLESS_KEY | str |
None |
The key sent in the X-Headless-Key header of the requests, required when Headless has one defined. |
Example
import headless
api = headless.API(key="my_key")
image = api.render("https://example.com/")
pdf = api.render_contents(
"<html><head><style>@page { size: A3; }</style></head><body>Hello</body></html>",
format="pdf",
prefer_css_page_size=True,
)
with open("hello.pdf", "wb") as file:
file.write(pdf)
print(api.info()["version"])
The parameters of render() (a URL) and render_contents() (an HTML document, sent as UTF-8) are the query parameters of Headless, described in its README, with the boolean ones (eg: prefer_css_page_size) as True or False. The images and PDFs are returned as bytes and the errors of Headless (eg: Invalid key) are raised as appier.HTTPError. The key header and the HTML documents require Headless 0.3.0 or later.
License
Headless API is currently licensed under the Apache License, Version 2.0.
Build Automation
Metadata
Release files for headless-api 0.1.0
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 |
|---|---|---|---|---|
| headless_api-0.1.0.tar.gz | 11.1 kB | Without provenance | Details for headless_api-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| headless_api-0.1.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for headless_api-0.1.0-py2.py3-none-any.whl |
Total release size: 23.6 kB
Release files / headless_api-0.1.0.tar.gz
| Download URL | headless_api-0.1.0.tar.gz |
|---|---|
| Size | 11.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4174ac8f596b6bbd69a77a6ac84237add77f935895e0a98ba415612285b552f1
|
|
BLAKE2b-256 checksum How to use checksums |
2a67bf42ebce74ef84dad59a9e81df1f864094c770e790d8042e8600eb681fea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.10
|
Release files / headless_api-0.1.0-py2.py3-none-any.whl
| Download URL | headless_api-0.1.0-py2.py3-none-any.whl |
|---|---|
| Size | 12.6 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
f1892413a132e2259f29c683c1843f6de6a5f70b6ab17910f895582f53b3f29d
|
|
BLAKE2b-256 checksum How to use checksums |
ce427d377434acc246962c1c6e9cef5f3094727ad58a39c240b129704ba7c52a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.10
|
Security for headless-api 0.1.0
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.