django-pbsmmapi
Code to model PBS MediaManager objects; scripts to ingest data into those models.
Introduction
This is a Django app to allow Django-based projects to work with the PBS MediaManager API. It is not expected to be a COMPLETE interface to the entirety of the PBS MediaManager; however it should allow access to all of the primary content object types.
In addition to Django, huey is used for running background ingestion tasks.
Quick start
- Add the pbsmmapi apps to your INSTALLED_APPS setting:
INSTALLED_APPS = [
...
'pbsmmapi',
'pbsmmapi.episode',
'pbsmmapi.season',
'pbsmmapi.show',
'pbsmmapi.special',
'pbsmmapi.franchise',
'pbsmmapi.changelog',
]
- You ALSO need to have PBS Media Manager credentials - an API KEY and a SECRET KEY. These also go into the
settings.pyfile of your project:
PBSMM_API_ID = os.environ["PBSMM_API_ID"]
PBSMM_API_SECRET = os.environ["PBSMM_API_SECRET"]
It's not a good idea to commit these in plain text. Set them as environment variables (as suggested above) or using some other secret management tool.
- To ingest shows and/or franchises automatically, configure
PBSMM_SHOW_SLUGSand/orPBSMM_FRANCHISE_SLUGS:
PBSMM_SHOW_SLUGS = [
"antiques-roadshow",
]
PBSMM_FRANCHISE_SLUGS = [
"masterpiece",
]
Huey will attempt to scrape all Show and/or Franchise data, including Specials, Seasons, Episodes, and Assets. The changelog endpoint will also be scraped.
Once a complete ingest has finished, changelog data is used to ingest updated and newly added objects.
Deleted objects
When the changelog reports an object as deleted, its row is kept but its ContentRecord
(mm_content) is marked with a deleted timestamp (taken from the changelog entry). The mark
also stamps the records of the object's directly-attached assets — the only descendants that
disappear silently: Media Manager requires children to be deleted before their parents, so every
franchise/show/season/episode/special gets its own changelog delete entry (which stamps its own
assets in turn), while a parent's assets never get entries of their own.
Marked objects are excluded from every ingestion path — the scrapers, the changelog API fetches
and the reingest-on-update pass all skip them, and save() will not fetch for them — so they are
neither re-fetched nor resurrected.
A delete is terminal. Recreating an object in the Media Manager Console produces a new content ID
(ingested here as a brand-new object), and unpublishing arrives as an update action, so a delete
entry is never superseded on the same content ID and there is no un-delete: the Reingest selected
items admin action simply skips deleted objects. For the same reason an asset that drops out of
its parent's asset list is left untouched on reingest — if it was really deleted, its own changelog
delete entry marks it.
Rows are never deleted locally, so consuming projects should filter them out where appropriate:
Show.objects.filter(mm_content__deleted__isnull=True)
Delete entries already recorded in the changelog table are applied automatically by a one-time
(idempotent) data migration when you run migrate after upgrading.
Metadata
Release files for django-pbsmmapi 1.4.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_pbsmmapi-1.4.4.tar.gz | 89.8 kB | With provenance | Details for django_pbsmmapi-1.4.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_pbsmmapi-1.4.4-py3-none-any.whl | Python 3 | none | any | Details for django_pbsmmapi-1.4.4-py3-none-any.whl |
Total release size: 239.6 kB
Release files / django_pbsmmapi-1.4.4.tar.gz
| Download URL | django_pbsmmapi-1.4.4.tar.gz |
|---|---|
| Size | 89.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4725a2b79b1b128e719e930d7f1615beb12325c191cbfe4be00d5f6054738143
|
|
BLAKE2b-256 checksum How to use checksums |
a3946a1566e261798cf7d9e709ac5f345ad49bc6746dc555046d8e27d6c7e7c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.
Transparency logRelease files / django_pbsmmapi-1.4.4-py3-none-any.whl
| Download URL | django_pbsmmapi-1.4.4-py3-none-any.whl |
|---|---|
| Size | 149.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b27b809bdc58e5df5e6ff5489df2ea4335af61ed5d0ee6d1a06984a7f815c6ac
|
|
BLAKE2b-256 checksum How to use checksums |
e930412bffe95a4120b6d6af4ba012a738fd91b180979e86eef33fe8c85f5304
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.
Transparency logSecurity for django-pbsmmapi 1.4.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for django_pbsmmapi-1.4.4.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.