yutipy 0.1.0__tar.gz → 0.1.1__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.

Potentially problematic release.


This version of yutipy might be problematic. Click here for more details.

Files changed (65) hide show
  1. yutipy-0.1.1/.github/FUNDING.yml +1 -0
  2. yutipy-0.1.1/.github/workflows/pytest-unit-testing.yml +43 -0
  3. yutipy-0.1.1/.readthedocs.yaml +26 -0
  4. {yutipy-0.1.0 → yutipy-0.1.1}/PKG-INFO +25 -4
  5. {yutipy-0.1.0 → yutipy-0.1.1}/README.md +83 -61
  6. {yutipy-0.1.0 → yutipy-0.1.1}/docs/api_reference.rst +8 -1
  7. {yutipy-0.1.0 → yutipy-0.1.1}/docs/conf.py +15 -17
  8. yutipy-0.1.1/docs/index.rst +27 -0
  9. {yutipy-0.1.0 → yutipy-0.1.1}/docs/installation.rst +1 -0
  10. yutipy-0.1.1/docs/requirements.txt +4 -0
  11. yutipy-0.1.1/docs/usage_examples.rst +83 -0
  12. {yutipy-0.1.0 → yutipy-0.1.1}/pyproject.toml +1 -2
  13. yutipy-0.1.1/requirements-dev.txt +1 -0
  14. {yutipy-0.1.0 → yutipy-0.1.1}/tests/__pycache__/test_musicyt.cpython-312-pytest-8.3.4.pyc +0 -0
  15. {yutipy-0.1.0 → yutipy-0.1.1}/tests/test_deezer.py +1 -1
  16. {yutipy-0.1.0 → yutipy-0.1.1}/tests/test_itunes.py +1 -1
  17. {yutipy-0.1.0 → yutipy-0.1.1}/tests/test_musicyt.py +2 -2
  18. {yutipy-0.1.0 → yutipy-0.1.1}/tests/test_spotify.py +3 -3
  19. {yutipy-0.1.0 → yutipy-0.1.1}/yutipy/__init__.py +2 -2
  20. {yutipy-0.1.0 → yutipy-0.1.1}/yutipy/__pycache__/__init__.cpython-312.pyc +0 -0
  21. {yutipy-0.1.0 → yutipy-0.1.1}/yutipy/__pycache__/deezer.cpython-312.pyc +0 -0
  22. {yutipy-0.1.0 → yutipy-0.1.1}/yutipy/__pycache__/itunes.cpython-312.pyc +0 -0
  23. {yutipy-0.1.0 → yutipy-0.1.1}/yutipy/__pycache__/musicyt.cpython-312.pyc +0 -0
  24. {yutipy-0.1.0 → yutipy-0.1.1}/yutipy/__pycache__/spotify.cpython-312.pyc +0 -0
  25. {yutipy-0.1.0 → yutipy-0.1.1}/yutipy/deezer.py +8 -9
  26. {yutipy-0.1.0 → yutipy-0.1.1}/yutipy/itunes.py +2 -2
  27. {yutipy-0.1.0 → yutipy-0.1.1}/yutipy/musicyt.py +1 -1
  28. {yutipy-0.1.0 → yutipy-0.1.1}/yutipy/spotify.py +12 -12
  29. {yutipy-0.1.0 → yutipy-0.1.1}/yutipy.egg-info/PKG-INFO +25 -4
  30. {yutipy-0.1.0 → yutipy-0.1.1}/yutipy.egg-info/SOURCES.txt +4 -2
  31. {yutipy-0.1.0 → yutipy-0.1.1}/yutipy.egg-info/requires.txt +1 -2
  32. yutipy-0.1.0/docs/_templates/contents.html +0 -2
  33. yutipy-0.1.0/docs/_templates/project_links.html +0 -8
  34. yutipy-0.1.0/docs/index.rst +0 -15
  35. yutipy-0.1.0/docs/usage_examples.rst +0 -74
  36. yutipy-0.1.0/requirements-dev.txt +0 -2
  37. {yutipy-0.1.0 → yutipy-0.1.1}/.gitattributes +0 -0
  38. {yutipy-0.1.0 → yutipy-0.1.1}/.gitignore +0 -0
  39. {yutipy-0.1.0 → yutipy-0.1.1}/LICENSE +0 -0
  40. {yutipy-0.1.0 → yutipy-0.1.1}/MANIFEST.in +0 -0
  41. {yutipy-0.1.0 → yutipy-0.1.1}/docs/Makefile +0 -0
  42. {yutipy-0.1.0 → yutipy-0.1.1}/docs/_static/yutipy_header.png +0 -0
  43. {yutipy-0.1.0 → yutipy-0.1.1}/docs/_static/yutipy_logo.png +0 -0
  44. {yutipy-0.1.0 → yutipy-0.1.1}/docs/make.bat +0 -0
  45. {yutipy-0.1.0 → yutipy-0.1.1}/requirements.txt +0 -0
  46. {yutipy-0.1.0 → yutipy-0.1.1}/setup.cfg +0 -0
  47. {yutipy-0.1.0 → yutipy-0.1.1}/tests/__init__.py +0 -0
  48. {yutipy-0.1.0 → yutipy-0.1.1}/tests/__pycache__/__init__.cpython-312.pyc +0 -0
  49. {yutipy-0.1.0 → yutipy-0.1.1}/tests/__pycache__/test_deezer.cpython-312-pytest-8.3.4.pyc +0 -0
  50. {yutipy-0.1.0 → yutipy-0.1.1}/tests/__pycache__/test_itunes.cpython-312-pytest-8.3.4.pyc +0 -0
  51. {yutipy-0.1.0 → yutipy-0.1.1}/tests/__pycache__/test_models.cpython-312-pytest-8.3.4.pyc +0 -0
  52. {yutipy-0.1.0 → yutipy-0.1.1}/tests/__pycache__/test_spotify.cpython-312-pytest-8.3.4.pyc +0 -0
  53. {yutipy-0.1.0 → yutipy-0.1.1}/tests/__pycache__/test_utils.cpython-312-pytest-8.3.4.pyc +0 -0
  54. {yutipy-0.1.0 → yutipy-0.1.1}/tests/test_models.py +0 -0
  55. {yutipy-0.1.0 → yutipy-0.1.1}/tests/test_utils.py +0 -0
  56. {yutipy-0.1.0 → yutipy-0.1.1}/yutipy/__pycache__/exceptions.cpython-312.pyc +0 -0
  57. {yutipy-0.1.0 → yutipy-0.1.1}/yutipy/__pycache__/models.cpython-312.pyc +0 -0
  58. {yutipy-0.1.0 → yutipy-0.1.1}/yutipy/exceptions.py +0 -0
  59. {yutipy-0.1.0 → yutipy-0.1.1}/yutipy/models.py +0 -0
  60. {yutipy-0.1.0 → yutipy-0.1.1}/yutipy/utils/__init__.py +0 -0
  61. {yutipy-0.1.0 → yutipy-0.1.1}/yutipy/utils/__pycache__/__init__.cpython-312.pyc +0 -0
  62. {yutipy-0.1.0 → yutipy-0.1.1}/yutipy/utils/__pycache__/cheap_utils.cpython-312.pyc +0 -0
  63. {yutipy-0.1.0 → yutipy-0.1.1}/yutipy/utils/cheap_utils.py +0 -0
  64. {yutipy-0.1.0 → yutipy-0.1.1}/yutipy.egg-info/dependency_links.txt +0 -0
  65. {yutipy-0.1.0 → yutipy-0.1.1}/yutipy.egg-info/top_level.txt +0 -0
@@ -0,0 +1 @@
1
+ ko_fi: cheapnightbot
@@ -0,0 +1,43 @@
1
+ # This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3
+
4
+ name: Pytest
5
+
6
+ on:
7
+ push:
8
+ branches: [ "main" ]
9
+ pull_request:
10
+ branches: [ "main" ]
11
+
12
+ permissions:
13
+ contents: read
14
+
15
+ jobs:
16
+ build:
17
+
18
+ runs-on: ubuntu-latest
19
+ strategy:
20
+ fail-fast: false
21
+ matrix:
22
+ python-version: ["3.9", "3.10", "3.11"]
23
+
24
+ steps:
25
+ - uses: actions/checkout@v4
26
+ - name: Set up Python ${{ matrix.python-version }}
27
+ uses: actions/setup-python@v3
28
+ with:
29
+ python-version: ${{ matrix.python-version }}
30
+ - name: Install dependencies
31
+ run: |
32
+ python -m pip install --upgrade pip
33
+ python -m pip install flake8 pytest
34
+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
35
+ - name: Lint with flake8
36
+ run: |
37
+ # stop the build if there are Python syntax errors or undefined names
38
+ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
39
+ # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
40
+ flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
41
+ - name: Test with pytest
42
+ run: |
43
+ pytest
@@ -0,0 +1,26 @@
1
+ # Read the Docs configuration file
2
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3
+
4
+ # Required
5
+ version: 2
6
+
7
+ # Set the OS, Python version, and other tools you might need
8
+ build:
9
+ os: ubuntu-24.04
10
+ tools:
11
+ python: "3.12"
12
+
13
+ # Build documentation in the "docs/" directory with Sphinx
14
+ sphinx:
15
+ configuration: docs/conf.py
16
+ builder: html
17
+ fail_on_warning: true
18
+
19
+ # Optionally, but recommended,
20
+ # declare the Python requirements required to build your documentation
21
+ # See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
22
+ python:
23
+ install:
24
+ - method: pip
25
+ path: .
26
+ - requirements: docs/requirements.txt
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: yutipy
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: A simple package for retrieving music information from various music platforms APIs.
5
5
  Author: Cheap Nightbot
6
6
  Author-email: Cheap Nightbot <hi@cheapnightbot.slmail.me>
@@ -53,13 +53,34 @@ Requires-Dist: rapidfuzz==3.12.1
53
53
  Requires-Dist: requests==2.32.3
54
54
  Requires-Dist: ytmusicapi==1.10.1
55
55
  Provides-Extra: dev
56
- Requires-Dist: pytest==8.3.4; extra == "dev"
57
- Requires-Dist: Sphinx==8.2.0; extra == "dev"
56
+ Requires-Dist: pytest; extra == "dev"
58
57
 
59
58
  <p align="center">
60
59
  <img src="https://raw.githubusercontent.com/CheapNightbot/yutipy/main/docs/_static/yutipy_header.png" alt="yutipy" />
61
60
  </p>
62
61
 
62
+ <p align="center">
63
+ <a href="https://github.com/CheapNightbot/yutipy/actions/workflows/tests.yml">
64
+ <img alt="GitHub Actions Workflow Status" src="https://img.shields.io/github/actions/workflow/status/cheapnightbot/yutipy/pytest-unit-testing.yml?style=for-the-badge&label=Pytest">
65
+ </a>
66
+
67
+ <a href="https://pypi.org/project/yutipy/">
68
+ <img src="https://img.shields.io/pypi/v/yutipy?style=for-the-badge" alt="PyPI" />
69
+ </a>
70
+ <a href="https://yutipy.readthedocs.io/en/latest/">
71
+ <img src="https://img.shields.io/readthedocs/yutipy?style=for-the-badge" alt="Documentation Status" />
72
+ </a>
73
+ <a href="https://github.com/CheapNightbot/yutipy/blob/master/LICENSE">
74
+ <img src="https://img.shields.io/github/license/CheapNightbot/yutipy?style=for-the-badge" alt="License" />
75
+ </a>
76
+ <a href="https://github.com/CheapNightbot/yutipy/stargazers">
77
+ <img src="https://img.shields.io/github/stars/CheapNightbot/yutipy?style=for-the-badge" alt="Stars" />
78
+ </a>
79
+ <a href="https://github.com/CheapNightbot/yutipy/issues">
80
+ <img src="https://img.shields.io/github/issues/CheapNightbot/yutipy?style=for-the-badge" alt="Issues" />
81
+ </a>
82
+ </p>
83
+
63
84
  A _**simple**_ Python package for searching and retrieving music information from various music platforms APIs, including Deezer, iTunes, Spotify, and YouTube Music.
64
85
 
65
86
  ## Table of Contents
@@ -98,7 +119,7 @@ with Deezer() as deezer:
98
119
  print(result)
99
120
  ```
100
121
 
101
- For more usage examples, see the [docs](#).
122
+ For more usage examples, see the [Usage Examples](https://yutipy.readthedocs.io/en/latest/usage_examples.html) page in docs.
102
123
 
103
124
  ## Contributing
104
125
 
@@ -1,61 +1,83 @@
1
- <p align="center">
2
- <img src="https://raw.githubusercontent.com/CheapNightbot/yutipy/main/docs/_static/yutipy_header.png" alt="yutipy" />
3
- </p>
4
-
5
- A _**simple**_ Python package for searching and retrieving music information from various music platforms APIs, including Deezer, iTunes, Spotify, and YouTube Music.
6
-
7
- ## Table of Contents
8
-
9
- - [Features](#features)
10
- - [Installation](#installation)
11
- - [Usage Example](#usage-example)
12
- - [Contributing](#contributing)
13
- - [License](#license)
14
-
15
- ## Features
16
-
17
- - Simple & Easy integration with popular music APIs.
18
- - Search for music by artist and song title across multiple platforms.
19
- - Retrieve detailed music information, including album art, release dates, ISRC, and UPC codes.
20
-
21
- ## Installation
22
-
23
- You can install the package using pip. Make sure you have Python 3.8 or higher installed.
24
-
25
- ```bash
26
- pip install -U yutipy
27
- ```
28
-
29
- ## Usage Example
30
-
31
- Here's a quick example of how to use the `yutipy` package to search for a song:
32
-
33
- ### Deezer
34
-
35
- ```python
36
- from yutipy.deezer import Deezer
37
-
38
- with Deezer() as deezer:
39
- result = deezer.search("Artist Name", "Song Title")
40
- print(result)
41
- ```
42
-
43
- For more usage examples, see the [docs](#).
44
-
45
- ## Contributing
46
-
47
- Contributions are welcome! Please follow these steps:
48
-
49
- 1. Fork the repository.
50
- 2. Optionally, create an issue to discuss the changes you plan to make.
51
- 3. Create a new branch linked to that issue.
52
- 4. Make your changes in the new branch.
53
- 5. Write tests if you add new functionality.
54
- 6. Ensure all tests pass before opening a pull request.
55
- 7. Open a pull request for review.
56
-
57
- Thank you for your contributions!
58
-
59
- ## License
60
-
61
- This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/CheapNightbot/yutipy/main/docs/_static/yutipy_header.png" alt="yutipy" />
3
+ </p>
4
+
5
+ <p align="center">
6
+ <a href="https://github.com/CheapNightbot/yutipy/actions/workflows/tests.yml">
7
+ <img alt="GitHub Actions Workflow Status" src="https://img.shields.io/github/actions/workflow/status/cheapnightbot/yutipy/pytest-unit-testing.yml?style=for-the-badge&label=Pytest">
8
+ </a>
9
+
10
+ <a href="https://pypi.org/project/yutipy/">
11
+ <img src="https://img.shields.io/pypi/v/yutipy?style=for-the-badge" alt="PyPI" />
12
+ </a>
13
+ <a href="https://yutipy.readthedocs.io/en/latest/">
14
+ <img src="https://img.shields.io/readthedocs/yutipy?style=for-the-badge" alt="Documentation Status" />
15
+ </a>
16
+ <a href="https://github.com/CheapNightbot/yutipy/blob/master/LICENSE">
17
+ <img src="https://img.shields.io/github/license/CheapNightbot/yutipy?style=for-the-badge" alt="License" />
18
+ </a>
19
+ <a href="https://github.com/CheapNightbot/yutipy/stargazers">
20
+ <img src="https://img.shields.io/github/stars/CheapNightbot/yutipy?style=for-the-badge" alt="Stars" />
21
+ </a>
22
+ <a href="https://github.com/CheapNightbot/yutipy/issues">
23
+ <img src="https://img.shields.io/github/issues/CheapNightbot/yutipy?style=for-the-badge" alt="Issues" />
24
+ </a>
25
+ </p>
26
+
27
+ A _**simple**_ Python package for searching and retrieving music information from various music platforms APIs, including Deezer, iTunes, Spotify, and YouTube Music.
28
+
29
+ ## Table of Contents
30
+
31
+ - [Features](#features)
32
+ - [Installation](#installation)
33
+ - [Usage Example](#usage-example)
34
+ - [Contributing](#contributing)
35
+ - [License](#license)
36
+
37
+ ## Features
38
+
39
+ - Simple & Easy integration with popular music APIs.
40
+ - Search for music by artist and song title across multiple platforms.
41
+ - Retrieve detailed music information, including album art, release dates, ISRC, and UPC codes.
42
+
43
+ ## Installation
44
+
45
+ You can install the package using pip. Make sure you have Python 3.8 or higher installed.
46
+
47
+ ```bash
48
+ pip install -U yutipy
49
+ ```
50
+
51
+ ## Usage Example
52
+
53
+ Here's a quick example of how to use the `yutipy` package to search for a song:
54
+
55
+ ### Deezer
56
+
57
+ ```python
58
+ from yutipy.deezer import Deezer
59
+
60
+ with Deezer() as deezer:
61
+ result = deezer.search("Artist Name", "Song Title")
62
+ print(result)
63
+ ```
64
+
65
+ For more usage examples, see the [Usage Examples](https://yutipy.readthedocs.io/en/latest/usage_examples.html) page in docs.
66
+
67
+ ## Contributing
68
+
69
+ Contributions are welcome! Please follow these steps:
70
+
71
+ 1. Fork the repository.
72
+ 2. Optionally, create an issue to discuss the changes you plan to make.
73
+ 3. Create a new branch linked to that issue.
74
+ 4. Make your changes in the new branch.
75
+ 5. Write tests if you add new functionality.
76
+ 6. Ensure all tests pass before opening a pull request.
77
+ 7. Open a pull request for review.
78
+
79
+ Thank you for your contributions!
80
+
81
+ ## License
82
+
83
+ This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
@@ -5,6 +5,13 @@ API Reference
5
5
  Main Classes
6
6
  =============
7
7
 
8
+ The following classes are available for use, utilizing the APIs of their respective music streaming platforms:
9
+
10
+ - ``Deezer``: https://www.deezer.com
11
+ - ``iTunes``: https://music.apple.com
12
+ - ``Spotify``: https://spotify.com
13
+ - ``YouTube Music``: https://music.youtube.com
14
+
8
15
  Deezer
9
16
  ------
10
17
 
@@ -26,7 +33,7 @@ iTunes
26
33
  Spotify
27
34
  -------
28
35
 
29
- .. autoclass:: yutipy.spotify.Spotipy
36
+ .. autoclass:: yutipy.spotify.Spotify
30
37
  :members:
31
38
  :inherited-members:
32
39
  :noindex:
@@ -6,8 +6,7 @@
6
6
  import os
7
7
  import sys
8
8
 
9
- sys.path.insert(0, os.path.abspath("../.."))
10
- sys.path.insert(0, os.path.abspath("../../yutipy"))
9
+ sys.path.insert(0, os.path.abspath("../yutipy"))
11
10
 
12
11
  # -- Project information -----------------------------------------------------
13
12
  # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
@@ -23,6 +22,8 @@ release = "0.1.0"
23
22
  extensions = [
24
23
  "sphinx.ext.autodoc",
25
24
  "sphinx.ext.napoleon",
25
+ "sphinx_copybutton",
26
+ "sphinxext.opengraph",
26
27
  ]
27
28
 
28
29
  # Exclude private members and special methods
@@ -35,6 +36,13 @@ autodoc_default_options = {
35
36
  "show-inheritance": True,
36
37
  }
37
38
 
39
+ # sphinx-copybutton optional configurations
40
+ copybutton_prompt_text = r">>> |\.\.\. "
41
+ copybutton_prompt_is_regexp = True
42
+ copybutton_only_copy_code_blocks = False
43
+ copybutton_remove_prompts = True
44
+ copybutton_trim_trailing_whitespace = True
45
+
38
46
  templates_path = ["_templates"]
39
47
  exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
40
48
 
@@ -44,6 +52,7 @@ exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
44
52
 
45
53
  # The name of the Pygments (syntax highlighting) style to use.
46
54
  pygments_style = "sphinx"
55
+ pygments_dark_style = "monokai"
47
56
 
48
57
  # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
49
58
  html_show_sphinx = True
@@ -54,20 +63,9 @@ html_show_sourcelink = False
54
63
  # Output file base name for HTML help builder.
55
64
  htmlhelp_basename = "yutipydoc"
56
65
 
57
- html_theme = "alabaster"
66
+ html_theme = "furo"
58
67
  html_static_path = ["_static"]
59
- html_logo = "_static/yutipy_logo.png"
60
68
  html_favicon = "_static/yutipy_logo.png"
61
-
62
- html_sidebars = {
63
- "index": [
64
- "project_links.html",
65
- "contents.html",
66
- "searchbox.html",
67
- ],
68
- "**": [
69
- "contents.html",
70
- "localtoc.html",
71
- "searchbox.html",
72
- ],
73
- }
69
+ html_logo = "_static/yutipy_logo.png"
70
+ html_css_files = ["custom.css"]
71
+ html_title = project
@@ -0,0 +1,27 @@
1
+ .. image:: _static/yutipy_header.png
2
+ :alt: Welcome to yutipy's documentation!
3
+ :target: https://github.com/CheapNightbot/yutipy
4
+ :align: center
5
+
6
+ **yutipy** is a Python package for searching and retrieving music information from various music platforms,
7
+ including Deezer, iTunes, Spotify, and YouTube Music. This documentation will help you get started with yutipy
8
+ and provide detailed information about its features and usage.
9
+
10
+ Get Started
11
+ ===========
12
+
13
+ .. toctree::
14
+ :maxdepth: 2
15
+
16
+ installation
17
+ usage_examples
18
+ api_reference
19
+
20
+ .. toctree::
21
+ :caption: Project Links
22
+ :hidden:
23
+
24
+ pypi <https://pypi.org/project/yutipy>
25
+ source code <https://github.com/CheapNightbot/yutipy>
26
+ issue tracker <https://github.com/CheapNightbot/yutipy/issues>
27
+ support project <https://ko-fi.com/cheapnightbot>
@@ -7,3 +7,4 @@ You can install the package using pip. Make sure you have Python 3.8 or higher i
7
7
  .. code-block:: bash
8
8
 
9
9
  pip install -U yutipy
10
+
@@ -0,0 +1,4 @@
1
+ furo
2
+ sphinx-copybutton
3
+ Sphinx
4
+ sphinxext-opengraph
@@ -0,0 +1,83 @@
1
+ ==============
2
+ Usage Examples
3
+ ==============
4
+
5
+ Here's a quick example of how to use the **yutipy** package to search for a song:
6
+
7
+ .. important::
8
+ All examples here—except for the `YouTube Music`_—use the ``with`` context manager to initialize an instance of the respective class,
9
+ as those classes internally use ``requests.Session()`` for making requests to APIs.
10
+ This approach ensures that the session is automatically closed once you exit the context. Although using ``with`` is not mandatory,
11
+ if you instantiate an object without it, you are responsible for closing the session after use by calling the ``close_session()`` method on that object.
12
+
13
+ Deezer
14
+ ------
15
+
16
+ .. code-block:: python
17
+
18
+ from yutipy.deezer import Deezer
19
+
20
+ with Deezer() as deezer:
21
+ result = deezer.search("Artist Name", "Song Title")
22
+ print(result)
23
+
24
+ iTunes
25
+ ------
26
+
27
+ .. code-block:: python
28
+
29
+ from yutipy.itunes import Itunes
30
+
31
+ with Itunes() as itunes:
32
+ result = itunes.search("Artist Name", "Song Title")
33
+ print(result)
34
+
35
+ Spotify
36
+ -------
37
+
38
+ To use the Spotify API, you need to set the ``CLIENT_ID`` and ``CLIENT_SECRET`` for Spotify. You can do this by creating a ``.env`` file in the root directory of your project with the following content:
39
+
40
+ .. admonition:: .env
41
+
42
+ .. code-block:: bash
43
+
44
+ CLIENT_ID=your_spotify_client_id
45
+ CLIENT_SECRET=your_spotify_client_secret
46
+
47
+ Alternatively, you can manually provide these values when creating an object of the `Spotify` class:
48
+
49
+ .. code-block:: python
50
+
51
+ from yutipy.spotify import Spotify
52
+
53
+ spotify = Spotify(client_id="your_spotify_client_id", client_secret="your_spotify_client_secret")
54
+
55
+ .. code-block:: python
56
+
57
+ from yutipy.spotify import Spotify
58
+
59
+ with Spotify() as spotify:
60
+ result = spotify.search("Artist Name", "Song Title")
61
+ print(result)
62
+
63
+ OR, if you have the ":abbr:`ISRC (International Standard Recording Code)`" or ":abbr:`UPC (Universal Product Code)`" of the song, you can use the `search_advanced` method:
64
+
65
+ .. code-block:: python
66
+
67
+ from yutipy.spotify import Spotify
68
+
69
+ with Spotify() as spotify:
70
+ # ISRC for "single" tracks & UPC for "album" tracks. Only one of them is required.
71
+ result = spotify.search_advanced("Artist Name", "Song Title", isrc="USAT29900609", upc="00602517078194")
72
+ print(result)
73
+
74
+ YouTube Music
75
+ -------------
76
+
77
+ .. code-block:: python
78
+
79
+ from yutipy.musicyt import MusicYT
80
+
81
+ music_yt = MusicYT()
82
+ result = music_yt.search("Artist Name", "Song Title")
83
+ print(result)
@@ -39,8 +39,7 @@ classifiers = [
39
39
 
40
40
  [project.optional-dependencies]
41
41
  dev = [
42
- "pytest==8.3.4",
43
- "Sphinx==8.2.0",
42
+ "pytest",
44
43
  ]
45
44
 
46
45
  [project.urls]
@@ -0,0 +1 @@
1
+ pytest
@@ -43,5 +43,5 @@ def test_search_no_results(deezer):
43
43
 
44
44
 
45
45
  def test_close_session(deezer):
46
- deezer._close_session()
46
+ deezer.close_session()
47
47
  assert deezer.is_session_closed
@@ -45,5 +45,5 @@ def test_search_empty_song(itunes):
45
45
 
46
46
 
47
47
  def test_close_session(itunes):
48
- itunes._close_session()
48
+ itunes.close_session()
49
49
  assert itunes.is_session_closed
@@ -21,8 +21,8 @@ def test_search_valid(music_yt):
21
21
 
22
22
 
23
23
  def test_search_invalid(music_yt):
24
- artist = "Nonexistent Artist"
25
- song = "Nonexistent Song"
24
+ artist = ";laksjdflkajsdfj;asdjf"
25
+ song = "jaksjd;fljkas;dfkjasldkjf"
26
26
  result = music_yt.search(artist, song)
27
27
  assert result is None
28
28
 
@@ -2,13 +2,13 @@ import pytest
2
2
 
3
3
  from yutipy.exceptions import SpotifyException
4
4
  from yutipy.models import MusicInfo
5
- from yutipy.spotify import Spotipy
5
+ from yutipy.spotify import Spotify
6
6
 
7
7
 
8
8
  @pytest.fixture(scope="module")
9
9
  def spotify():
10
10
  try:
11
- return Spotipy()
11
+ return Spotify()
12
12
  except SpotifyException:
13
13
  pytest.skip("Spotify credentials not found")
14
14
 
@@ -49,5 +49,5 @@ def test_get_artists_ids(spotify):
49
49
 
50
50
 
51
51
  def test_close_session(spotify):
52
- spotify._close_session()
52
+ spotify.close_session()
53
53
  assert spotify.is_session_closed
@@ -2,12 +2,12 @@ from .deezer import Deezer
2
2
  from .itunes import Itunes
3
3
  from .models import MusicInfo
4
4
  from .musicyt import MusicYT
5
- from .spotify import Spotipy
5
+ from .spotify import Spotify
6
6
 
7
7
  __all__ = [
8
8
  "Deezer",
9
9
  "Itunes",
10
10
  "MusicInfo",
11
11
  "MusicYT",
12
- "Spotipy",
12
+ "Spotify",
13
13
  ]
@@ -30,7 +30,7 @@ class Deezer:
30
30
  """Exits the runtime context related to this object."""
31
31
  self._close_session()
32
32
 
33
- def _close_session(self) -> None:
33
+ def close_session(self) -> None:
34
34
  """Closes the current session."""
35
35
  if not self.is_session_closed:
36
36
  self._session.close()
@@ -54,7 +54,7 @@ class Deezer:
54
54
 
55
55
  Returns
56
56
  -------
57
- Optional[MusicInfo]
57
+ Optional[MusicInfo_]
58
58
  The music information if found, otherwise None.
59
59
  """
60
60
  if not is_valid_string(artist) or not is_valid_string(song):
@@ -104,13 +104,12 @@ class Deezer:
104
104
  Optional[Dict]
105
105
  A dictionary containing UPC and ISRC information.
106
106
  """
107
- match music_type:
108
- case "track":
109
- return self._get_track_info(music_id)
110
- case "album":
111
- return self._get_album_info(music_id)
112
- case _:
113
- raise DeezerException(f"Invalid music type: {music_type}")
107
+ if music_type == "track":
108
+ return self._get_track_info(music_id)
109
+ elif music_type == "album":
110
+ return self._get_album_info(music_id)
111
+ else:
112
+ raise DeezerException(f"Invalid music type: {music_type}")
114
113
 
115
114
  def _get_track_info(self, music_id: int) -> Optional[Dict]:
116
115
  """
@@ -31,7 +31,7 @@ class Itunes:
31
31
  """Exits the runtime context related to this object."""
32
32
  self._close_session()
33
33
 
34
- def _close_session(self) -> None:
34
+ def close_session(self) -> None:
35
35
  """Closes the current session."""
36
36
  if not self.is_session_closed:
37
37
  self._session.close()
@@ -55,7 +55,7 @@ class Itunes:
55
55
 
56
56
  Returns
57
57
  -------
58
- Optional[MusicInfo]
58
+ Optional[MusicInfo_]
59
59
  The music information if found, otherwise None.
60
60
  """
61
61
  if not is_valid_string(artist) or not is_valid_string(song):
@@ -33,7 +33,7 @@ class MusicYT:
33
33
 
34
34
  Returns
35
35
  -------
36
- Optional[MusicInfo]
36
+ Optional[MusicInfo_]
37
37
  The music information if found, otherwise None.
38
38
  """
39
39
  if not is_valid_string(artist) or not is_valid_string(song):
@@ -2,7 +2,7 @@ import base64
2
2
  import os
3
3
  import time
4
4
  from pprint import pprint
5
- from typing import Optional
5
+ from typing import Optional, Union
6
6
 
7
7
  import requests
8
8
  from dotenv import load_dotenv
@@ -27,11 +27,11 @@ CLIENT_ID = os.getenv("CLIENT_ID")
27
27
  CLIENT_SECRET = os.getenv("CLIENT_SECRET")
28
28
 
29
29
 
30
- class Spotipy:
30
+ class Spotify:
31
31
  """
32
32
  A class to interact with the Spotify API.
33
33
 
34
- This class reads the CLIENT_ID and CLIENT_SECRET from the .env file by default.
34
+ This class reads the ``CLIENT_ID`` and ``CLIENT_SECRET`` from environment variables or the ``.env`` file by default.
35
35
  Alternatively, users can manually provide these values when creating an object.
36
36
  """
37
37
 
@@ -39,7 +39,7 @@ class Spotipy:
39
39
  self, client_id: str = CLIENT_ID, client_secret: str = CLIENT_SECRET
40
40
  ) -> None:
41
41
  """
42
- Initializes the Spotipy class and sets up the session.
42
+ Initializes the Spotify class and sets up the session.
43
43
 
44
44
  Parameters
45
45
  ----------
@@ -69,7 +69,7 @@ class Spotipy:
69
69
  """Exits the runtime context related to this object."""
70
70
  self._close_session()
71
71
 
72
- def _close_session(self) -> None:
72
+ def close_session(self) -> None:
73
73
  """Closes the current session."""
74
74
  if not self.is_session_closed:
75
75
  self._session.close()
@@ -147,7 +147,7 @@ class Spotipy:
147
147
 
148
148
  Returns
149
149
  -------
150
- Optional[MusicInfo]
150
+ Optional[MusicInfo_]
151
151
  The music information if found, otherwise None.
152
152
  """
153
153
  if not is_valid_string(artist) or not is_valid_string(song):
@@ -192,7 +192,7 @@ class Spotipy:
192
192
 
193
193
  Returns
194
194
  -------
195
- Optional[MusicInfo]
195
+ Optional[MusicInfo_]
196
196
  The music information if found, otherwise None.
197
197
  """
198
198
  if not is_valid_string(artist) or not is_valid_string(song):
@@ -224,7 +224,7 @@ class Spotipy:
224
224
  artist_ids = self._get_artists_ids(artist)
225
225
  return self._find_music_info(artist, song, response.json(), artist_ids)
226
226
 
227
- def _get_artists_ids(self, artist: str) -> list | None:
227
+ def _get_artists_ids(self, artist: str) -> Union[list, None]:
228
228
  """
229
229
  Retrieves the IDs of the artists.
230
230
 
@@ -235,7 +235,7 @@ class Spotipy:
235
235
 
236
236
  Returns
237
237
  -------
238
- list | None
238
+ Union[list, None]
239
239
  A list of artist IDs or None if not found.
240
240
  """
241
241
  artist_ids = []
@@ -403,11 +403,11 @@ class Spotipy:
403
403
 
404
404
 
405
405
  if __name__ == "__main__":
406
- spotipy = Spotipy(CLIENT_ID, CLIENT_SECRET)
406
+ Spotify = Spotify(CLIENT_ID, CLIENT_SECRET)
407
407
 
408
408
  try:
409
409
  artist_name = input("Artist Name: ")
410
410
  song_name = input("Song Name: ")
411
- pprint(spotipy.search(artist_name, song_name))
411
+ pprint(Spotify.search(artist_name, song_name))
412
412
  finally:
413
- spotipy._close_session()
413
+ Spotify._close_session()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: yutipy
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: A simple package for retrieving music information from various music platforms APIs.
5
5
  Author: Cheap Nightbot
6
6
  Author-email: Cheap Nightbot <hi@cheapnightbot.slmail.me>
@@ -53,13 +53,34 @@ Requires-Dist: rapidfuzz==3.12.1
53
53
  Requires-Dist: requests==2.32.3
54
54
  Requires-Dist: ytmusicapi==1.10.1
55
55
  Provides-Extra: dev
56
- Requires-Dist: pytest==8.3.4; extra == "dev"
57
- Requires-Dist: Sphinx==8.2.0; extra == "dev"
56
+ Requires-Dist: pytest; extra == "dev"
58
57
 
59
58
  <p align="center">
60
59
  <img src="https://raw.githubusercontent.com/CheapNightbot/yutipy/main/docs/_static/yutipy_header.png" alt="yutipy" />
61
60
  </p>
62
61
 
62
+ <p align="center">
63
+ <a href="https://github.com/CheapNightbot/yutipy/actions/workflows/tests.yml">
64
+ <img alt="GitHub Actions Workflow Status" src="https://img.shields.io/github/actions/workflow/status/cheapnightbot/yutipy/pytest-unit-testing.yml?style=for-the-badge&label=Pytest">
65
+ </a>
66
+
67
+ <a href="https://pypi.org/project/yutipy/">
68
+ <img src="https://img.shields.io/pypi/v/yutipy?style=for-the-badge" alt="PyPI" />
69
+ </a>
70
+ <a href="https://yutipy.readthedocs.io/en/latest/">
71
+ <img src="https://img.shields.io/readthedocs/yutipy?style=for-the-badge" alt="Documentation Status" />
72
+ </a>
73
+ <a href="https://github.com/CheapNightbot/yutipy/blob/master/LICENSE">
74
+ <img src="https://img.shields.io/github/license/CheapNightbot/yutipy?style=for-the-badge" alt="License" />
75
+ </a>
76
+ <a href="https://github.com/CheapNightbot/yutipy/stargazers">
77
+ <img src="https://img.shields.io/github/stars/CheapNightbot/yutipy?style=for-the-badge" alt="Stars" />
78
+ </a>
79
+ <a href="https://github.com/CheapNightbot/yutipy/issues">
80
+ <img src="https://img.shields.io/github/issues/CheapNightbot/yutipy?style=for-the-badge" alt="Issues" />
81
+ </a>
82
+ </p>
83
+
63
84
  A _**simple**_ Python package for searching and retrieving music information from various music platforms APIs, including Deezer, iTunes, Spotify, and YouTube Music.
64
85
 
65
86
  ## Table of Contents
@@ -98,7 +119,7 @@ with Deezer() as deezer:
98
119
  print(result)
99
120
  ```
100
121
 
101
- For more usage examples, see the [docs](#).
122
+ For more usage examples, see the [Usage Examples](https://yutipy.readthedocs.io/en/latest/usage_examples.html) page in docs.
102
123
 
103
124
  ## Contributing
104
125
 
@@ -1,22 +1,24 @@
1
1
  .gitattributes
2
2
  .gitignore
3
+ .readthedocs.yaml
3
4
  LICENSE
4
5
  MANIFEST.in
5
6
  README.md
6
7
  pyproject.toml
7
8
  requirements-dev.txt
8
9
  requirements.txt
10
+ .github/FUNDING.yml
11
+ .github/workflows/pytest-unit-testing.yml
9
12
  docs/Makefile
10
13
  docs/api_reference.rst
11
14
  docs/conf.py
12
15
  docs/index.rst
13
16
  docs/installation.rst
14
17
  docs/make.bat
18
+ docs/requirements.txt
15
19
  docs/usage_examples.rst
16
20
  docs/_static/yutipy_header.png
17
21
  docs/_static/yutipy_logo.png
18
- docs/_templates/contents.html
19
- docs/_templates/project_links.html
20
22
  tests/__init__.py
21
23
  tests/test_deezer.py
22
24
  tests/test_itunes.py
@@ -4,5 +4,4 @@ requests==2.32.3
4
4
  ytmusicapi==1.10.1
5
5
 
6
6
  [dev]
7
- pytest==8.3.4
8
- Sphinx==8.2.0
7
+ pytest
@@ -1,2 +0,0 @@
1
- <h3>Contents</h3>
2
- {{ toctree() }}
@@ -1,8 +0,0 @@
1
- <div class="project-links">
2
- <h3>Project Links</h3>
3
- <ul>
4
- <li><a href="https://github.com/CheapNightbot/yutipy">Source Code</a></li>
5
- <li><a href="https://github.com/CheapNightbot/yutipy/issues">Issue Tracker</a></li>
6
- <li><a href="https://pypi.org/project/yutipy">PyPI</a></li>
7
- </ul>
8
- </div>
@@ -1,15 +0,0 @@
1
- .. image:: _static/yutipy_header.png
2
- :alt: Welcome to yutipy's documentation!
3
- :target: https://github.com/CheapNightbot/yutipy
4
-
5
- **yutipy** is a Python package for searching and retrieving music information from various music platforms, including Deezer, iTunes, Spotify, and YouTube Music. This documentation will help you get started with yutipy and provide detailed information about its features and usage.
6
-
7
- Get Started
8
- ===========
9
-
10
- .. toctree::
11
- :maxdepth: 2
12
-
13
- installation
14
- usage_examples
15
- api_reference
@@ -1,74 +0,0 @@
1
- =====
2
- Usage
3
- =====
4
-
5
- Here's a quick example of how to use the `yutipy` package to search for a song:
6
-
7
- Deezer
8
- ------
9
-
10
- .. code-block:: python
11
-
12
- from yutipy.deezer import Deezer
13
-
14
- with Deezer() as deezer:
15
- result = deezer.search("Artist Name", "Song Title")
16
- print(result)
17
-
18
- iTunes
19
- ------
20
-
21
- .. code-block:: python
22
-
23
- from yutipy.itunes import Itunes
24
-
25
- with Itunes() as itunes:
26
- result = itunes.search("Artist Name", "Song Title")
27
- print(result)
28
-
29
- Spotify
30
- -------
31
-
32
- To use the Spotify API, you need to set the `CLIENT_ID` and `CLIENT_SECRET` for Spotify. You can do this by creating a `.env` file in the root directory of your project with the following content:
33
-
34
- .. code-block:: text
35
-
36
- CLIENT_ID=your_spotify_client_id
37
- CLIENT_SECRET=your_spotify_client_secret
38
-
39
- Alternatively, you can manually provide these values when creating an object of the `Spotipy` class:
40
-
41
- .. code-block:: python
42
-
43
- from yutipy.spotify import Spotipy
44
-
45
- spotify = Spotipy(client_id="your_spotify_client_id", client_secret="your_spotify_client_secret")
46
-
47
- .. code-block:: python
48
-
49
- from yutipy.spotify import Spotipy
50
-
51
- with Spotipy() as spotify:
52
- result = spotify.search("Artist Name", "Song Title")
53
- print(result)
54
-
55
- OR, if you have the ISRC or UPC of the song, you can use the `search_advanced` method:
56
-
57
- .. code-block:: python
58
-
59
- from yutipy.spotify import Spotipy
60
-
61
- spotify = Spotipy()
62
- # ISRC for "single" tracks & UPC for "album" tracks. Only one of them is required.
63
- result = spotify.search_advanced("Artist Name", "Song Title", isrc="USAT29900609", upc="00602517078194")
64
-
65
- YouTube Music
66
- -------------
67
-
68
- .. code-block:: python
69
-
70
- from yutipy.musicyt import MusicYT
71
-
72
- music_yt = MusicYT()
73
- result = music_yt.search("Artist Name", "Song Title")
74
- print(result)
@@ -1,2 +0,0 @@
1
- pytest==8.3.4
2
- Sphinx==8.2.0
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