Skip to content

Commit adccb9e

Browse files
author
mithmith
committed
sphinx docs generator
1 parent aec0c18 commit adccb9e

File tree

11 files changed

+249
-8
lines changed

11 files changed

+249
-8
lines changed

Diff for: app/db/repository.py

+2-8
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,7 @@ def add_channel(self, channel_data: ChannelInfoSchema) -> Channel:
6262
self.commit()
6363
return channel
6464

65-
def add_video(
66-
self,
67-
video_schema: VideoSchema,
68-
channel_id: str
69-
) -> Video:
65+
def add_video(self, video_schema: VideoSchema, channel_id: str) -> Video:
7066
"""
7167
Adds a new video or updates an existing one based on the provided video schema.
7268
@@ -511,9 +507,7 @@ def update_channel_details(self, channel_info: ChannelAPIInfoSchema) -> None:
511507
channel: Channel = self._session.query(Channel).filter_by(channel_id=channel_info.id).first()
512508

513509
# Convert ChannelAPIInfoSchema to dictionary, excluding unset values
514-
channel_dict = channel_info.model_dump(
515-
exclude_unset=True
516-
)
510+
channel_dict = channel_info.model_dump(exclude_unset=True)
517511

518512
if channel:
519513
# If the channel exists, update its attributes

Diff for: app/integrations/__init__.py

Whitespace-only changes.

Diff for: app/service/__init__.py

Whitespace-only changes.

Diff for: sphinx/Makefile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

Diff for: sphinx/app.db.rst

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
app.db package
2+
==============
3+
4+
Submodules
5+
----------
6+
7+
app.db.base module
8+
------------------
9+
10+
.. automodule:: app.db.base
11+
:members:
12+
:undoc-members:
13+
:show-inheritance:
14+
15+
app.db.repository module
16+
------------------------
17+
18+
.. automodule:: app.db.repository
19+
:members:
20+
:undoc-members:
21+
:show-inheritance:
22+
23+
Module contents
24+
---------------
25+
26+
.. automodule:: app.db
27+
:members:
28+
:undoc-members:
29+
:show-inheritance:

Diff for: sphinx/app.integrations.rst

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
app.integrations package
2+
========================
3+
4+
Submodules
5+
----------
6+
7+
app.integrations.ytapi module
8+
-----------------------------
9+
10+
.. automodule:: app.integrations.ytapi
11+
:members:
12+
:undoc-members:
13+
:show-inheritance:
14+
15+
app.integrations.ytdlp module
16+
-----------------------------
17+
18+
.. automodule:: app.integrations.ytdlp
19+
:members:
20+
:undoc-members:
21+
:show-inheritance:
22+
23+
Module contents
24+
---------------
25+
26+
.. automodule:: app.integrations
27+
:members:
28+
:undoc-members:
29+
:show-inheritance:

Diff for: sphinx/app.rst

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
app package
2+
===========
3+
4+
Subpackages
5+
-----------
6+
7+
.. toctree::
8+
:maxdepth: 1
9+
10+
app.db
11+
app.integrations
12+
app.service
13+
14+
Submodules
15+
----------
16+
17+
app.config module
18+
-----------------
19+
20+
.. automodule:: app.config
21+
:members:
22+
:undoc-members:
23+
:show-inheritance:
24+
25+
app.const module
26+
----------------
27+
28+
.. automodule:: app.const
29+
:members:
30+
:undoc-members:
31+
:show-inheritance:
32+
33+
app.schema module
34+
-----------------
35+
36+
.. automodule:: app.schema
37+
:members:
38+
:undoc-members:
39+
:show-inheritance:
40+
41+
Module contents
42+
---------------
43+
44+
.. automodule:: app
45+
:members:
46+
:undoc-members:
47+
:show-inheritance:

Diff for: sphinx/app.service.rst

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
app.service package
2+
===================
3+
4+
Submodules
5+
----------
6+
7+
app.service.yt\_monitor module
8+
------------------------------
9+
10+
.. automodule:: app.service.yt_monitor
11+
:members:
12+
:undoc-members:
13+
:show-inheritance:
14+
15+
Module contents
16+
---------------
17+
18+
.. automodule:: app.service
19+
:members:
20+
:undoc-members:
21+
:show-inheritance:

Diff for: sphinx/conf.py

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import os
2+
import sys
3+
sys.path.insert(0, os.path.abspath('../'))
4+
5+
import app.db.data_table
6+
import app.db.repository
7+
import app.integrations.ytapi
8+
import app.integrations.ytdlp
9+
import app.service.yt_monitor
10+
11+
12+
# Configuration file for the Sphinx documentation builder.
13+
#
14+
# For the full list of built-in configuration values, see the documentation:
15+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
16+
17+
# -- Project information -----------------------------------------------------
18+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
19+
20+
project = 'Youtube node downloader'
21+
copyright = '2024, mithmith'
22+
author = 'mithmith'
23+
release = '0.0.1'
24+
25+
# -- General configuration ---------------------------------------------------
26+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
27+
28+
extensions = []
29+
30+
templates_path = ['_templates']
31+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
32+
33+
34+
35+
# -- Options for HTML output -------------------------------------------------
36+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
37+
38+
html_theme = 'sphinx_rtd_theme'
39+
html_static_path = ['_static']
40+
extensions = [
41+
'sphinx.ext.autodoc', # Includes documentation from docstrings
42+
'sphinx.ext.coverage', # Checks documentation coverage
43+
'sphinx.ext.napoleon', # Support for Google and NumPy style docstrings
44+
'sphinx.ext.viewcode', # Adds links to the source code of documented Python objects
45+
]

Diff for: sphinx/index.rst

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.. Youtube node downloader documentation master file, created by
2+
sphinx-quickstart on Mon Apr 15 16:32:40 2024.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Welcome to Youtube node downloader's documentation!
7+
===================================================
8+
9+
.. toctree::
10+
:maxdepth: 1
11+
:caption: Contents:
12+
13+
app
14+
15+
16+
Indices and tables
17+
==================
18+
19+
* :ref:`genindex`
20+
* :ref:`modindex`
21+
* :ref:`search`

Diff for: sphinx/make.bat

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=.
11+
set BUILDDIR=_build
12+
13+
%SPHINXBUILD% >NUL 2>NUL
14+
if errorlevel 9009 (
15+
echo.
16+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17+
echo.installed, then set the SPHINXBUILD environment variable to point
18+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
19+
echo.may add the Sphinx directory to PATH.
20+
echo.
21+
echo.If you don't have Sphinx installed, grab it from
22+
echo.https://www.sphinx-doc.org/
23+
exit /b 1
24+
)
25+
26+
if "%1" == "" goto help
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

0 commit comments

Comments
 (0)