python的Mutagen模块简介

准备打算做一个项目,可能用到这个模块,就先照搬官网,做个翻译

官网地址:https://mutagen.readthedocs.io/en/latest/

Mutagen is a Python module to handle audio metadata. It supports ASF, FLAC, MP4, Monkey’s Audio, MP3, Musepack, Ogg Opus, Ogg FLAC, Ogg Speex, Ogg Theora, Ogg Vorbis, True Audio, WavPack, OptimFROG, and AIFF audio files. All versions of ID3v2 are supported, and all standard ID3v2.4 frames are parsed. It can read Xing headers to accurately calculate the bitrate and length of MP3s. ID3 and APEv2 tags can be edited regardless of audio format. It can also manipulate Ogg streams on an individual packet/page level.

Mutagen works with Python 2.7, 3.4+ (CPython and PyPy) on Linux, Windows and macOS, and has no dependencies outside the Python standard library. Mutagen is licensed under the GPL version 2 or later.

 Mutagen是用于处理音频元数据的python模块。它支持ASF、FLAC、MP4、Monkey’s Audio、MP3、Musepack、Ogg Opus、Ogg FLAC、Ogg Speex、Ogg Theora、Ogg Vorbis、True Audio、WavPack、OptimFROG和AIFF 音频文件。 支持所有版本的ID3v2和能解释所有标准的ID3v2框架。它能读取Xing头部信息来精确计算MP3文件的比特率和长度。无论哪种音频格式的ID3和APEv2标签都可以编辑。它还能在独立包层面修改Ogg格式流。

Mutagen兼容linux、windows和macOS平台上的Python 2.7, 3.4+ (CPython and PyPy),需要python标准库的支持。Mutagen遵守GPL2及之后的协议。

 

Installing

安装

pip install mutagen

or 或者

sudo apt-get install python-mutagen python3-mutagen

Where do I get it?

Mutagen is hosted on GitHub. The download page or PyPI will have the latest version or check out the git repository:

$ git clone https://github.com/quodlibet/mutagen.git

Why Mutagen?

Quod Libet has more strenuous requirements in a tagging library than most programs that deal with tags. Therefore we felt it was necessary to write our own.

  • Mutagen has a simple API, that is roughly the same across all tag formats and versions and integrates into Python’s builtin types and interfaces.
  • New frame types and file formats are easily added, and the behavior of the current formats can be changed by extending them.
  • Freeform keys, multiple values, Unicode, and other advanced features were considered from the start and are fully supported.
  • All ID3v2 versions and all ID3v2.4 frames are covered, including rare ones like POPM or RVA2.
  • We take automated testing very seriously. All bug fixes are committed with a test that prevents them from recurring, and new features are committed with a full test suite.

为什么选择Mutagen

Quod Libet比其它程序有更多的处理标签的需求。因此我们觉得有必要自己写一个模块。

1、Mutagen有一个简单的API,几乎对标签格式和版本都一样,并整合进了python的内建类别和界面。

New frame types and file formats are easily added, and the behavior of the current formats can be changed by extending them.

2、新的框架和文件格式可以很容易就被添加进文件,且可以很容易通过扩展修改当前的格式

Freeform keys, multiple values, Unicode, and other advanced features were considered from the start and are fully supported.

3、完全支持任意形式的键值、复数的数值、编码和其它高级特性

All ID3v2 versions and all ID3v2.4 frames are covered, including rare ones like POPM or RVA2.

4、覆盖所有版本的ID3v2标签和所有ID3v2.4框架,包括不常见的POPM或者RVA2

We take automated testing very seriously. All bug fixes are committed with a test that prevents them from recurring, and new features are committed with a full test suite.

5、我们对待自动化测试很认真。所有bug的修复都会经过测试,以防再次出现。新功能推出前都要经过一整套测试。

你可能感兴趣的:(python,翻译)