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.1.0.tar.gz (10.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.1.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_pbn_client-0.1.0.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for django_pbn_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 12ee7d94b93ab3b30768b695e23e10346b51011f82bbdbdb7a48f9c1ea48d868
MD5 fd8b9c7ea51c9d9a86453e151db58222
BLAKE2b-256 f16bf84a5897bb7a7d06b5f61afad994a024942b493965e5532a1478ba5aecad

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_pbn_client-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for django_pbn_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7ed7834538b32c6d4659d2f6d29d4547610d5f5c54950a5a2e646517ed230e66
MD5 f2ae7301e7980623a2e9085755c6072e
BLAKE2b-256 24f137b0264e1d0c545aa8f74968ef03633df885abdcc6946de03270a8c5995c

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