yutipy 0.1.0__py3-none-any.whl
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.
- yutipy/__init__.py +13 -0
- yutipy/__pycache__/__init__.cpython-312.pyc +0 -0
- yutipy/__pycache__/deezer.cpython-312.pyc +0 -0
- yutipy/__pycache__/exceptions.cpython-312.pyc +0 -0
- yutipy/__pycache__/itunes.cpython-312.pyc +0 -0
- yutipy/__pycache__/models.cpython-312.pyc +0 -0
- yutipy/__pycache__/musicyt.cpython-312.pyc +0 -0
- yutipy/__pycache__/spotify.cpython-312.pyc +0 -0
- yutipy/deezer.py +277 -0
- yutipy/exceptions.py +52 -0
- yutipy/itunes.py +189 -0
- yutipy/models.py +55 -0
- yutipy/musicyt.py +247 -0
- yutipy/spotify.py +413 -0
- yutipy/utils/__init__.py +7 -0
- yutipy/utils/__pycache__/__init__.cpython-312.pyc +0 -0
- yutipy/utils/__pycache__/cheap_utils.cpython-312.pyc +0 -0
- yutipy/utils/cheap_utils.py +50 -0
- yutipy-0.1.0.dist-info/LICENSE +21 -0
- yutipy-0.1.0.dist-info/METADATA +119 -0
- yutipy-0.1.0.dist-info/RECORD +23 -0
- yutipy-0.1.0.dist-info/WHEEL +5 -0
- yutipy-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
def are_strings_similar(str1: str, str2: str, threshold: int = 80) -> bool:
|
|
2
|
+
"""
|
|
3
|
+
Determine if two strings are similar based on a given threshold.
|
|
4
|
+
|
|
5
|
+
Args:
|
|
6
|
+
str1 (str): First string to compare.
|
|
7
|
+
str2 (str): Second string to compare.
|
|
8
|
+
threshold (int, optional): Similarity threshold. Defaults to 80.
|
|
9
|
+
|
|
10
|
+
Returns:
|
|
11
|
+
bool: True if the strings are similar, otherwise False.
|
|
12
|
+
"""
|
|
13
|
+
from rapidfuzz import fuzz
|
|
14
|
+
from rapidfuzz.utils import default_process
|
|
15
|
+
|
|
16
|
+
similarity_score = fuzz.WRatio(str1, str2, processor=default_process)
|
|
17
|
+
return similarity_score > threshold
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def separate_artists(artists: str, custom_separator: str = None) -> list[str]:
|
|
21
|
+
"""
|
|
22
|
+
Separate artist names of a song or album into a list.
|
|
23
|
+
|
|
24
|
+
Args:
|
|
25
|
+
artists (str): Artists string (e.g., artistA & artistB, artistA ft. artistB).
|
|
26
|
+
custom_separator (str, optional): A specific separator to use. Defaults to None.
|
|
27
|
+
|
|
28
|
+
Returns:
|
|
29
|
+
list[str]: List of individual artists.
|
|
30
|
+
"""
|
|
31
|
+
default_separators = [";", "/", "ft.", "ft", "feat", "feat.", "with", "&", "and"]
|
|
32
|
+
|
|
33
|
+
if custom_separator:
|
|
34
|
+
separators = [custom_separator]
|
|
35
|
+
else:
|
|
36
|
+
separators = default_separators
|
|
37
|
+
|
|
38
|
+
for sep in separators:
|
|
39
|
+
artists = artists.replace(sep, ",")
|
|
40
|
+
|
|
41
|
+
return [artist.strip() for artist in artists.split(",") if artist.strip()]
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def is_valid_string(string: str) -> bool:
|
|
45
|
+
"""Validate if a string is non-empty, alphanumeric, or contains non-whitespace characters."""
|
|
46
|
+
return bool(string and (string.isalnum() or not string.isspace()))
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
if __name__ == "__main__":
|
|
50
|
+
separate_artists("Artist A ft. Artist B")
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Cheap Nightbot
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: yutipy
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A simple package for retrieving music information from various music platforms APIs.
|
|
5
|
+
Author: Cheap Nightbot
|
|
6
|
+
Author-email: Cheap Nightbot <hi@cheapnightbot.slmail.me>
|
|
7
|
+
Maintainer-email: Cheap Nightbot <hi@cheapnightbot.slmail.me>
|
|
8
|
+
License: MIT License
|
|
9
|
+
|
|
10
|
+
Copyright (c) 2025 Cheap Nightbot
|
|
11
|
+
|
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
in the Software without restriction, including without limitation the rights
|
|
15
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
furnished to do so, subject to the following conditions:
|
|
18
|
+
|
|
19
|
+
The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
copies or substantial portions of the Software.
|
|
21
|
+
|
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
SOFTWARE.
|
|
29
|
+
|
|
30
|
+
Project-URL: Homepage, https://github.com/CheapNightbot/yutipy
|
|
31
|
+
Project-URL: Documentation, https://yutipy.readthedocs.io/
|
|
32
|
+
Project-URL: Repository, https://github.com/CheapNightbot/yutipy.git
|
|
33
|
+
Project-URL: Issues, https://github.com/CheapNightbot/yutipy/issues
|
|
34
|
+
Project-URL: Changelog, https://github.com/CheapNightbot/yutipy/blob/master/CHANGELOG.md
|
|
35
|
+
Project-URL: funding, https://ko-fi.com/cheapnightbot
|
|
36
|
+
Keywords: music,API,Deezer,iTunes,Spotify,YouTube Music,search,retrieve,information,yutify
|
|
37
|
+
Classifier: Development Status :: 4 - Beta
|
|
38
|
+
Classifier: Intended Audience :: Developers
|
|
39
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
40
|
+
Classifier: Programming Language :: Python :: 3
|
|
41
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
42
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
43
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
44
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
45
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
46
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
47
|
+
Classifier: Operating System :: OS Independent
|
|
48
|
+
Requires-Python: >=3.8
|
|
49
|
+
Description-Content-Type: text/markdown
|
|
50
|
+
License-File: LICENSE
|
|
51
|
+
Requires-Dist: python-dotenv==1.0.1
|
|
52
|
+
Requires-Dist: rapidfuzz==3.12.1
|
|
53
|
+
Requires-Dist: requests==2.32.3
|
|
54
|
+
Requires-Dist: ytmusicapi==1.10.1
|
|
55
|
+
Provides-Extra: dev
|
|
56
|
+
Requires-Dist: pytest==8.3.4; extra == "dev"
|
|
57
|
+
Requires-Dist: Sphinx==8.2.0; extra == "dev"
|
|
58
|
+
|
|
59
|
+
<p align="center">
|
|
60
|
+
<img src="https://raw.githubusercontent.com/CheapNightbot/yutipy/main/docs/_static/yutipy_header.png" alt="yutipy" />
|
|
61
|
+
</p>
|
|
62
|
+
|
|
63
|
+
A _**simple**_ Python package for searching and retrieving music information from various music platforms APIs, including Deezer, iTunes, Spotify, and YouTube Music.
|
|
64
|
+
|
|
65
|
+
## Table of Contents
|
|
66
|
+
|
|
67
|
+
- [Features](#features)
|
|
68
|
+
- [Installation](#installation)
|
|
69
|
+
- [Usage Example](#usage-example)
|
|
70
|
+
- [Contributing](#contributing)
|
|
71
|
+
- [License](#license)
|
|
72
|
+
|
|
73
|
+
## Features
|
|
74
|
+
|
|
75
|
+
- Simple & Easy integration with popular music APIs.
|
|
76
|
+
- Search for music by artist and song title across multiple platforms.
|
|
77
|
+
- Retrieve detailed music information, including album art, release dates, ISRC, and UPC codes.
|
|
78
|
+
|
|
79
|
+
## Installation
|
|
80
|
+
|
|
81
|
+
You can install the package using pip. Make sure you have Python 3.8 or higher installed.
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
pip install -U yutipy
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Usage Example
|
|
88
|
+
|
|
89
|
+
Here's a quick example of how to use the `yutipy` package to search for a song:
|
|
90
|
+
|
|
91
|
+
### Deezer
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
from yutipy.deezer import Deezer
|
|
95
|
+
|
|
96
|
+
with Deezer() as deezer:
|
|
97
|
+
result = deezer.search("Artist Name", "Song Title")
|
|
98
|
+
print(result)
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
For more usage examples, see the [docs](#).
|
|
102
|
+
|
|
103
|
+
## Contributing
|
|
104
|
+
|
|
105
|
+
Contributions are welcome! Please follow these steps:
|
|
106
|
+
|
|
107
|
+
1. Fork the repository.
|
|
108
|
+
2. Optionally, create an issue to discuss the changes you plan to make.
|
|
109
|
+
3. Create a new branch linked to that issue.
|
|
110
|
+
4. Make your changes in the new branch.
|
|
111
|
+
5. Write tests if you add new functionality.
|
|
112
|
+
6. Ensure all tests pass before opening a pull request.
|
|
113
|
+
7. Open a pull request for review.
|
|
114
|
+
|
|
115
|
+
Thank you for your contributions!
|
|
116
|
+
|
|
117
|
+
## License
|
|
118
|
+
|
|
119
|
+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
yutipy/__init__.py,sha256=GKMg-aksc_2IAjcKAogGCe_aeSstuwAexjVdJRPS0mE,232
|
|
2
|
+
yutipy/deezer.py,sha256=h2ZeOyzS0L0--qmowkNsFXUl0Nbk30x447bapTV10Io,8667
|
|
3
|
+
yutipy/exceptions.py,sha256=QDfOkaeZtSNg1lhXZ872yNJwbof68eVHDezZeZh8DiU,1029
|
|
4
|
+
yutipy/itunes.py,sha256=NiRGCgV5EASjkS_FPhzDwOq8oge-AeDwkVK4JHNy698,5843
|
|
5
|
+
yutipy/models.py,sha256=-UEi05on5XsKjFSqUNt1yZnLod_A9upqh2nIPWTtEEI,1415
|
|
6
|
+
yutipy/musicyt.py,sha256=fVhCFZUgv34CjyDRMIBeLNYsEuTgENxyMlGUt9Uf1JA,7154
|
|
7
|
+
yutipy/spotify.py,sha256=X8-jDFj8U5kY4zeuGoZ-hrgDbzbKKww47vpVvJev1rA,12849
|
|
8
|
+
yutipy/__pycache__/__init__.cpython-312.pyc,sha256=hnQz69yUeXB3mK1j0EiIsKfFRm1ywiQF170VggBhjdc,392
|
|
9
|
+
yutipy/__pycache__/deezer.cpython-312.pyc,sha256=w5LdiOePHf0NLLDQfj__FxsuplJ4dN5JLnCAK0MXD9I,10578
|
|
10
|
+
yutipy/__pycache__/exceptions.cpython-312.pyc,sha256=Zc73Tr79emWJ9pmpAVoL12YnBBOWJulV1hxtSso4hy8,2096
|
|
11
|
+
yutipy/__pycache__/itunes.cpython-312.pyc,sha256=PvXlgEp6uWzAR_VlPYP-bmQQPmkURz2237AOgFiD5o4,7511
|
|
12
|
+
yutipy/__pycache__/models.cpython-312.pyc,sha256=KJUa3-C67TMq1EAGuQlZYT99JS1AEDUi74KY8bEHkkg,1848
|
|
13
|
+
yutipy/__pycache__/musicyt.cpython-312.pyc,sha256=494-Q64MEXVwsRSZycCCp6T-h37y0RAARnv_OA2QZ-0,9175
|
|
14
|
+
yutipy/__pycache__/spotify.cpython-312.pyc,sha256=P5UXhd8g0h9EaxfPaPyQUeIIHHqLmQCcAXfJcTTKzsI,15789
|
|
15
|
+
yutipy/utils/__init__.py,sha256=7UFcFZ7fBtNXOTngjnRD3MeobT3x5UT2Gag94TXVgLk,169
|
|
16
|
+
yutipy/utils/cheap_utils.py,sha256=LIuEHib_97NuLahXxdHJUD9v-ccXNUc3NrLYk8EQ52A,1652
|
|
17
|
+
yutipy/utils/__pycache__/__init__.cpython-312.pyc,sha256=_ldEMv66ELlrY1M7fN_2r5XySvgAsqTE0U8ASGXx8bs,286
|
|
18
|
+
yutipy/utils/__pycache__/cheap_utils.cpython-312.pyc,sha256=i6nRmXcRtCkTzKQ1mWyjN7Xz4NapqgBdXA33so8xgLU,2376
|
|
19
|
+
yutipy-0.1.0.dist-info/LICENSE,sha256=Tymbhvk1F_6BDFE0X8BBiQp7cBCjbzKfRAITmvxJIyA,1092
|
|
20
|
+
yutipy-0.1.0.dist-info/METADATA,sha256=krlRAHqZqAowrWiRymP1L5pyC5IgHht8BVpQTz01qMs,4708
|
|
21
|
+
yutipy-0.1.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
22
|
+
yutipy-0.1.0.dist-info/top_level.txt,sha256=t2A5V2_mUcfnHkbCy6tAQlb3909jDYU5GQgXtA4756I,7
|
|
23
|
+
yutipy-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
yutipy
|