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.
Files changed (38) hide show
  1. {compuglobal-0.3.2 → compuglobal-0.3.4}/.vscode/settings.json +6 -1
  2. {compuglobal-0.3.2 → compuglobal-0.3.4}/PKG-INFO +1 -1
  3. {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/__init__.py +1 -1
  4. {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/models/comic.py +9 -6
  5. {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/models/episode.py +6 -6
  6. {compuglobal-0.3.2 → compuglobal-0.3.4}/docs/conf.py +3 -1
  7. {compuglobal-0.3.2 → compuglobal-0.3.4}/examples/basic_example.py +14 -8
  8. {compuglobal-0.3.2 → compuglobal-0.3.4}/.gitignore +0 -0
  9. {compuglobal-0.3.2 → compuglobal-0.3.4}/.readthedocs.yaml +0 -0
  10. {compuglobal-0.3.2 → compuglobal-0.3.4}/LICENSE +0 -0
  11. {compuglobal-0.3.2 → compuglobal-0.3.4}/MANIFEST.in +0 -0
  12. {compuglobal-0.3.2 → compuglobal-0.3.4}/README.rst +0 -0
  13. {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/aio.py +0 -0
  14. {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/api/client.py +0 -0
  15. {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/api/config.py +0 -0
  16. {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/api/discovery.py +0 -0
  17. {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/api/endpoint.py +0 -0
  18. {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/api/media.py +0 -0
  19. {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/api/metadata.py +0 -0
  20. {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/errors.py +0 -0
  21. {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/models/font.py +0 -0
  22. {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/models/frame.py +0 -0
  23. {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/models/screencap.py +0 -0
  24. {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/models/stream.py +0 -0
  25. {compuglobal-0.3.2 → compuglobal-0.3.4}/compuglobal/models/subtitle.py +0 -0
  26. {compuglobal-0.3.2 → compuglobal-0.3.4}/docs/Makefile +0 -0
  27. {compuglobal-0.3.2 → compuglobal-0.3.4}/docs/aio.rst +0 -0
  28. {compuglobal-0.3.2 → compuglobal-0.3.4}/docs/all.rst +0 -0
  29. {compuglobal-0.3.2 → compuglobal-0.3.4}/docs/index.rst +0 -0
  30. {compuglobal-0.3.2 → compuglobal-0.3.4}/docs/make.bat +0 -0
  31. {compuglobal-0.3.2 → compuglobal-0.3.4}/docs/models.rst +0 -0
  32. {compuglobal-0.3.2 → compuglobal-0.3.4}/examples/all_shows.py +0 -0
  33. {compuglobal-0.3.2 → compuglobal-0.3.4}/examples/episode_info.py +0 -0
  34. {compuglobal-0.3.2 → compuglobal-0.3.4}/pyproject.toml +0 -0
  35. {compuglobal-0.3.2 → compuglobal-0.3.4}/requirements.txt +0 -0
  36. {compuglobal-0.3.2 → compuglobal-0.3.4}/tests/frinkiac.json +0 -0
  37. {compuglobal-0.3.2 → compuglobal-0.3.4}/tests/test_compuglobal.py +0 -0
  38. {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.2
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
@@ -19,7 +19,7 @@ from .models.stream import StreamOverlay, Stream
19
19
  __title__ = "compuglobal"
20
20
  __author__ = "MitchellAW"
21
21
  __license__ = "MIT"
22
- __version__ = "0.3.2"
22
+ __version__ = "0.3.4"
23
23
 
24
24
  __all__ = [
25
25
  "APIPageStatusError",
@@ -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(cls, *, subtitles: List[Subtitle], font_family: FontFamily) -> "ComicOverlay":
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
- """get_encoded Gets the base 64 encoded representation of this panel
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
- """ComicStrip _summary_
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=screencap.frame.timestamp,
163
- o=cls.build_comic_overlays(screencap.subtitles, font_family=font_family),
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 = "0.3.2"
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("Stupid Sexy Flanders")
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(random_screencap)
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(random_screencap)
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