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刷新系统。用自己的记录器输出   使用Jython将参数从Java传递到Python   JavaSocksV4代理   java如何使用通知?   java@DirtiesConext不工作   java将多个jar组合成一个(使用maven)   java使用相等运算符比较两个类   java我怎样才能让两个JOptionPane一起出现在我的第一页上,并让它们在两个页面上都有正确的答案?   html无法访问java中资产文件夹内的文件   通过post命令向SpringWebApp发送对象时,java对象字段为null   单个实例中静态变量的类更改值(Java)   java解决方案是什么   试图检查网站所有受支持的密码套件的安全性,在java中遇到chacha20和poly1035问题