Skip to main content

eSignBase Python SDK

Official Python SDK for integrating eIDAS-compliant electronic signatures into your application using the eSignBase REST API.

eSignBase provides GDPR-ready electronic signatures with EU-based infrastructure and flexible pay-as-you-go pricing — no subscriptions, no per-seat licenses.

Why eSignBase?

  • ✅ eIDAS-compliant electronic signatures
  • ✅ GDPR-aligned EU data hosting
  • ✅ No subscriptions — pay-as-you-go credits
  • ✅ Automatic token refresh — no manual token management needed
  • ✅ Lightweight, synchronous client with no heavy dependencies

Installation

pip install esignbase-sdk

Requires Python 3.10 or higher.

Quickstart

import esignbase_sdk

# 1. Create and authenticate a client
client = esignbase_sdk.OAuth2Client(
    id="your_client_id",
    secret="your_client_secret",
    scope=[esignbase_sdk.Scope.ALL],
)
esignbase_sdk.connect(client)

# 2. List available templates
templates = esignbase_sdk.get_templates(client)

# 3. Send a document for signature
recipients = [
    esignbase_sdk.Recipient(
        email="alice@example.com",
        first_name="Alice",
        last_name="Smith",
        role_name="signee_1",  # must match a role defined in the template
        locale="en",
    )
]

document = esignbase_sdk.create_document(
    client=client,
    template_id=templates[0]["id"],
    document_name="NDA Agreement",
    recipients=recipients,
)

print(document)  # {"document_id": "...", "status": "DRAFT"}

Retrieve your Client ID and Client Secret at app.esignbase.com/oauth2/client.

Authentication

The SDK uses the OAuth2 Client Credentials grant. Call connect() once to authenticate — the SDK then manages token expiry and refresh automatically for all subsequent API calls.

client = esignbase_sdk.OAuth2Client(
    id="your_client_id",
    secret="your_client_secret",
    scope=[esignbase_sdk.Scope.ALL],
)
esignbase_sdk.connect(client)

Sandbox Mode

Use the SANDBOX scope to test without consuming credits. Sandbox mode uses templates created in your sandbox environment.

client = esignbase_sdk.OAuth2Client(
    id="your_client_id",
    secret="your_client_secret",
    scope=[esignbase_sdk.Scope.ALL, esignbase_sdk.Scope.SANDBOX],
)
esignbase_sdk.connect(client)

API Reference

Scopes

Scope Description
Scope.ALL Full access (read, create, delete). Does not include sandbox.
Scope.READ Read documents and templates.
Scope.CREATE_DOCUMENT Create and send documents for signature.
Scope.DELETE Delete documents.
Scope.SANDBOX Sandbox mode — no credits consumed.

connect(client)

Authenticates with the eSignBase API and stores the access token on the client. Raises ESignBaseSDKError if authentication fails.

get_templates(client)

Returns a list of all available templates.

templates = esignbase_sdk.get_templates(client)
# [{"id": "...", "filename": "contract.pdf", "form_role_names": ["signee_1"], ...}]

get_template(client, template_id)

Returns details for a single template.

get_documents(client, limit, offset)

Returns a paginated list of documents.

result = esignbase_sdk.get_documents(client, limit=50, offset=0)
# {"documents": [...], "count": 120}

get_document(client, document_id)

Returns details for a single document, including its current status.

create_document(client, *, template_id, document_name, recipients, user_defined_metadata=None, expiration_date=None)

Creates a new document from a template and sends it to recipients.

recipients must include one Recipient per role defined in the template's form_role_names. user_defined_metadata is an optional dict[str, str] for attaching your own data (e.g. internal IDs) to the document.

from datetime import datetime

document = esignbase_sdk.create_document(
    client=client,
    template_id="your_template_id",
    document_name="Employment Contract",
    recipients=[
        esignbase_sdk.Recipient(
            email="bob@example.com",
            first_name="Bob",
            last_name="Jones",
            role_name="signee_1",
            locale="de",
        )
    ],
    user_defined_metadata={"internal_id": "EMP-2024-042"},
    expiration_date=datetime(2025, 12, 31),
)

download_document(client, document_id)

Streams a completed, signed PDF. Only available once the document status is DIGITAL_SIGNATURE_CREATED or COMPLETED.

with open("signed_contract.pdf", "wb") as f:
    for chunk in esignbase_sdk.download_document(client, document["document_id"]):
        f.write(chunk)

delete_document(client, document_id)

Deletes a document. Returns None on success.

get_credits(client)

Returns the current credit balance.

balance = esignbase_sdk.get_credits(client)
# {"credits": 42}

Error Handling

All functions raise ESignBaseSDKError on failure. The exception includes a status_code attribute with the HTTP status code where applicable.

try:
    document = esignbase_sdk.create_document(...)
except esignbase_sdk.ESignBaseSDKError as e:
    print(f"Error {e.status_code}: {e}")

Document Statuses

Status Description
DRAFT Created but not yet sent.
SENT Sent to all recipients.
PARTIALLY_SIGNED Signed by some recipients.
COMPLETED Signing process complete.
VOIDED Document expired or voided.

Full status list available in the API documentation.

Further Reading

License

MIT

Metadata

Release files for esignbase-sdk 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for esignbase-sdk 1.2.0
File Size Uploaded
esignbase_sdk-1.2.0.tar.gz 8.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for esignbase-sdk 1.2.0
File Interpreter ABI Platform
esignbase_sdk-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.9 kB

Release files / esignbase_sdk-1.2.0.tar.gz

Download URL esignbase_sdk-1.2.0.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3c59ffd64e7ce8869f91a1c296e875ef716cc128a210236c12c976e4a943b374
BLAKE2b-256 checksum
How to use checksums
bd4551fef26b862e3f1d1ff359dc36a1831ef8660c33731ccc1d7194476bb0a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 18, 2026.

Transparency log

Release files / esignbase_sdk-1.2.0-py3-none-any.whl

Download URL esignbase_sdk-1.2.0-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
21de16942f3d296da2ebf7fab43e02d62f5bd79ed0462c67f48f8e6429f9ee83
BLAKE2b-256 checksum
How to use checksums
455c4a5fdd648eb89e51c8a361f85b32dac84a16e3a143771d084a2fa9844656
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 18, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page