compuglobal 0.3.2__tar.gz → 0.3.4__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.
- {compuglobal-0.3.2 → compuglobal-0.3.4}/.vscode/settings.json +6 -1
- {compuglobal-0.3.2 → compuglobal-0.3.4}/PKG-INFO +1 -1
- {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/__init__.py +1 -1
- {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/models/comic.py +9 -6
- {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/models/episode.py +6 -6
- {compuglobal-0.3.2 → compuglobal-0.3.4}/docs/conf.py +3 -1
- {compuglobal-0.3.2 → compuglobal-0.3.4}/examples/basic_example.py +14 -8
- {compuglobal-0.3.2 → compuglobal-0.3.4}/.gitignore +0 -0
- {compuglobal-0.3.2 → compuglobal-0.3.4}/.readthedocs.yaml +0 -0
- {compuglobal-0.3.2 → compuglobal-0.3.4}/LICENSE +0 -0
- {compuglobal-0.3.2 → compuglobal-0.3.4}/MANIFEST.in +0 -0
- {compuglobal-0.3.2 → compuglobal-0.3.4}/README.rst +0 -0
- {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/aio.py +0 -0
- {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/api/client.py +0 -0
- {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/api/config.py +0 -0
- {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/api/discovery.py +0 -0
- {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/api/endpoint.py +0 -0
- {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/api/media.py +0 -0
- {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/api/metadata.py +0 -0
- {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/errors.py +0 -0
- {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/models/font.py +0 -0
- {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/models/frame.py +0 -0
- {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/models/screencap.py +0 -0
- {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/models/stream.py +0 -0
- {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/models/subtitle.py +0 -0
- {compuglobal-0.3.2 → compuglobal-0.3.4}/docs/Makefile +0 -0
- {compuglobal-0.3.2 → compuglobal-0.3.4}/docs/aio.rst +0 -0
- {compuglobal-0.3.2 → compuglobal-0.3.4}/docs/all.rst +0 -0
- {compuglobal-0.3.2 → compuglobal-0.3.4}/docs/index.rst +0 -0
- {compuglobal-0.3.2 → compuglobal-0.3.4}/docs/make.bat +0 -0
- {compuglobal-0.3.2 → compuglobal-0.3.4}/docs/models.rst +0 -0
- {compuglobal-0.3.2 → compuglobal-0.3.4}/examples/all_shows.py +0 -0
- {compuglobal-0.3.2 → compuglobal-0.3.4}/examples/episode_info.py +0 -0
- {compuglobal-0.3.2 → compuglobal-0.3.4}/pyproject.toml +0 -0
- {compuglobal-0.3.2 → compuglobal-0.3.4}/requirements.txt +0 -0
- {compuglobal-0.3.2 → compuglobal-0.3.4}/tests/frinkiac.json +0 -0
- {compuglobal-0.3.2 → compuglobal-0.3.4}/tests/test_compuglobal.py +0 -0
- {compuglobal-0.3.2 → compuglobal-0.3.4}/tests/test_screencap.py +0 -0
|
@@ -16,5 +16,10 @@
|
|
|
16
16
|
],
|
|
17
17
|
"files.trimTrailingWhitespace": true,
|
|
18
18
|
"files.trimFinalNewlines": true,
|
|
19
|
-
"files.insertFinalNewline": true
|
|
19
|
+
"files.insertFinalNewline": true,
|
|
20
|
+
"workbench.colorCustomizations": {
|
|
21
|
+
"titleBar.activeBackground": "#003366",
|
|
22
|
+
"titleBar.activeForeground": "#ffffff",
|
|
23
|
+
"statusBar.background": "#003366"
|
|
24
|
+
}
|
|
20
25
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: compuglobal
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.4
|
|
4
4
|
Summary: Python wrapper for the CGHMC API (Frinkiac, Morbotron Master Of All Science and more!
|
|
5
5
|
Keywords: The Simpsons,Futurama,Rick and Morty,West Wing,Frinkiac,Morbotron,Master of all Science,Capital Beat,API,API Wrapper,CompuGlobal,CompuGlobalHyperMegaNet,CGHMC
|
|
6
6
|
Author: MitchellAW
|
|
@@ -53,14 +53,16 @@ class ComicOverlay(BaseModel, frozen=True):
|
|
|
53
53
|
d: int = Field(alias="d", description="Duration (unused)", default=0)
|
|
54
54
|
|
|
55
55
|
@classmethod
|
|
56
|
-
def from_subtitles(
|
|
56
|
+
def from_subtitles(
|
|
57
|
+
cls, *, subtitles: List[Subtitle], font_family: FontFamily = FontFamily.IMPACT
|
|
58
|
+
) -> "ComicOverlay":
|
|
57
59
|
"""Builds a comic overlay using a list of Subtitles.
|
|
58
60
|
|
|
59
61
|
Parameters
|
|
60
62
|
----------
|
|
61
63
|
subtitles : List[Subtitle]
|
|
62
64
|
A list of subtitles
|
|
63
|
-
font_family : FontFamily
|
|
65
|
+
font_family : FontFamily, optional
|
|
64
66
|
The family of font to use for the new overlay.
|
|
65
67
|
|
|
66
68
|
Returns
|
|
@@ -110,7 +112,7 @@ class ComicPanel(BaseModel, frozen=True):
|
|
|
110
112
|
return cls(e=screencap.frame.key, ts=screencap.frame.timestamp, o=overlays)
|
|
111
113
|
|
|
112
114
|
def get_encoded(self) -> str:
|
|
113
|
-
"""
|
|
115
|
+
"""Gets the base 64 encoded representation of this panel
|
|
114
116
|
|
|
115
117
|
Returns
|
|
116
118
|
-------
|
|
@@ -125,7 +127,7 @@ class ComicPanel(BaseModel, frozen=True):
|
|
|
125
127
|
|
|
126
128
|
|
|
127
129
|
class ComicStrip(BaseModel):
|
|
128
|
-
"""
|
|
130
|
+
"""A comic strip composed of multiple comic panels in a given layout.
|
|
129
131
|
|
|
130
132
|
Attributes
|
|
131
133
|
----------
|
|
@@ -159,9 +161,10 @@ class ComicStrip(BaseModel):
|
|
|
159
161
|
panels = [
|
|
160
162
|
ComicPanel(
|
|
161
163
|
e=screencap.frame.key,
|
|
162
|
-
ts=
|
|
163
|
-
o=cls.build_comic_overlays(
|
|
164
|
+
ts=subtitle.representative_timestamp,
|
|
165
|
+
o=cls.build_comic_overlays([subtitle], font_family=font_family),
|
|
164
166
|
)
|
|
167
|
+
for subtitle in screencap.subtitles
|
|
165
168
|
]
|
|
166
169
|
|
|
167
170
|
return cls(panels=panels)
|
|
@@ -60,12 +60,12 @@ class EpisodeSummary(BaseModel, frozen=True):
|
|
|
60
60
|
A list of 20 frame IDs distributed throughout the episode.
|
|
61
61
|
"""
|
|
62
62
|
|
|
63
|
-
key: str
|
|
64
|
-
season: int
|
|
65
|
-
episode_number: int
|
|
66
|
-
title: str
|
|
67
|
-
original_air_date: str
|
|
68
|
-
frames: List[int]
|
|
63
|
+
key: str = Field(alias="Key")
|
|
64
|
+
season: int = Field(alias="Season")
|
|
65
|
+
episode_number: int = Field(alias="EpisodeNumber")
|
|
66
|
+
title: str = Field(alias="Title")
|
|
67
|
+
original_air_date: str = Field(alias="OriginalAirDate")
|
|
68
|
+
frames: List[int] = Field(alias="Frames")
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
class Episode(BaseModel, frozen=True):
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from compuglobal import __version__
|
|
2
|
+
|
|
1
3
|
# Configuration file for the Sphinx documentation builder.
|
|
2
4
|
#
|
|
3
5
|
# For the full list of built-in configuration values, see the documentation:
|
|
@@ -9,7 +11,7 @@
|
|
|
9
11
|
project = "compuglobal"
|
|
10
12
|
copyright = "2018, MitchellAW"
|
|
11
13
|
author = "MitchellAW"
|
|
12
|
-
release =
|
|
14
|
+
release = __version__
|
|
13
15
|
|
|
14
16
|
# -- General configuration ---------------------------------------------------
|
|
15
17
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
|
@@ -13,29 +13,35 @@ async def main():
|
|
|
13
13
|
frinkiac = compuglobal.Frinkiac()
|
|
14
14
|
|
|
15
15
|
# Getting a screencap from The Simpsons using search terms
|
|
16
|
-
searched_screencap = await frinkiac.search_for_screencap("
|
|
17
|
-
print(searched_screencap)
|
|
16
|
+
searched_screencap = await frinkiac.search_for_screencap("garbage water")
|
|
17
|
+
print(f"Screencap:\n{searched_screencap}\n")
|
|
18
18
|
|
|
19
19
|
# Getting a random screencap from The Simpsons
|
|
20
20
|
random_screencap = await frinkiac.get_random_screencap()
|
|
21
21
|
|
|
22
22
|
# Gets the image of the screencap without any captions
|
|
23
23
|
image = await frinkiac.get_image_url(random_screencap)
|
|
24
|
-
print(image)
|
|
24
|
+
print(f"Image url:\n{image}\n")
|
|
25
25
|
|
|
26
26
|
# Gets the image of the screencap with captions matching the quotes of the
|
|
27
27
|
# screencap embedded in the image
|
|
28
|
-
comic_panel = await frinkiac.get_comic_panel_url(
|
|
29
|
-
print(comic_panel)
|
|
28
|
+
comic_panel = await frinkiac.get_comic_panel_url(searched_screencap)
|
|
29
|
+
print(f"Custom comic panel:\n{comic_panel}\n")
|
|
30
30
|
|
|
31
31
|
# Gets a comic strip with mulitple screencaps and captions matching the quotes
|
|
32
32
|
# of each screencap in the image
|
|
33
|
-
comic_strip = await frinkiac.get_comic_strip_url(
|
|
34
|
-
print(comic_strip)
|
|
33
|
+
comic_strip = await frinkiac.get_comic_strip_url(searched_screencap)
|
|
34
|
+
print(f"Custom comic strip:\n{comic_strip}\n")
|
|
35
35
|
|
|
36
36
|
# Gets the gif of the screencap with captions embedded
|
|
37
37
|
gif = await frinkiac.get_gif_url(searched_screencap)
|
|
38
|
-
print(gif)
|
|
38
|
+
print(f"Custom gif:\n{gif}\n")
|
|
39
|
+
|
|
40
|
+
navigator = await frinkiac.navigator()
|
|
41
|
+
print(f"Navigator returned {len(navigator)} episodes.\n")
|
|
42
|
+
|
|
43
|
+
discover = await frinkiac.discover()
|
|
44
|
+
print(f"Discover returned {len(discover)} results.\n")
|
|
39
45
|
|
|
40
46
|
# Close API Client
|
|
41
47
|
await frinkiac.close()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|