yutipy 2.4.1__tar.gz → 2.4.3__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 (68) hide show
  1. {yutipy-2.4.1 → yutipy-2.4.3}/PKG-INFO +6 -6
  2. {yutipy-2.4.1 → yutipy-2.4.3}/pyproject.toml +5 -5
  3. yutipy-2.4.3/requirements.txt +5 -0
  4. {yutipy-2.4.1 → yutipy-2.4.3}/yutipy/utils/helpers.py +14 -0
  5. {yutipy-2.4.1 → yutipy-2.4.3}/yutipy.egg-info/PKG-INFO +6 -6
  6. yutipy-2.4.3/yutipy.egg-info/requires.txt +5 -0
  7. yutipy-2.4.1/requirements.txt +0 -5
  8. yutipy-2.4.1/yutipy.egg-info/requires.txt +0 -5
  9. {yutipy-2.4.1 → yutipy-2.4.3}/.gitattributes +0 -0
  10. {yutipy-2.4.1 → yutipy-2.4.3}/.github/FUNDING.yml +0 -0
  11. {yutipy-2.4.1 → yutipy-2.4.3}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  12. {yutipy-2.4.1 → yutipy-2.4.3}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  13. {yutipy-2.4.1 → yutipy-2.4.3}/.github/dependabot.yml +0 -0
  14. {yutipy-2.4.1 → yutipy-2.4.3}/.github/workflows/pytest-unit-testing.yml +0 -0
  15. {yutipy-2.4.1 → yutipy-2.4.3}/.github/workflows/release.yml +0 -0
  16. {yutipy-2.4.1 → yutipy-2.4.3}/.gitignore +0 -0
  17. {yutipy-2.4.1 → yutipy-2.4.3}/.readthedocs.yaml +0 -0
  18. {yutipy-2.4.1 → yutipy-2.4.3}/LICENSE +0 -0
  19. {yutipy-2.4.1 → yutipy-2.4.3}/MANIFEST.in +0 -0
  20. {yutipy-2.4.1 → yutipy-2.4.3}/README.md +0 -0
  21. {yutipy-2.4.1 → yutipy-2.4.3}/docs/Makefile +0 -0
  22. {yutipy-2.4.1 → yutipy-2.4.3}/docs/_static/yutipy_header.png +0 -0
  23. {yutipy-2.4.1 → yutipy-2.4.3}/docs/_static/yutipy_logo.png +0 -0
  24. {yutipy-2.4.1 → yutipy-2.4.3}/docs/api_reference.rst +0 -0
  25. {yutipy-2.4.1 → yutipy-2.4.3}/docs/available_platforms.rst +0 -0
  26. {yutipy-2.4.1 → yutipy-2.4.3}/docs/cli.rst +0 -0
  27. {yutipy-2.4.1 → yutipy-2.4.3}/docs/conf.py +0 -0
  28. {yutipy-2.4.1 → yutipy-2.4.3}/docs/faq.rst +0 -0
  29. {yutipy-2.4.1 → yutipy-2.4.3}/docs/index.rst +0 -0
  30. {yutipy-2.4.1 → yutipy-2.4.3}/docs/installation.rst +0 -0
  31. {yutipy-2.4.1 → yutipy-2.4.3}/docs/make.bat +0 -0
  32. {yutipy-2.4.1 → yutipy-2.4.3}/docs/requirements.txt +0 -0
  33. {yutipy-2.4.1 → yutipy-2.4.3}/docs/usage_examples.rst +0 -0
  34. {yutipy-2.4.1 → yutipy-2.4.3}/requirements-dev.txt +0 -0
  35. {yutipy-2.4.1 → yutipy-2.4.3}/setup.cfg +0 -0
  36. {yutipy-2.4.1 → yutipy-2.4.3}/tests/__init__.py +0 -0
  37. {yutipy-2.4.1 → yutipy-2.4.3}/tests/test_deezer.py +0 -0
  38. {yutipy-2.4.1 → yutipy-2.4.3}/tests/test_itunes.py +0 -0
  39. {yutipy-2.4.1 → yutipy-2.4.3}/tests/test_kkbox.py +0 -0
  40. {yutipy-2.4.1 → yutipy-2.4.3}/tests/test_lastfm.py +0 -0
  41. {yutipy-2.4.1 → yutipy-2.4.3}/tests/test_listenbrainz.py +0 -0
  42. {yutipy-2.4.1 → yutipy-2.4.3}/tests/test_lrclib.py +0 -0
  43. {yutipy-2.4.1 → yutipy-2.4.3}/tests/test_models.py +0 -0
  44. {yutipy-2.4.1 → yutipy-2.4.3}/tests/test_musicyt.py +0 -0
  45. {yutipy-2.4.1 → yutipy-2.4.3}/tests/test_spotify.py +0 -0
  46. {yutipy-2.4.1 → yutipy-2.4.3}/tests/test_utils.py +0 -0
  47. {yutipy-2.4.1 → yutipy-2.4.3}/yutipy/__init__.py +0 -0
  48. {yutipy-2.4.1 → yutipy-2.4.3}/yutipy/base_clients.py +0 -0
  49. {yutipy-2.4.1 → yutipy-2.4.3}/yutipy/cli/__init__.py +0 -0
  50. {yutipy-2.4.1 → yutipy-2.4.3}/yutipy/cli/config.py +0 -0
  51. {yutipy-2.4.1 → yutipy-2.4.3}/yutipy/cli/search.py +0 -0
  52. {yutipy-2.4.1 → yutipy-2.4.3}/yutipy/deezer.py +0 -0
  53. {yutipy-2.4.1 → yutipy-2.4.3}/yutipy/exceptions.py +0 -0
  54. {yutipy-2.4.1 → yutipy-2.4.3}/yutipy/itunes.py +0 -0
  55. {yutipy-2.4.1 → yutipy-2.4.3}/yutipy/kkbox.py +0 -0
  56. {yutipy-2.4.1 → yutipy-2.4.3}/yutipy/lastfm.py +0 -0
  57. {yutipy-2.4.1 → yutipy-2.4.3}/yutipy/listenbrainz.py +0 -0
  58. {yutipy-2.4.1 → yutipy-2.4.3}/yutipy/logger.py +0 -0
  59. {yutipy-2.4.1 → yutipy-2.4.3}/yutipy/lrclib.py +0 -0
  60. {yutipy-2.4.1 → yutipy-2.4.3}/yutipy/models.py +0 -0
  61. {yutipy-2.4.1 → yutipy-2.4.3}/yutipy/musicyt.py +0 -0
  62. {yutipy-2.4.1 → yutipy-2.4.3}/yutipy/spotify.py +0 -0
  63. {yutipy-2.4.1 → yutipy-2.4.3}/yutipy/utils/__init__.py +0 -0
  64. {yutipy-2.4.1 → yutipy-2.4.3}/yutipy/yutipy_music.py +0 -0
  65. {yutipy-2.4.1 → yutipy-2.4.3}/yutipy.egg-info/SOURCES.txt +0 -0
  66. {yutipy-2.4.1 → yutipy-2.4.3}/yutipy.egg-info/dependency_links.txt +0 -0
  67. {yutipy-2.4.1 → yutipy-2.4.3}/yutipy.egg-info/entry_points.txt +0 -0
  68. {yutipy-2.4.1 → yutipy-2.4.3}/yutipy.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yutipy
3
- Version: 2.4.1
3
+ Version: 2.4.3
4
4
  Summary: A simple Python package to interact with various music platforms APIs.
5
5
  Author: Cheap Nightbot
6
6
  Author-email: Cheap Nightbot <hi@cheapnightbot.slmail.me>
@@ -25,11 +25,11 @@ Classifier: Operating System :: OS Independent
25
25
  Requires-Python: >=3.9
26
26
  Description-Content-Type: text/markdown
27
27
  License-File: LICENSE
28
- Requires-Dist: pykakasi==2.3.0
29
- Requires-Dist: python-dotenv==1.1.1
30
- Requires-Dist: rapidfuzz==3.13.0
31
- Requires-Dist: requests==2.32.4
32
- Requires-Dist: ytmusicapi==1.10.3
28
+ Requires-Dist: pykakasi>=2.3.0
29
+ Requires-Dist: python-dotenv>=1.1.1
30
+ Requires-Dist: rapidfuzz>=3.13.0
31
+ Requires-Dist: requests>=2.32.5
32
+ Requires-Dist: ytmusicapi>=1.10.3
33
33
  Dynamic: license-file
34
34
 
35
35
  <p align="center">
@@ -6,11 +6,11 @@ build-backend = "setuptools.build_meta"
6
6
  name = "yutipy"
7
7
  dynamic = ["version"]
8
8
  dependencies = [
9
- "pykakasi==2.3.0",
10
- "python-dotenv==1.1.1",
11
- "rapidfuzz==3.13.0",
12
- "requests==2.32.4",
13
- "ytmusicapi==1.10.3",
9
+ "pykakasi>=2.3.0",
10
+ "python-dotenv>=1.1.1",
11
+ "rapidfuzz>=3.13.0",
12
+ "requests>=2.32.5",
13
+ "ytmusicapi>=1.10.3",
14
14
  ]
15
15
  requires-python = ">= 3.9"
16
16
  authors = [
@@ -0,0 +1,5 @@
1
+ pykakasi>=2.3.0
2
+ python-dotenv>=1.1.1
3
+ RapidFuzz>=3.13.0
4
+ requests>=2.32.5
5
+ ytmusicapi>=1.10.3
@@ -10,6 +10,18 @@ kakasi = pykakasi.kakasi()
10
10
  TRANSLATION_CACHE = {}
11
11
 
12
12
 
13
+ def clear_translation_cache(limit: int = 25):
14
+ """
15
+ Clear the translation cache if it reaches provided limit.
16
+
17
+ Args:
18
+ limit (int, optional): The maximum limit of items in translation cache. Default is `25`.
19
+ """
20
+ items = len(TRANSLATION_CACHE)
21
+ if items >= limit:
22
+ TRANSLATION_CACHE.clear()
23
+
24
+
13
25
  def similarity(str1: str, str2: str, threshold: int = 100):
14
26
  similarity_score = fuzz.WRatio(str1, str2, processor=default_process)
15
27
  return similarity_score >= threshold
@@ -97,6 +109,8 @@ def are_strings_similar(
97
109
  a. if both same, return True.
98
110
  4. return False.
99
111
  """
112
+ # Clear translation cache if limit reached
113
+ clear_translation_cache()
100
114
 
101
115
  # ### Step 0 ####
102
116
  cached_str1 = TRANSLATION_CACHE.get(str1, str1)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yutipy
3
- Version: 2.4.1
3
+ Version: 2.4.3
4
4
  Summary: A simple Python package to interact with various music platforms APIs.
5
5
  Author: Cheap Nightbot
6
6
  Author-email: Cheap Nightbot <hi@cheapnightbot.slmail.me>
@@ -25,11 +25,11 @@ Classifier: Operating System :: OS Independent
25
25
  Requires-Python: >=3.9
26
26
  Description-Content-Type: text/markdown
27
27
  License-File: LICENSE
28
- Requires-Dist: pykakasi==2.3.0
29
- Requires-Dist: python-dotenv==1.1.1
30
- Requires-Dist: rapidfuzz==3.13.0
31
- Requires-Dist: requests==2.32.4
32
- Requires-Dist: ytmusicapi==1.10.3
28
+ Requires-Dist: pykakasi>=2.3.0
29
+ Requires-Dist: python-dotenv>=1.1.1
30
+ Requires-Dist: rapidfuzz>=3.13.0
31
+ Requires-Dist: requests>=2.32.5
32
+ Requires-Dist: ytmusicapi>=1.10.3
33
33
  Dynamic: license-file
34
34
 
35
35
  <p align="center">
@@ -0,0 +1,5 @@
1
+ pykakasi>=2.3.0
2
+ python-dotenv>=1.1.1
3
+ rapidfuzz>=3.13.0
4
+ requests>=2.32.5
5
+ ytmusicapi>=1.10.3
@@ -1,5 +0,0 @@
1
- pykakasi==2.3.0
2
- python-dotenv==1.1.1
3
- RapidFuzz==3.13.0
4
- requests==2.32.4
5
- ytmusicapi==1.10.3
@@ -1,5 +0,0 @@
1
- pykakasi==2.3.0
2
- python-dotenv==1.1.1
3
- rapidfuzz==3.13.0
4
- requests==2.32.4
5
- ytmusicapi==1.10.3
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
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
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes