diff --git a/.readthedocs.yaml b/.readthedocs.yaml deleted file mode 100644 index 58adb915..00000000 --- a/.readthedocs.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# .readthedocs.yaml -# Read the Docs configuration file -# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details - -# Required -version: 2 - -# Set the version of Python and other tools you might need -build: - os: ubuntu-22.04 - tools: - python: "3.11" - -# Build documentation in the docs/ directory with Sphinx -sphinx: - configuration: docs/conf.py - -formats: - - pdf - -# We recommend specifying your dependencies to enable reproducible builds: -# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html -python: - install: - - requirements: requirements.txt - - requirements: docs/requirements.txt diff --git a/README.rst b/README.rst index 4d074f7c..a2767e39 100644 --- a/README.rst +++ b/README.rst @@ -1,4 +1,4 @@ -blinkpy |Build Status| |Coverage Status| |Docs| |PyPi Version| |Codestyle| +blinkpy |Build Status| |Coverage Status| |PyPi Version| |Codestyle| ============================================================================================= A Python library for the Blink Camera system (Python 3.8+) @@ -39,7 +39,6 @@ To install the current development version, perform the following steps. Note t If you'd like to contribute to this library, please read the `contributing instructions `__. -For more information on how to use this library, please `read the docs `__. Purpose ------- @@ -249,7 +248,5 @@ API steps :target: https://codecov.io/gh/fronzbot/blinkpy .. |PyPi Version| image:: https://img.shields.io/pypi/v/blinkpy.svg :target: https://pypi.python.org/pypi/blinkpy -.. |Docs| image:: https://readthedocs.org/projects/blinkpy/badge/?version=latest - :target: http://blinkpy.readthedocs.io/en/latest/?badge=latest .. |Codestyle| image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/psf/black diff --git a/docs/CHANGES.rst b/docs/CHANGES.rst deleted file mode 120000 index 9d60ba96..00000000 --- a/docs/CHANGES.rst +++ /dev/null @@ -1 +0,0 @@ -../CHANGES.rst \ No newline at end of file diff --git a/docs/CONTRIBUTING.rst b/docs/CONTRIBUTING.rst deleted file mode 120000 index 798f2aa2..00000000 --- a/docs/CONTRIBUTING.rst +++ /dev/null @@ -1 +0,0 @@ -../CONTRIBUTING.rst \ No newline at end of file diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index 774c3867..00000000 --- a/docs/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -SPHINXPROJ = blinkpy -SOURCEDIR = . -BUILDDIR = _build - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff --git a/docs/README.rst b/docs/README.rst deleted file mode 120000 index 89a01069..00000000 --- a/docs/README.rst +++ /dev/null @@ -1 +0,0 @@ -../README.rst \ No newline at end of file diff --git a/docs/advanced.rst b/docs/advanced.rst deleted file mode 100644 index 95bf6037..00000000 --- a/docs/advanced.rst +++ /dev/null @@ -1,104 +0,0 @@ -======================= -Advanced Library Usage -======================= - -Usage of this library was designed with the `Home Assistant `__ project in mind. With that said, this library is flexible to be used in other scripts where advanced usage not covered in the Quick Start guide may be required. This usage guide will attempt to cover as many use cases as possible. - -Throttling --------------- -In general, attempting too many requests to the Blink servers will result in your account being throttled. Where possible, adding a delay between calls is ideal. For use cases where this is not an acceptable solution, the ``blinkpy.helpers.util`` module contains a ``Throttle`` class that can be used as a decorator for calls. There are many examples of usage within the ``blinkpy.api`` module. A simple example of usage is covered below, where the decorated method is prevented from executing again until 10s has passed. Note that if the method call is throttled by the decorator, the method will return `None`. - -.. code:: python - - from blinkpy.helpers.util import Throttle - - @Throttle(seconds=10) - def my_method(*args): - """Some method to be throttled.""" - return True - -Custom Sessions ------------------ -By default, the ``blink.auth.Auth`` class creates its own websession via its ``create_session`` method. This is done when the class is initialized and is accessible via the ``Auth.session`` property. To override with a custom websession, the following code can accomplish that: - -.. code:: python - - from blinkpy.blinkpy import Blink - from blinkpy.auth import Auth - - blink = Blink() - blink.auth = Auth() - blink.auth.session = YourCustomSession - - -Custom Retry Logic --------------------- -The built-in auth session via the ``create_session`` method allows for customizable retry intervals and conditions. These parameters are: - -- retries -- backoff -- retry_list - -``retries`` is the total number of retry attempts that each http request can do before timing out. ``backoff`` is a parameter that allows for non-linear retry times such that the time between retries is backoff*(2^(retries) - 1). ``retry_list`` is simply a list of status codes to force a retry. By default ``retries=3``, ``backoff=1``, and ``retry_list=[429, 500, 502, 503, 504]``. To override them, you need to add you overrides to a dictionary and use that to create a new session with the ``opts`` variable in the ``create_session`` method. The following example can serve as a guide where only the number of retries and backoff factor are overridden: - -.. code:: python - - from blinkpy.blinkpy import Blink - from blinkpy.auth import Auth - - blink = Blink() - blink.auth = Auth() - - opts = {"retries": 10, "backoff": 2} - blink.auth.session = blink.auth.create_session(opts=opts) - - -Custom HTTP requests ---------------------- -In addition to custom sessions, custom blink server requests can be performed. This give you the ability to bypass the built-in ``Auth.query`` method. It also allows flexibility by giving you the option to pass your own url, rather than be limited to what is currently implemented in the ``blinkpy.api`` module. - -**Send custom url** -This prepares a standard "GET" request. - -.. code:: python - - from blinkpy.blinkpy import Blink - from blinkpy.auth import Auth - - blink = Blink() - blink.auth = Auth() - url = some_api_endpoint_string - request = blink.auth.prepare_request(url, blink.auth.header, None, "get") - response = blink.auth.session.send(request) - -**Overload query method** -Another option is to create your own ``Auth`` class with a custom ``query`` method to avoid the built-in response checking. This allows you to use the built in ``blinkpy.api`` endpoints, but also gives you flexibility to send your own urls. - -.. code:: python - - from blinkpy.blinkpy import Blink - from blinkpy.auth import Auth - from blinkpy import api - - class CustomAuth(Auth): - def query( - self, - url=None, - data=None, - headers=self.header, - reqtype="get", - stream=False, - json_resp=True, - **kwargs - ): - req = self.prepare_request(url, headers, data, reqtype) - return self.session.send(req, stream=stream) - - blink = blink.Blink() - blink.auth = CustomAuth() - - # Send custom GET query - response = blink.auth.query(url=some_custom_url) - - # Call built-in networks api endpoint - response = api.request_networks(blink) diff --git a/docs/conf.py b/docs/conf.py deleted file mode 100644 index 52f17007..00000000 --- a/docs/conf.py +++ /dev/null @@ -1,176 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# -# blinkpy documentation build configuration file, created by -# sphinx-quickstart on Sat Jan 20 22:20:16 2018. -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -# -import os -import sys -sys.path.insert(0, os.path.abspath('..')) - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -# -# needs_sphinx = '1.0' - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -import sphinx_rtd_theme -from blinkpy.helpers.constants import __version__ -html_theme = "sphinx_rtd_theme" -html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] - -extensions = ['sphinx.ext.autodoc', - 'sphinx.ext.doctest', - 'sphinx.ext.mathjax', - 'sphinx.ext.viewcode'] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# -# source_suffix = ['.rst', '.md'] -source_suffix = '.rst' - -# The master toctree document. -master_doc = 'index' - -# General information about the project. -project = 'blinkpy' -copyright = '2018, Kevin Fronczak' -author = 'Kevin Fronczak' - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The short X.Y version. -version = __version__ -# The full version, including alpha/beta/rc tags. -release = __version__ - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This patterns also effect to html_static_path and html_extra_path -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = False - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# -#html_theme = 'alabaster' - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -# -# html_theme_options = {} - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] - -# Custom sidebar templates, must be a dictionary that maps document names -# to template names. -# -# This is required for the alabaster theme -# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars -html_sidebars = { - '**': [ - 'relations.html', # needs 'show_related': True theme option to display - 'searchbox.html', - ] -} - - -# -- Options for HTMLHelp output ------------------------------------------ - -# Output file base name for HTML help builder. -htmlhelp_basename = 'blinkpydoc' - - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - # - # 'papersize': 'letterpaper', - - # The font size ('10pt', '11pt' or '12pt'). - # - # 'pointsize': '10pt', - - # Additional stuff for the LaTeX preamble. - # - # 'preamble': '', - - # Latex figure (float) alignment - # - # 'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - (master_doc, 'blinkpy.tex', 'blinkpy Documentation', - 'Kevin Fronczak', 'manual'), -] - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - (master_doc, 'blinkpy', 'blinkpy Documentation', - [author], 1) -] - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - (master_doc, 'blinkpy', 'blinkpy Documentation', - author, 'blinkpy', 'One line description of project.', - 'Miscellaneous'), -] - - - diff --git a/docs/index.rst b/docs/index.rst deleted file mode 100644 index 50951612..00000000 --- a/docs/index.rst +++ /dev/null @@ -1,26 +0,0 @@ -.. blinkpy documentation master file, created by - sphinx-quickstart on Sat Jan 20 22:20:16 2018. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to blinkpy's documentation! -=================================== - -.. toctree:: - :maxdepth: 1 - :caption: Contents: - :glob: - - README - advanced - CONTRIBUTING - modules/* - CHANGES - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index 0a78c493..00000000 --- a/docs/make.bat +++ /dev/null @@ -1,36 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=. -set BUILDDIR=_build -set SPHINXPROJ=blinkpy - -if "%1" == "" goto help - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% - -:end -popd diff --git a/docs/modules/blinkpy.rst b/docs/modules/blinkpy.rst deleted file mode 100644 index 1dc8d18b..00000000 --- a/docs/modules/blinkpy.rst +++ /dev/null @@ -1,41 +0,0 @@ -.. _core_module: - -=========================== -Blinkpy Library Reference -=========================== - -blinkpy.py ------------ -.. automodule:: blinkpy.blinkpy - :members: - -auth.py --------- - -.. automodule:: blinkpy.auth - :members: - -sync_module.py ----------------- - -.. automodule:: blinkpy.sync_module - :members: - -camera.py ------------ - -.. automodule:: blinkpy.camera - :members: - -api.py ---------- - -.. automodule:: blinkpy.api - :members: - -helpers/util.py ----------------- - -.. automodule:: blinkpy.helpers.util - :members: - diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index 09584428..00000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -sphinx==7.2.6 -sphinx_rtd_theme==1.3.0 -readthedocs-sphinx-search==0.3.1