Skip to main content

pbn-client

CI License: MIT

pbn-client is a framework-independent Python client for communication with the Polish Bibliography Network (PBN) API. It provides HTTP authentication, pagination, dictionary and publication endpoints, and institution-profile statement operations.

The package does not depend on Django or an external error-reporting service. Projects that persist downloaded PBN data in Django should use the companion django-pbn-client package.

Installation

pip install pbn-client

Python 3.10 through 3.14 is supported.

Basic usage

from pbn_client import PBNClient, RequestsTransport

transport = RequestsTransport(
    app_id="application-id",
    app_token="application-token",
    base_url="https://pbn-micro-alpha.opi.org.pl",
    user_token="user-token",
    timeout=(30, 120),
)
client = PBNClient(transport)

languages = list(client.get_languages())

Credentials should normally be supplied explicitly. The interactive command helpers also understand PBN_CLIENT_APP_ID, PBN_CLIENT_APP_TOKEN, PBN_CLIENT_BASE_URL, PBN_CLIENT_USER_TOKEN, and PBN_CLIENT_HTTP_TIMEOUT. A timeout may be a single number or a connect,read pair.

Error reporting

The standalone default reporter is a no-op. An application can inject any object implementing ErrorReporter when it constructs a transport:

import rollbar

from pbn_client import RequestsTransport

transport = RequestsTransport(
    "application-id",
    "application-token",
    "https://pbn-micro-alpha.opi.org.pl",
    reporter=rollbar,
)

The reporter receives only scrubbed diagnostic metadata. Response bodies and authentication header values are not sent to it. LoggingReporter, NullReporter, and set_default_reporter() are also available for applications that prefer a process-wide policy.

Development

From the repository root:

uv run --isolated pytest
uv run ruff check .
uv build

License

pbn-client is released under the MIT License.

Metadata

Release files for pbn-client 0.2.3

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

Source distribution (sdist)

Source distribution for pbn-client 0.2.3
File Size Uploaded Provenance Actions
pbn_client-0.2.3.tar.gz 66.3 kB Without provenance Details for pbn_client-0.2.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pbn-client 0.2.3
File Interpreter ABI Platform Actions
pbn_client-0.2.3-py3-none-any.whl Python 3 none any Details for pbn_client-0.2.3-py3-none-any.whl

Total release size: 103.0 kB

Release files / pbn_client-0.2.3.tar.gz

Download URL pbn_client-0.2.3.tar.gz
Size 66.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6d2ccc475ae570c6fff5dbe44ae79cbe368100ce9cc911b7b3dcbf80979feb6f
BLAKE2b-256 checksum
How to use checksums
fdcd1e5c1d7738a38b554738cc80a27a540b6ee59b4db2a14cab22444788272a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pbn_client-0.2.3-py3-none-any.whl

Download URL pbn_client-0.2.3-py3-none-any.whl
Size 36.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
383055a8d84ca47debc7a9bb3bddf357438dd904d4252a07e3024c7a03d85ac2
BLAKE2b-256 checksum
How to use checksums
bf83cfacd469f34751bf9342f67061f178f5b8f0aefb261fa5bf8f5172fc5970
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for pbn-client 0.2.3

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.

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