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.0.tar.gz (13.7 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.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_pbn_client-0.2.0.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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.0.tar.gz
Algorithm Hash digest
SHA256 75b1079475e2b3c23a9e92c95f577ff4935f71df37a9c901e9d9638626acf1f2
MD5 b945389324f5339f9645c44701ffe448
BLAKE2b-256 e7222ef927450e8b20bc27e25010ba2e801c4b5f0b38614266dc897c3fad2ec6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_pbn_client-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b6d993cbcfef45adcaf62690ddf797f8bf7b3b8fb804f2d557aae2192fd26db6
MD5 1f2d3a351784844466d5dc05b5fbf0f0
BLAKE2b-256 a5b503b2e79e6de2ca826cd8b912374c5e3e07356d924872c215737e1c4baf17

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