www.metal-archives.com的python api

python-metallum的Python项目详细描述


python metallum

一个基本的python api,用于惊人的www.metal-archives.com

安装

pip install python-metallum

用法

艺术家搜索

importmetallum# Search bands matching termbands=metallum.band_search('metallica')# -> [<SearchResult: Metallica | Thrash Metal (early), Hard Rock/Heavy/Thrash Metal (later) | United States>]bands[0].name# -> 'Metallica'# Fetch band pageband=bands[0].get()# Get all albumsband.albums# -> [<Album: No Life 'til Leather (Demo)>, <Album: Kill 'Em All (Full-length)>, ...]# Get only full-length albumsfull_length=band.albums.search(type=metallum.AlbumTypes.FULL_LENGTH)# -> [<Album: Kill 'Em All (Full-length)>, <Album: Ride the Lightning (Full-length)>, <Album: Master of Puppets (Full-length)>, <Album: ...and Justice for All (Full-length)>, <Album: Metallica (Full-length)>, <Album: Load (Full-length)>, <Album: ReLoad (Full-length)>, <Album: Garage Inc. (Full-length)>, <Album: St. Anger (Full-length)>, <Album: Death Magnetic (Full-length)>, <Album: Hardwired... to Self-Destruct (Full-length)>]album=full_length[2]album.title# -> 'Master of Puppets'album.date# -> datetime.datetime(1986, 3, 3, 0, 0)# Get all tracksalbum.tracks# -> [<Track: Battery (313)>, <Track: Master of Puppets (516)>, <Track: The Thing That Should Not Be (397)>, <Track: Welcome Home (Sanitarium) (388)>, <Track: Disposable Heroes (497)>, <Track: Leper Messiah (341)>, <Track: Orion (508)>, <Track: Damage, Inc. (330)>]

唱片集搜索

importmetallum# Search albums matching termmetallum.album_search('seventh')# -> []# Search albums containing termmetallum.album_search('seventh',strict=False)# -> [<SearchResult: Beherit | Seventh Blasphemy | Demo>, <SearchResult: Black Sabbath | Seventh Star | Full-length>, ...]# Search albums by bandmetallum.album_search('seventh',band='iron maiden',strict=False)# -> [<SearchResult: Iron Maiden | Seventh Son of a Seventh Son | Full-length>]

有关详细用法,请参阅源代码和文档测试

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何通过解决错误“活动无法转换为片段”将片段传递给类构造函数?   Java中清理Code39条码数据的regex帮助   将java转换为C++   java无法在Android Studio中生成签名的apk,出现错误   从数学方程出发   MySQL和Java内存问题   如何强制Java抛出算术异常?   java为什么JDBC将零端口视为空(默认)端口?   java如何在没有“changelog主题”的情况下加入KStream和KTable   排序我尝试合并两个排序的数组,但得到的是java。lang.ArrayIndexOutofBounds异常:5无法找出原因   如何在java中求大长度矩阵的逆?   基于maven构建的java生成类路径字符串   java每20个字符分割一个字符串,然后将每个部分打印到控制台   将字符串数字字转换为字符串数字:Java   在特定区域使用混合类型的java填充字节数组   尽管java类在开关块中实例化,但它只能调用接口方法