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.

Release files for pbn-client 0.2.2

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.2
File Size Uploaded
pbn_client-0.2.2.tar.gz 64.8 kB Details

Built distribution (wheel)

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

Total release size: 100.8 kB

Release files / pbn_client-0.2.2.tar.gz

Download URL pbn_client-0.2.2.tar.gz
Size 64.8 kB
Tags Source
SHA-256 checksum
How to use checksums
21b78873fbea40c4e13cee39c75ea3e1411429dd21a9c772c2fac83963e3f6c4
BLAKE2b-256 checksum
How to use checksums
fb53ef61b6f58592eef44a27a216e9a7687a782a09f5e3f2d499860e59bd9c0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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.2-py3-none-any.whl

Download URL pbn_client-0.2.2-py3-none-any.whl
Size 36.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
07dc76a80bbc4c94f7b1a6d96ce9c42391b85cdbd4ef22ae36aec2eb67f386a7
BLAKE2b-256 checksum
How to use checksums
44ceb8549f6fe70cd5965c161d0a2c6cd92ee6d65d3a5d818ec4904d8efdfdf6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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 history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

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