Skip to content

Commit 25f4bab

Browse files
committed
remove youtube services
1 parent 7ae334d commit 25f4bab

21 files changed

+48
-886
lines changed

README.md

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575

7676
## What is [MagicalAPI][website-url]?
7777

78-
MagicalAPI is your AI edge in **content** and **careers**, Your ultimate tool for **YouTube SEO**, **Resume Parsing**, **LinkedIn data** and more.
78+
MagicalAPI is your AI edge in **content** and **careers**, Your ultimate tool for **Resume Parsing**, **LinkedIn data** and more.
7979

8080
<br>
8181

@@ -149,44 +149,43 @@ client = AsyncClinet()
149149

150150
<br>
151151

152-
Here is an example of how to get keywords of [Youtube Top Keywords](https://magicalapi.com/services/youtube-keywords) service:
152+
Here is an example of how to parse a resume using [Resume Parser](https://magicalapi.com/resume/) service:
153153

154154
```python
155155
import asyncio
156+
156157
from magicalapi.client import AsyncClient
158+
from magicalapi.errors import APIServerError, APIServerTimedout
157159
from magicalapi.types.base import ErrorResponse
158160

159-
search_sentence = "chatgpt 4 turbo" # your search sentence to get keywords related to
160-
country = "1" # use get_countries method to see countries codes (Default = 1 : WorlWide)
161-
language = "1000" # use get_languages method to see countries codes (Default = 1000 : English)
161+
resume_url = (
162+
"https://resume-resource.com/wp-content/uploads/00123-sales-professional-resume.pdf"
163+
)
164+
output_file_name = "resume_parser.json"
162165

163166

164167
async def main():
165-
# the api_key will load from the .env file
166-
async with AsyncClient() as client:
167-
# Get YouTube keywords
168-
keywords_response = await client.youtube_top_keywords.get_keywords(
169-
search_sentence=search_sentence,
170-
country=country,
171-
language=language,
172-
)
173-
if type(keywords_response) == ErrorResponse:
174-
# got error from API
175-
print("Error :", keywords_response.message)
176-
else:
177-
# got response successfully
178-
print("credits :", keywords_response.usage.credits)
179-
print("keywords count :", len(keywords_response.data.keywords))
180-
181-
# save response in JSON file
182-
with open("keywords_response.json", "w") as file:
183-
file.write(keywords_response.model_dump_json(indent=3))
184-
185-
186-
# get languages list
187-
# languages = await client.youtube_top_keywords.get_languages()
188-
# get countries list
189-
# countries = await client.youtube_top_keywords.get_countries()
168+
try:
169+
# the api_key will load from the .env file
170+
async with AsyncClient() as client:
171+
response = await client.resume_parser.get_resume_parser(url=resume_url)
172+
173+
if isinstance(response, ErrorResponse):
174+
# got error from api
175+
print("Error :", response.message)
176+
else:
177+
# got response successfully
178+
print("credists :", response.usage.credits)
179+
# save response in json file
180+
with open(output_file_name, "w") as file:
181+
file.write(response.model_dump_json(indent=3))
182+
183+
print(f"response saved to {output_file_name}")
184+
except (APIServerError, APIServerTimedout) as e:
185+
# handling server errors
186+
print(e)
187+
except Exception as e:
188+
print("An error occurred:", str(e))
190189

191190

192191
asyncio.run(main())

examples/youtube_seo.py

Lines changed: 0 additions & 35 deletions
This file was deleted.

examples/youtube_suggestions.py

Lines changed: 0 additions & 41 deletions
This file was deleted.

examples/youtube_top_keywords.py

Lines changed: 0 additions & 51 deletions
This file was deleted.

magicalapi/client.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
ProfileDataService,
88
ResumeParserService,
99
ResumeScoreService,
10-
YoutubeSeoService,
11-
YoutubeSuggestionsService,
12-
YoutubeTopKeywordsService,
1310
)
1411
from magicalapi.services.resume_review_service import ResumeReviewService
1512
from magicalapi.settings import settings
@@ -58,18 +55,11 @@ def __init__(self, api_key: str | None = None) -> None:
5855
logger.debug("httpx client created")
5956

6057
# create service
61-
self.youtube_top_keywords = YoutubeTopKeywordsService(
62-
httpx_client=self._httpx_client
63-
)
6458
self.profile_data = ProfileDataService(httpx_client=self._httpx_client)
6559
self.company_data = CompanyDataService(httpx_client=self._httpx_client)
66-
self.youtube_seo = YoutubeSeoService(httpx_client=self._httpx_client)
6760
self.resume_parser = ResumeParserService(httpx_client=self._httpx_client)
6861
self.resume_score = ResumeScoreService(httpx_client=self._httpx_client)
6962
self.resume_review = ResumeReviewService(httpx_client=self._httpx_client)
70-
self.youtube_suggestions = YoutubeSuggestionsService(
71-
httpx_client=self._httpx_client
72-
)
7363

7464
logger.debug(f"async client created : {self}")
7565

magicalapi/services/__init__.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,11 @@
33
from .resume_parser_service import ResumeParserService
44
from .resume_review_service import ResumeReviewService
55
from .resume_score_service import ResumeScoreService
6-
from .youtube_seo_service import YoutubeSeoService
7-
from .youtube_suggestions_service import YoutubeSuggestionsService
8-
from .youtube_top_keywords_service import YoutubeTopKeywordsService
96

107
__all__ = [
11-
"YoutubeTopKeywordsService",
128
"ProfileDataService",
139
"CompanyDataService",
14-
"YoutubeSeoService",
1510
"ResumeParserService",
1611
"ResumeScoreService",
1712
"ResumeReviewService",
18-
"YoutubeSuggestionsService",
1913
]

magicalapi/services/youtube_seo_service.py

Lines changed: 0 additions & 36 deletions
This file was deleted.

magicalapi/services/youtube_suggestions_service.py

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)