pbn-client
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.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pbn_client-0.2.1.tar.gz | 64.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pbn_client-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 100.2 kB
Release files / pbn_client-0.2.1.tar.gz
| Download URL | pbn_client-0.2.1.tar.gz |
|---|---|
| Size | 64.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
53663e46bc6bd25282e1de43d0a33a8f36df101b2cd720481616635233a52b3d
|
|
BLAKE2b-256 checksum How to use checksums |
68cbc3c1d9f6829b07aac08ded76a57aeea7f4d23cd1027851a97b5f40c8d660
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","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.1-py3-none-any.whl
| Download URL | pbn_client-0.2.1-py3-none-any.whl |
|---|---|
| Size | 35.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c233a5ce85cedf7a05b01c86b061ad3fb7a880422df1d54591e36354da9e71de
|
|
BLAKE2b-256 checksum How to use checksums |
9b01238527ec09bf9ee507b7a2a38b1853a982afcafe0a2c97c1c9ba766804fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","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}
|