diff --git a/README.rst b/README.rst index 223a47b..cd47d5c 100644 --- a/README.rst +++ b/README.rst @@ -10,7 +10,7 @@ CompuGlobal .. image:: https://img.shields.io/pypi/pyversions/compuglobal.svg :target: https://pypi.python.org/pypi/compuglobal -.. image:: https://img.shields.io/readthedocs/compuglobal +.. image:: https://app.readthedocs.org/projects/compuglobal/badge/?version=latest&style=flat :target: https://compuglobal.readthedocs.io/en/latest/ .. image:: https://img.shields.io/github/actions/workflow/status/MitchellAW/CompuGlobal/test.yml?label=tests @@ -70,29 +70,6 @@ Basic Usage For documented examples, check `here.`_ -What's New ------------- -**0.3.0 - Breaking changes** - -These changes are to accommodate the extensive update to the APIs with new features: - -- All synchronous implementations of the package have been removed -- The async endpoints persist and are now accessible via **compuglobal** or **compuglobal.aio** as done previously -- The `Master Of All Science`_ API appears to be unavailable at this point in time and redirects to Frinkiac, I have added a **deprecation warning** to this API and it will remain unless the API returns -- The package now requires **Python 3.13+** -- Image, comic, and gif generation are all now performed using the API rather than from a Screencap - -.. code-block:: py - - # This is now async - simpsons = compuglobal.Frinkiac() - - # Previous usage - await screencap.get_gif_url() - - # New usage - await simpsons.get_gif_url(screencap) - Preview ------------ .. image:: https://raw.githubusercontent.com/MitchellAW/MitchellAW.github.io/refs/heads/master/images/nothing-at-all.gif diff --git a/docs/changelog.rst b/docs/changelog.rst new file mode 100644 index 0000000..89fe585 --- /dev/null +++ b/docs/changelog.rst @@ -0,0 +1,158 @@ +.. currentmodule:: compuglobal + +Changelog +========= + +0.3.8 +----- + +Added +~~~~~ +- Timestamp helper class for handling timestamps + +0.3.7 +------- + +Added +~~~~~ +- Optional season filters, season_minimum, and season_maximum for the following methods: + + - :meth:`AsyncCompuGlobalAPI.search` + - :meth:`AsyncCompuGlobalAPI.search_for_screencap` + - :meth:`AsyncCompuGlobalAPI.get_random_screencap` + +Miscellaneous +~~~~~~~~~~~~~ +- Add support for optional query parameters with validation + +0.3.6 +------- + +Breaking Changes +~~~~~~~~~~~~~~~~ +- All instances of :class:`AsyncCompuGlobalAPI` now always require :class:`aiohttp.ClientSession` +- Search methods :meth:`AsyncCompuGlobalAPI.search` and :meth:`AsyncCompuGlobalAPI.search_for_screencap` now return lists containing :class:`FrameResult` instead of :class:`Frame` +- Rename :class:`NoSearchResultsFound` to :class:`NoSearchResultsFoundError` + +Added +~~~~~ +- :class:`FrameResult` model for search results +- :class:`~compuglobal.models.base.BaseCompuGlobalModel` as parent for all models with desired serialization/validation behaviour + +Fixed +~~~~~ +- Custom subtitles not being applied for comic panels +- Font color length validation +- Subtitle duration calculation +- Extra slash (/) in gif url + +Miscellaneous +~~~~~~~~~~~~~ +- Add unit tests for all models and API calls +- Add integration tests with real APIs +- Apply ruff rules to entire project + +0.3.5 +------- + +Added +~~~~~ +- :meth:`Subtitle.get_duration` for getting Subtitle duration + +Fixed +~~~~~ +- Incorrect path param using in :meth:`AsyncCompuGlobalAPI.get_frames` +- Custom subtitles not being used in comics/gifs + +0.3.4 +------- + +Fixed +~~~~~ +- Incorrect frames used in :class:`ComicStrip` +- Missing field alias in :class:`EpisodeSummary` + +0.3.3 +------- + +Fixed +~~~~~ +- Missing panels in :class:`ComicStrip` + +0.3.2 +------- + +Added +~~~~~ +- Methods for missing API endpoints: + + - :meth:`AsyncCompuGlobalAPI.browse_episode` + - :meth:`AsyncCompuGlobalAPI.get_transcript` + - :meth:`AsyncCompuGlobalAPI.navigator` + +- Methods for getting caption as a string: + + - :meth:`StreamOverlay.get_caption` + - :meth:`Screencap.get_caption` + +- Methods for building models from a :class:`Screencap` directly: + + - :meth:`ComicPanel.from_screencap`, :meth:`ComicStrip.from_screencap`, and :meth:`Stream.from_screencap` for + +Fixed +~~~~~ +- Missing panels in :class:`ComicStrip` + + +0.3.1 +------- + +Breaking Changes +~~~~~~~~~~~~~~~~ +- Made all models immutable + +Added +~~~~~ +- All models to compuglobal import scope + +0.3.0 +------- + +Breaking Changes +~~~~~~~~~~~~~~~~ +These changes are to accommodate the extensive update to the APIs with new features: + +- All synchronous implementations of the package have been removed +- The async endpoints persist and are now accessible via :mod:`compuglobal` or :mod:`compuglobal.aio` as done previously +- The Master Of All Science API appears to be unavailable at this point in time and redirects to Frinkiac, I have added a deprecation warning to this API and it will remain unless the API returns +- The package now requires Python 3.13+ +- Image, comic, and gif generation are all now performed using the API rather than from a Screencap: + + - :meth:`AsyncCompuGlobalAPI.get_image_url` + - :meth:`AsyncCompuGlobalAPI.get_gif_url` + +.. code-block:: py + + # This is now async + simpsons = compuglobal.Frinkiac() + + # Previous usage + await screencap.get_gif_url() + + # New usage + await simpsons.get_gif_url(screencap) + +Added +~~~~~ +- Endpoints for comic panels/strips: + + - :meth:`AsyncCompuGlobalAPI.get_comic_panel_url` + - :meth:`AsyncCompuGlobalAPI.get_comic_strip_url` +- Models for comics: + - :ref:`See Comic models here ` +- Default font for APIs to use in text Overlays + +Miscellaneous +~~~~~~~~~~~~~ +- Moved fonts to its own module +- Added default values to :class:`Stream` diff --git a/docs/conf.py b/docs/conf.py index 17435e6..7aee92d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,6 +18,7 @@ extensions = [ "sphinx.ext.autodoc", + "sphinx.ext.intersphinx", "sphinx.ext.napoleon", "sphinxcontrib_trio", "sphinx_rtd_theme", @@ -29,6 +30,11 @@ add_module_names = True autoclass_content = "class" +intersphinx_mapping = { + "python": ("https://docs.python.org/3", None), + "aiohttp": ("https://docs.aiohttp.org/en/stable/", None), +} + napoleon_use_google_docstring = False napoleon_use_param = False napoleon_use_ivar = True diff --git a/docs/errors.rst b/docs/errors.rst new file mode 100644 index 0000000..f610767 --- /dev/null +++ b/docs/errors.rst @@ -0,0 +1,15 @@ +.. currentmodule:: compuglobal + +Errors +=================== + +APIPageStatusError +~~~~~~~~~~~~~~~~~~~~ +.. autoclass:: APIPageStatusError + :members: + + +NoSearchResultsFoundError +~~~~~~~~~~~~~~~~~~~~ +.. autoclass:: NoSearchResultsFoundError + :members: diff --git a/docs/index.rst b/docs/index.rst index e3d942d..db74720 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -8,6 +8,8 @@ :maxdepth: 3 aio + changelog + errors models all diff --git a/docs/models.rst b/docs/models.rst index 2e946c2..de881a4 100644 --- a/docs/models.rst +++ b/docs/models.rst @@ -50,6 +50,8 @@ Overlays :members: :exclude-members: model_config +.. _comics: + Comics ~~~~~~~~~~~~~~~~~~~~ .. autoclass:: ComicPanel @@ -88,3 +90,10 @@ Fonts .. autoclass:: FontFamily :members: + + +**Base Model:** + +.. autoclass:: compuglobal.models.base.BaseCompuGlobalModel + :members: + :no-index: