Skip to main content

Django persistence helpers for data downloaded from PBN

Project description

django-pbn-client

CI License: MIT Python

Reusable Django models and persistence services for data downloaded from the Polish Bibliography Network (PBN).

The package deliberately does not define concrete application models or migrations. Applications subclass BasePBNMongoDBModel and retain ownership of their database schema:

from django.db import models
from django_pbn_client import BasePBNMongoDBModel


class Publication(BasePBNMongoDBModel):
    title = models.TextField(blank=True, default="")
    pull_up_on_save = ["title"]

Downloaded objects can then be stored atomically:

from django_pbn_client import download_pbn_objects, upsert_pbn_object

publication = upsert_pbn_object(payload, Publication)
download_pbn_objects(client.get_publications(), Publication)

django-pbn-client depends only on Django and the transport-level pbn-client package. Progress bars, background jobs, concrete relationships, and application-specific integration remain the responsibility of the host application.

Concurrent page downloads use threads by default. The optional method="processes" mode uses the POSIX fork start method and is therefore not available on Windows.

Installation

pip install django-pbn-client

Development

This package depends on the transport-level pbn-client package. Until pbn-client is published to PyPI, a dev-only [tool.uv.sources] entry in pyproject.toml resolves it from a sibling checkout, so clone both repositories side by side:

git clone https://github.com/iplweb/pbn-client.git
git clone https://github.com/iplweb/django-pbn-client.git
cd django-pbn-client

The source override is ignored when building or publishing wheels, so end users still get pbn-client from PyPI via the version constraint in [project.dependencies].

Run the standalone package tests with:

uv run --group dev pytest

License

Released under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_pbn_client-0.2.2.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_pbn_client-0.2.2-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file django_pbn_client-0.2.2.tar.gz.

File metadata

  • Download URL: django_pbn_client-0.2.2.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for django_pbn_client-0.2.2.tar.gz
Algorithm Hash digest
SHA256 76fed9152c25821e78782228af9354fbc9e96c0eb12dac56dfefeafebe678363
MD5 0877dc92e34089a4396e87a7e76866b8
BLAKE2b-256 8d22caebba16664980203543eb268c36e548f62319df7d6700dbcc6554aa9d16

See more details on using hashes here.

File details

Details for the file django_pbn_client-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: django_pbn_client-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for django_pbn_client-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4ed455b0d4f72a3aebedc68f06ec751291e833a0dbda29cd843a970e4af0258d
MD5 a53b162f591f205a9a9ad9f5b21432d9
BLAKE2b-256 67045b1aef47d0eb5da26ffbb9af4e11e174210f6917c563e2330fe7eaa4c31f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page