-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from dotX12/dev
[MASTER] - Fix about artist
- Loading branch information
Showing
44 changed files
with
989 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,41 @@ | ||
import asyncio | ||
from pprint import pprint | ||
|
||
from shazamio import Shazam, Serialize | ||
from shazamio.schemas.artists import ArtistQuery | ||
from shazamio.schemas.enums import ArtistExtend | ||
from shazamio.schemas.enums import ArtistView | ||
|
||
|
||
async def main(): | ||
shazam = Shazam() | ||
artist_id = 43328183 | ||
about_artist = await shazam.artist_about(artist_id) | ||
serialized = Serialize.artist(about_artist) | ||
shazam = Shazam(language="ES") | ||
artist_id = 1124753799 | ||
# extend: artistBio,bornOrFormed,editorialArtwork,origin | ||
# views: full-albums,featured-albums,latest-release,top-music-videos,similar-artists, | ||
# top-songs,playlists | ||
|
||
about_artist = await shazam.artist_about( | ||
artist_id, | ||
query=ArtistQuery( | ||
views=[ | ||
ArtistView.FULL_ALBUMS, | ||
ArtistView.FEATURED_ALBUMS, | ||
ArtistView.LATEST_RELEASE, | ||
ArtistView.TOP_MUSIC_VIDEOS, | ||
ArtistView.SIMULAR_ARTISTS, | ||
], | ||
extend=[ | ||
ArtistExtend.ARTIST_BIO, | ||
ArtistExtend.BORN_OF_FORMED, | ||
ArtistExtend.EDITORIAL_ARTWORK, | ||
ArtistExtend.ORIGIN, | ||
], | ||
), | ||
) | ||
print(about_artist) # dict | ||
print(serialized) # serialized from dataclass factory | ||
serialized = Serialize.artist_v2(about_artist) | ||
pprint(serialized) # serialized from pydantic | ||
|
||
|
||
loop = asyncio.get_event_loop() | ||
loop = asyncio.get_event_loop_policy().get_event_loop() | ||
loop.run_until_complete(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.