A client library for accessing Gotenberg
Reason this release was yanked:
Broken multi-file upload
Project description
Python client for Gotenberg
- Client library for accessing Gotenberg.
- Compatible with v7 of the Gotenberg API.
- Autogenerated using openapi-python-client.
Usage
First, create a client:
from gotenberg_client import Client
client = Client(base_url="http://gotenberg:3000")
If the endpoints you're going to hit require authentication, use AuthenticatedClient
instead:
from gotenberg_client import AuthenticatedClient
client = AuthenticatedClient(base_url="http://gotenberg:3000", token="SuperSecretToken")
Now call your endpoint and use your models:
from typing import Any
from gotenberg_client.models import URLConversionRequestBody
from gotenberg_client.api.chromium import post_forms_chromium_convert_url
from gotenberg_client.types import Response
response: Response[Any] = post_forms_chromium_convert_url.sync_detailed(
client=client, body=URLConversionRequestBody(url="http://example.org")
)
pdf: bytes = response.content
Or do the same thing with an async version:
from typing import Any
from gotenberg_client.models import URLConversionRequestBody
from gotenberg_client.api.chromium import post_forms_chromium_convert_url
from gotenberg_client.types import Response
response: Response[Any] = await post_forms_chromium_convert_url.asyncio_detailed(
client=client, body=URLConversionRequestBody(url="http://example.org")
)
pdf: bytes = response.content
By default, when you're calling an HTTPS API it will attempt to verify that SSL is working correctly. Using certificate verification is highly recommended most of the time, but sometimes you may need to authenticate to a server (especially an internal server) using a custom certificate bundle.
client = AuthenticatedClient(
base_url="https://gotenberg.svc",
token="SuperSecretToken",
verify_ssl="/path/to/certificate_bundle.pem",
)
You can also disable certificate validation altogether, but beware that this is a security risk.
client = AuthenticatedClient(
base_url="https://gotenberg.svc",
token="SuperSecretToken",
verify_ssl=False
)
Since Gotenberg returns binary responses (application/pdf),
the auto-parsing feature of openapi-python-client
is omitted.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for gotenberg_client-7.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45523d146ff8ed5611d243c8de91c26489b79f112a71c4b3a80ffef13eac38b5 |
|
MD5 | fee895a02d12095fb7089186011389bb |
|
BLAKE2b-256 | 3efdb3c3932ef5b4e26fc73a5e504ebc30934527259b623229dcf3c18574b32a |