django-pbsmmapi 1.3.4b0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- django_pbsmmapi-1.3.4b0/.gitignore +72 -0
- django_pbsmmapi-1.3.4b0/LICENSE +20 -0
- django_pbsmmapi-1.3.4b0/PKG-INFO +83 -0
- django_pbsmmapi-1.3.4b0/README.md +51 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/__init__.py +1 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/abstract/__init__.py +0 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/abstract/admin.py +64 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/abstract/helpers.py +26 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/abstract/models.py +639 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/api/__init__.py +0 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/api/api.py +28 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/api/helpers.py +21 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/asset/__init__.py +0 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/asset/admin.py +140 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/asset/apps.py +6 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/asset/helpers.py +71 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/asset/migrations/0001_initial.py +294 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/asset/migrations/0002_move_assets_data.py +75 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/asset/migrations/0003_remove_asset_images_json.py +16 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/asset/migrations/0004_alter_asset_date_last_api_update.py +25 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/asset/migrations/0005_remove_asset_object_type_asset_asset_type.py +26 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/asset/migrations/0006_asset_franchise.py +29 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/asset/migrations/0007_alter_asset_id.py +23 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/asset/migrations/0008_remove_asset_windows_alter_asset_availability_and_more.py +90 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/asset/migrations/0009_alter_asset_options.py +21 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/asset/migrations/__init__.py +0 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/asset/models.py +342 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/asset/tasks.py +45 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/changelog/__init__.py +0 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/changelog/apps.py +6 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/changelog/migrations/0001_initial.py +112 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/changelog/migrations/__init__.py +0 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/changelog/models.py +199 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/changelog/tasks.py +420 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/episode/__init__.py +0 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/episode/admin.py +144 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/episode/apps.py +6 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/episode/forms.py +21 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/episode/migrations/0001_initial.py +521 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/episode/migrations/0002_auto_20190430_1853.py +34 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/episode/migrations/0003_auto_20190430_1926.py +22 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/episode/migrations/0004_auto_20190430_1949.py +22 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/episode/migrations/0005_remove_pbsmmepisode_live_as_of_and_more.py +20 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/episode/migrations/0006_remove_pbsmmepisodeasset_override_default_asset.py +16 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/episode/migrations/0007_remove_pbsmmepisode_canonical_image_type_override_and_more.py +20 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/episode/migrations/0008_remove_pbsmmepisodeasset_canonical_image_type_override.py +16 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/episode/migrations/0009_alter_pbsmmepisode_funder_message_and_more.py +129 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/episode/migrations/0010_pbsmmepisodeasset_images_json.py +22 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/episode/migrations/0011_delete_pbsmmepisodeasset.py +16 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/episode/migrations/0011_remove_pbsmmepisodeasset_chapters_and_more.py +28 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/episode/migrations/0012_remove_pbsmmepisode_segment.py +16 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/episode/migrations/0013_alter_pbsmmepisode_date_last_api_update.py +25 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/episode/migrations/0014_rename_pbsmmepisode_episode.py +18 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/episode/migrations/0015_alter_episode_id.py +23 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/episode/migrations/0016_alter_episode_json_alter_episode_links.py +36 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/episode/migrations/0017_episode_provisional.py +21 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/episode/migrations/0018_auto_increment_ordinal.py +40 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/episode/migrations/__init__.py +0 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/episode/models.py +148 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/franchise/__init__.py +0 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/franchise/admin.py +196 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/franchise/apps.py +6 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/franchise/forms.py +22 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/franchise/migrations/0001_initial.py +239 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/franchise/migrations/0002_alter_franchise_genre_alter_franchise_images_and_more.py +66 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/franchise/migrations/__init__.py +0 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/franchise/models.py +96 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/franchise/tasks.py +24 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/franchise/tests.py +0 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/franchise/views.py +0 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/season/__init__.py +0 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/season/admin.py +156 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/season/apps.py +6 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/season/forms.py +21 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/season/migrations/0001_initial.py +486 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/season/migrations/0002_auto_20190430_1853.py +27 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/season/migrations/0003_pbsmmseason_show_api_id.py +22 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/season/migrations/0004_auto_20190430_1949.py +22 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/season/migrations/0005_auto_20190502_1629.py +20 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/season/migrations/0006_remove_pbsmmseason_live_as_of_and_more.py +20 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/season/migrations/0007_remove_pbsmmseasonasset_override_default_asset.py +16 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/season/migrations/0008_remove_pbsmmseason_canonical_image_type_override_and_more.py +20 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/season/migrations/0009_alter_pbsmmseason_images_alter_pbsmmseason_links_and_more.py +132 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/season/migrations/0010_pbsmmseason_images_json_pbsmmseasonasset_images_json.py +29 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/season/migrations/0011_delete_pbsmmseasonasset.py +16 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/season/migrations/0011_remove_pbsmmseasonasset_chapters_and_more.py +28 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/season/migrations/0012_remove_pbsmmseason_images_json.py +16 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/season/migrations/0013_alter_pbsmmseason_date_last_api_update.py +25 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/season/migrations/0014_rename_pbsmmseason_season.py +19 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/season/migrations/0015_alter_season_id.py +23 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/season/migrations/0016_alter_season_images_alter_season_json_and_more.py +46 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/season/migrations/0017_season_provisional.py +21 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/season/migrations/0018_auto_increment_ordinal.py +61 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/season/migrations/__init__.py +0 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/season/models.py +152 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/show/__init__.py +0 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/show/admin.py +251 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/show/apps.py +6 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/show/forms.py +21 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/show/migrations/0001_initial.py +597 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/show/migrations/0002_remove_pbsmmshow_live_as_of_and_more.py +20 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/show/migrations/0003_remove_pbsmmshowasset_override_default_asset.py +16 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/show/migrations/0004_remove_pbsmmshow_canonical_image_type_override_and_more.py +20 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/show/migrations/0005_pbsmmshow_images_json_pbsmmshowasset_images_json_and_more.py +183 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/show/migrations/0006_delete_pbsmmshowasset.py +16 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/show/migrations/0006_remove_pbsmmshowasset_chapters_and_more.py +28 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/show/migrations/0007_remove_pbsmmshow_images_json.py +16 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/show/migrations/0008_alter_pbsmmshow_date_last_api_update.py +25 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/show/migrations/0009_rename_pbsmmshow_show.py +19 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/show/migrations/0010_show_franchise_show_franchise_api_id.py +36 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/show/migrations/0011_alter_show_id.py +23 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/show/migrations/0012_show_provisional_show_season_ordinal_and_more.py +90 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/show/migrations/0013_remove_show_season_ordinal_alter_show_ordinal_season.py +29 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/show/migrations/__init__.py +0 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/show/models.py +186 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/show/tasks.py +23 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/special/__init__.py +0 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/special/admin.py +143 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/special/apps.py +6 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/special/forms.py +15 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/special/migrations/0001_initial.py +475 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/special/migrations/0002_auto_20190430_1853.py +27 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/special/migrations/0003_pbsmmspecial_show_api_id.py +22 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/special/migrations/0004_auto_20190430_1949.py +22 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/special/migrations/0005_remove_pbsmmspecial_live_as_of_and_more.py +20 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/special/migrations/0006_remove_pbsmmspecialasset_override_default_asset.py +16 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/special/migrations/0007_remove_pbsmmspecialasset_canonical_image_type_override.py +16 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/special/migrations/0008_pbsmmspecialasset_images_json_and_more.py +129 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/special/migrations/0009_delete_pbsmmspecialasset.py +16 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/special/migrations/0009_remove_pbsmmspecialasset_chapters_and_more.py +28 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/special/migrations/0010_alter_pbsmmspecial_date_last_api_update.py +25 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/special/migrations/0011_rename_pbsmmspecial_special.py +18 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/special/migrations/0012_alter_special_id.py +23 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/special/migrations/0013_alter_special_json_alter_special_links.py +36 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/special/migrations/0014_special_provisional.py +21 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/special/migrations/__init__.py +0 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/special/models.py +88 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/test/__init__.py +0 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/test/settings.py +151 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/test/test_show_ingest.py +135 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/test/url_map.py +3194 -0
- django_pbsmmapi-1.3.4b0/pbsmmapi/test/urls.py +19 -0
- django_pbsmmapi-1.3.4b0/pyproject.toml +72 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
*OBSOLETE*
|
|
2
|
+
|
|
3
|
+
# Compiled source #
|
|
4
|
+
###################
|
|
5
|
+
*.pyc
|
|
6
|
+
|
|
7
|
+
# Packages #
|
|
8
|
+
############
|
|
9
|
+
*.7z
|
|
10
|
+
*.dmg
|
|
11
|
+
*.gz
|
|
12
|
+
*.iso
|
|
13
|
+
*.jar
|
|
14
|
+
*.rar
|
|
15
|
+
*.tar
|
|
16
|
+
*.zip
|
|
17
|
+
|
|
18
|
+
# Logs and databases #
|
|
19
|
+
######################
|
|
20
|
+
*.log
|
|
21
|
+
*.sql
|
|
22
|
+
*.sqlite
|
|
23
|
+
*.db
|
|
24
|
+
|
|
25
|
+
# OS generated files #
|
|
26
|
+
######################
|
|
27
|
+
.DS_Store
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# media #
|
|
31
|
+
#########
|
|
32
|
+
media/
|
|
33
|
+
media/*
|
|
34
|
+
|
|
35
|
+
# backup #
|
|
36
|
+
##########
|
|
37
|
+
__BACKUP__/
|
|
38
|
+
__BACKUP__/*
|
|
39
|
+
|
|
40
|
+
# data #
|
|
41
|
+
########
|
|
42
|
+
__DATA__/
|
|
43
|
+
__DATA__/*
|
|
44
|
+
|
|
45
|
+
# media #
|
|
46
|
+
#########
|
|
47
|
+
static/
|
|
48
|
+
static/*
|
|
49
|
+
|
|
50
|
+
# Redirection #
|
|
51
|
+
############
|
|
52
|
+
|
|
53
|
+
# front end tooling #
|
|
54
|
+
**/node_modules/**
|
|
55
|
+
**/.sass-cache/**
|
|
56
|
+
*.css.map
|
|
57
|
+
|
|
58
|
+
# whoosh
|
|
59
|
+
whoosh_index/
|
|
60
|
+
|
|
61
|
+
Pipfile
|
|
62
|
+
Pipfile.lock
|
|
63
|
+
|
|
64
|
+
*.egg-info/
|
|
65
|
+
|
|
66
|
+
.coverage
|
|
67
|
+
.python-version
|
|
68
|
+
.tox/
|
|
69
|
+
|
|
70
|
+
build/
|
|
71
|
+
django_pbsmmapi.egg-info/
|
|
72
|
+
dist
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014 WGBH Educational Foundation
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: django-pbsmmapi
|
|
3
|
+
Version: 1.3.4b0
|
|
4
|
+
Summary: Django models that import content from the PBS MediaManager API
|
|
5
|
+
Author: Bob Donahue
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
9
|
+
Classifier: Environment :: Web Environment
|
|
10
|
+
Classifier: Framework :: Django
|
|
11
|
+
Classifier: Framework :: Django :: 4.0
|
|
12
|
+
Classifier: Framework :: Django :: 4.1
|
|
13
|
+
Classifier: Framework :: Django :: 4.2
|
|
14
|
+
Classifier: Framework :: Django :: 5.0
|
|
15
|
+
Classifier: Framework :: Django :: 5.1
|
|
16
|
+
Classifier: Framework :: Django :: 5.2
|
|
17
|
+
Classifier: Intended Audience :: Developers
|
|
18
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
19
|
+
Classifier: Natural Language :: English
|
|
20
|
+
Classifier: Operating System :: OS Independent
|
|
21
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
|
22
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
|
23
|
+
Requires-Python: <4.0,>=3.10
|
|
24
|
+
Requires-Dist: django>=4.0
|
|
25
|
+
Requires-Dist: huey>=2.5.3
|
|
26
|
+
Requires-Dist: nltk>=3.9
|
|
27
|
+
Requires-Dist: pycaption>=2.2.16
|
|
28
|
+
Requires-Dist: python-dateutil
|
|
29
|
+
Requires-Dist: pytz
|
|
30
|
+
Requires-Dist: requests
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
|
|
33
|
+
# django-pbsmmapi
|
|
34
|
+
|
|
35
|
+
Code to model PBS MediaManager objects; scripts to ingest data into those models.
|
|
36
|
+
|
|
37
|
+
## Introduction
|
|
38
|
+
|
|
39
|
+
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.
|
|
40
|
+
|
|
41
|
+
In addition to Django, [huey](https://huey.readthedocs.io/en/latest/) is used for running background ingestion tasks.
|
|
42
|
+
|
|
43
|
+
## Quick start
|
|
44
|
+
|
|
45
|
+
1. Add the pbsmmapi apps to your INSTALLED_APPS setting:
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
INSTALLED_APPS = [
|
|
49
|
+
...
|
|
50
|
+
'pbsmmapi',
|
|
51
|
+
'pbsmmapi.episode',
|
|
52
|
+
'pbsmmapi.season',
|
|
53
|
+
'pbsmmapi.show',
|
|
54
|
+
'pbsmmapi.special',
|
|
55
|
+
'pbsmmapi.franchise',
|
|
56
|
+
'pbsmmapi.changelog',
|
|
57
|
+
]
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
2. You ALSO need to have PBS Media Manager credentials - an API KEY and a SECRET KEY. These also go into the `settings.py` file of your project:
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
PBSMM_API_ID = os.environ["PBSMM_API_ID"]
|
|
64
|
+
PBSMM_API_SECRET = os.environ["PBSMM_API_SECRET"]
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
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.
|
|
68
|
+
|
|
69
|
+
3. To ingest shows and/or franchises automatically, configure `PBSMM_SHOW_SLUGS` and/or `PBSMM_FRANCHISE_SLUGS`:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
PBSMM_SHOW_SLUGS = [
|
|
73
|
+
"antiques-roadshow",
|
|
74
|
+
]
|
|
75
|
+
|
|
76
|
+
PBSMM_FRANCHISE_SLUGS = [
|
|
77
|
+
"masterpiece",
|
|
78
|
+
]
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Huey will attempt to scrape all Show and/or Franchise data, including Specials, Seasons, Episodes, and Assets. The changelog endpoint will also be scraped.
|
|
82
|
+
|
|
83
|
+
Once a complete ingest has finished, changelog data is used to ingest updated and newly added objects.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# django-pbsmmapi
|
|
2
|
+
|
|
3
|
+
Code to model PBS MediaManager objects; scripts to ingest data into those models.
|
|
4
|
+
|
|
5
|
+
## Introduction
|
|
6
|
+
|
|
7
|
+
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.
|
|
8
|
+
|
|
9
|
+
In addition to Django, [huey](https://huey.readthedocs.io/en/latest/) is used for running background ingestion tasks.
|
|
10
|
+
|
|
11
|
+
## Quick start
|
|
12
|
+
|
|
13
|
+
1. Add the pbsmmapi apps to your INSTALLED_APPS setting:
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
INSTALLED_APPS = [
|
|
17
|
+
...
|
|
18
|
+
'pbsmmapi',
|
|
19
|
+
'pbsmmapi.episode',
|
|
20
|
+
'pbsmmapi.season',
|
|
21
|
+
'pbsmmapi.show',
|
|
22
|
+
'pbsmmapi.special',
|
|
23
|
+
'pbsmmapi.franchise',
|
|
24
|
+
'pbsmmapi.changelog',
|
|
25
|
+
]
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
2. You ALSO need to have PBS Media Manager credentials - an API KEY and a SECRET KEY. These also go into the `settings.py` file of your project:
|
|
29
|
+
|
|
30
|
+
```python
|
|
31
|
+
PBSMM_API_ID = os.environ["PBSMM_API_ID"]
|
|
32
|
+
PBSMM_API_SECRET = os.environ["PBSMM_API_SECRET"]
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
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.
|
|
36
|
+
|
|
37
|
+
3. To ingest shows and/or franchises automatically, configure `PBSMM_SHOW_SLUGS` and/or `PBSMM_FRANCHISE_SLUGS`:
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
PBSMM_SHOW_SLUGS = [
|
|
41
|
+
"antiques-roadshow",
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
PBSMM_FRANCHISE_SLUGS = [
|
|
45
|
+
"masterpiece",
|
|
46
|
+
]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Huey will attempt to scrape all Show and/or Franchise data, including Specials, Seasons, Episodes, and Assets. The changelog endpoint will also be scraped.
|
|
50
|
+
|
|
51
|
+
Once a complete ingest has finished, changelog data is used to ingest updated and newly added objects.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.3.4b0"
|
|
File without changes
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
from django.contrib import admin
|
|
2
|
+
from django.contrib.admin import site
|
|
3
|
+
from django.utils.safestring import mark_safe
|
|
4
|
+
|
|
5
|
+
# This removed the delete function from the Admin action dropdown.
|
|
6
|
+
# You can 're-add' it, if necessary, by explicitly adding it to the
|
|
7
|
+
# actions parameter for a given ModelAdmin instance.
|
|
8
|
+
site.disable_action("delete_selected")
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class PBSMMAbstractAdmin(admin.ModelAdmin):
|
|
12
|
+
actions = [
|
|
13
|
+
"force_reingest",
|
|
14
|
+
]
|
|
15
|
+
search_fields = [
|
|
16
|
+
"title",
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
def force_reingest(self, request, queryset):
|
|
20
|
+
# queryset is the list of Asset items that were selected.
|
|
21
|
+
for item in queryset:
|
|
22
|
+
item.ingest_on_save = True
|
|
23
|
+
# HOW DO I FIND OUT IF THE save() was successful?
|
|
24
|
+
item.save()
|
|
25
|
+
|
|
26
|
+
force_reingest.short_description = "Reingest selected items."
|
|
27
|
+
|
|
28
|
+
def assemble_asset_table(self, obj):
|
|
29
|
+
asset_list = obj.assets.all()
|
|
30
|
+
out = get_abstract_asset_table(asset_list)
|
|
31
|
+
return mark_safe(out)
|
|
32
|
+
|
|
33
|
+
assemble_asset_table.short_description = "Assets"
|
|
34
|
+
|
|
35
|
+
class Meta:
|
|
36
|
+
abstract = True
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def get_abstract_asset_table(object_list):
|
|
40
|
+
url = "/admin/asset/asset"
|
|
41
|
+
if len(object_list) < 1:
|
|
42
|
+
return "(No assets)"
|
|
43
|
+
out = '<table width="100%" border=2>'
|
|
44
|
+
out += (
|
|
45
|
+
'\n<tr style="background-color:'
|
|
46
|
+
' #999;l"><th>Title</th><th>Type</th>'
|
|
47
|
+
"<th>Duration</th><th>Avail?</th><th>API</th></tr>"
|
|
48
|
+
)
|
|
49
|
+
for item in object_list:
|
|
50
|
+
row_color = "#ffffff;"
|
|
51
|
+
|
|
52
|
+
out += '\n<tr style="background-color:%s">' % row_color
|
|
53
|
+
out += '\n\t<td><a href="%s/%d/change/" target="_new">%s</a></td>' % (
|
|
54
|
+
url,
|
|
55
|
+
item.id,
|
|
56
|
+
item.title,
|
|
57
|
+
)
|
|
58
|
+
out += "\n\t<td>%s</td>" % item.asset_type
|
|
59
|
+
out += "\n\t<td>%s</td>" % item.formatted_duration
|
|
60
|
+
out += "\n\t<td>%s</td>" % item.asset_publicly_available()
|
|
61
|
+
out += '\n\t<td><a href="%s" target="_new">API</a></td>' % item.api_endpoint
|
|
62
|
+
out += "\n</tr>"
|
|
63
|
+
out += "\n</table>"
|
|
64
|
+
return out
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
|
|
3
|
+
import pytz
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def fix_non_aware_datetime(obj):
|
|
7
|
+
"""
|
|
8
|
+
Ugh - for SOME REASON some of the DateTime values returned by the PBS MM
|
|
9
|
+
API are NOT time zone aware. SO - fudge them by adding 00:00:00 UTC (if
|
|
10
|
+
even a time is not provided) or assume the time is UTC.
|
|
11
|
+
"""
|
|
12
|
+
if obj is None:
|
|
13
|
+
return None
|
|
14
|
+
if ":" not in obj: # oops no time
|
|
15
|
+
obj += " 00:00:00"
|
|
16
|
+
if "+" not in obj: # no time zone - use UTC
|
|
17
|
+
if "Z" not in obj:
|
|
18
|
+
obj += "+00:00"
|
|
19
|
+
return obj
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def time_zone_aware_now():
|
|
23
|
+
"""
|
|
24
|
+
This just sends back a time zone aware "now()" with UTC as the time zone.
|
|
25
|
+
"""
|
|
26
|
+
return datetime.now(pytz.utc)
|