Python NAV core client port skeleton
Project description
qtx-nav-core
Python package for the NAV Online Szamla core client.
Install/package name: qtx-nav-core
Python import package: qtx_nav_core
Quick Start Map
If you open this package months later, start with this mental model:
NavAuth: technical user credentials for NAV signing and authenticationNavSoftwareInfo: software metadata block included in each requestNavRequestContext: immutable container that carries auth, software info, and request ID prefixNavRequestBody: abstract extension point for a concrete NAV operationNavXmlRequestBuilder: creates the full NAV XML document from context plus request bodyNavApiClient: low-level HTTP client for XML and multipart requestsNavCallSpec: one request execution description, including path and optional file upload settingsNavRequestRunner: high-level orchestrator that builds XML, sends the request, and validates NAV result statusNavDocumentStatus: parsed summary of NAV's<result>blockNavApiKind/NAV_XML_PROFILES: NAV API profile selection for OSA/eVAT namespaces and request versionsNavUtils: shared helper methods for hashing, decoding, status parsing, and response formatting
Typical Usage Flow
- Create a
NavAuthinstance. - Create a
NavSoftwareInfoinstance for the calling application. - Create a
NavRequestContextfrom the auth object and software info. - Implement a concrete
NavRequestBodysubclass for the target NAV endpoint. - Create a
NavApiClientwith the NAV base URL. - Create a
NavRequestRunnerwith the API client and request context. - Execute the call with
NavCallSpec. - Read the returned XML or let
NavValidationErrorsurface NAV-side failures.
API Kind Detection
NavApiClient.api_kind is derived from the configured base URL. URLs containing .eafa. use NavApiKind.EVAT; URLs containing .onlineszamla. use NavApiKind.OSA. NavRequestRunner passes this value to NavXmlRequestBuilder, which then selects the matching XML namespaces and request version from NAV_XML_PROFILES.
Software Info
NavSoftwareInfo is required for every request. Create and pass a populated instance into NavRequestContext; otherwise XML generation raises ValueError before the NAV call is sent.
The current model defaults are empty development placeholders only. Real callers must set the software identifier, name, version, developer contact, developer country code, and developer tax number explicitly.
software = NavSoftwareInfo(
software_id="MOCK-EVAT-12345678",
software_name="Mock eVAT Client",
software_operation="LOCAL_SOFTWARE",
software_main_version="1.0",
software_dev_name="Mock Developer",
software_dev_contact="mock.dev@example.com",
software_dev_country_code="HU",
software_dev_tax_number="12345678",
)
context = NavRequestContext(auth=auth, software=software)
Package Reference
For a longer in-package reminder that is shipped with the installed distribution, see qtx_nav_core/docs/package_map.md.
Scope
This package currently contains:
- package layout matching the Dart core library
- minimal public exports
- placeholder modules for models, services, and utils
- test directory and tooling configuration
Package layout
qtx_nav_core/
models/
services/
utils/
tests/
Development
pip install -e .[dev]
pytest
ruff check .
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters