读取ID3标签的最佳库是什么? [英] What is the best library for reading ID3 tags?

查看:93
本文介绍了读取ID3标签的最佳库是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前哪个图书馆是最全面,功能最强大的ID3标签阅读图书馆?最好是我可以将其编译为共享库,并用Python的ctypes库甚至Python包包装的东西.

What library is presently the most thorough and capable ID3 tag reading library available? Preferably something I can compile as a shared library and wrap with Python's ctypes library, or even a Python package.

推荐答案

我很高兴使用诱变(教程: http://code.google.com/p/mutagen/wiki/Tutorial ) -获取信息非常简单.请注意,您应该使用Easy ID3选项.

I've had a good time using mutagen (tutorial: http://code.google.com/p/mutagen/wiki/Tutorial) - it's quite simple to get the info. Note that you should use the Easy ID3 option.

>>> from glob import glob
>>> from mutagen.easyid3 import EasyID3
>>> for filename in glob('/home/jon/Downloads/*.mp3'):
    mp3info = EasyID3(filename)
    print mp3info.items()


[('artist', [u"James O'Brien's Mystery Hour"]), ('title', [u"James O'Brien's Mystery Hour - 7 Dec 12"])]

这篇关于读取ID3标签的最佳库是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆