GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - VitexSoftware/python3-libdatovka: Pythonic ctypes wrapper around libdatovka for the Czech ISDS Data Box system

BranchesTags
Open more actions menu

Latest commit

 

History

11 Commits
11 Commits

Folders and files

NameName
Last commit message
Last commit date
debian
debian
 
 
src/datovka
src/datovka
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
pyproject.toml
pyproject.toml
 
 
setup.cfg
setup.cfg
 
 

Repository files navigation

datovka

python3-libdatovka logo

A Pythonic ctypes wrapper around libdatovka, the C client library for the Czech ISDS ("Datové schránky" / Data Box) system.

No compiled extension, no SWIG — this loads libdatovka.so at runtime and exposes a small, high-level surface covering what a typical integration needs: login, list messages, fetch a message with its attachments, mark as read, send a new message, and look up a recipient's data box ID.

from datovka import DatovkaClient, OutgoingDocument

with DatovkaClient(url, username, password) as client:
    for envelope in client.list_received_messages(limit=10):
        print(envelope.message_id, envelope.subject, envelope.sender_name)

    message = client.get_received_message(envelope.message_id)
    for doc in message.documents:
        print(doc.filename, doc.mime_type, len(doc.data), "bytes")

    # Sending a new message needs exactly one is_main=True document.
    with open("smlouva.pdf", "rb") as f:
        pdf_bytes = f.read()
    client.send_message(
        "5drr7us",
        "Smlouva k podpisu",
        [OutgoingDocument("smlouva.pdf", "application/pdf", pdf_bytes, is_main=True)],
    )

    # Live search is rate-limited; prefer an offline directory (e.g. the
    # seznamds package) for routine lookups and use this as a fallback.
    for box in client.find_box_live("Firma s.r.o."):
        print(box["box_id"], box["name"])

Requirements

  • libdatovka8 (the shared library; version 0.8.0 or newer is needed for report_spam() and Envelope.spam_flag — with older versions report_spam() raises NotImplementedError and spam_flag is None) — see the libdatovka packaging
  • Python >= 3.9

Scope

This wraps a practical subset of libdatovka's ~166 isds_* functions, not the full API: session lifecycle (login/logout/ping), listing received and sent messages, fetching a full message with attachments, marking a message as read, reporting a message as spam (report_spam), sending a new message with attachments (send_message), and recipient lookup via the live fulltext search (find_box_live). The C structs it decodes (isds_envelope, isds_message, isds_document, isds_list, isds_fulltext_result) are modelled field-for-field to match libdatovka/isds.h; extending coverage to more isds_* calls means adding a prototype in datovka/_capi.py and a thin method in datovka/client.py.

License

LGPL-3.0-or-later, matching libdatovka.

About

Pythonic ctypes wrapper around libdatovka for the Czech ISDS Data Box system

Resources

Readme
LGPL-3.0 license
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.