简单的蟒蛇3你好世界

RegexTagForMusic的Python项目详细描述


Build StatusGithubPyPiPython

regextagformusic

regextagformusic是一个标记mp3文件的工具,使用regular expressions提取id3标记文件路径。换句话说,如果路径与regex匹配,则可以将任何匹配的组用作id3标记

我最初开发了regextagformusic来使用eyeD3自动标记我的音乐。id3标记是一些元数据,就像您在文件系统中存储文件一样,所以我想要一种同步文件系统中标记的方法:

  • album字段是文件的父文件夹
  • artist字段album文件夹的父文件夹
  • trackNumber字段是文件名的第一个数字
  • title字段是文件名的其余部分

安装

您可以使用pip从PyPI直接安装regextagformusic

# Ensure pip is installed on the system
$ sudo apt install python3-pip
# You can install just for the current user
$ pip install --user RegexTagForMusic
# Or install it for all users
$ sudo pip install RegexTagForMusic

您还可以从以下来源构建regextagformusic

$ git clone https://github.com/essembeh/RegexTagForMusic
$ cd RegexTagForMusic
$ make
$ pip install --user dist/RegexTagForMusic-*.whl

试试看

the default configuration filesamples documentation

$ cd samples/config/default
$ tree

tree

现在,使用配置文件中的筛选器验证是否可以识别所有文件:

$ rtfm --config ../default.json

list

还要检查过滤器中声明的所有属性:

$ rtfm --config ../default.json --verbose

list-verbose

命令^ {< CD1>}验证MP3文件中现有的标记与从文件路径提取的属性匹配:

$ rtfm --config ../default.json -x check

check

在我们的示例中,文件尚未标记,因此我们将标记它们:

$ rtfm --config ../default.json -x tag

tag

clean操作删除文件中的所有标记:

$ rtfm --config ../default.json -x clean

clean

命令行选项和参数

$ rtfm --help
usage: rtfm [-h] [-v] [-c CONFIG] [-l LIBRARY] [-r ROOT] [--folders]
            [-x ACTION] [-n] [--continue]
            [FILE [FILE ...]]

Simple hello world python sample

positional arguments:
  FILE                  files to process

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         be more verbose
  -c CONFIG, --config CONFIG
                        configuration file (default:
                        ~/.config/rtfm.json
  -l LIBRARY, --library LIBRARY
                        library file
  -r ROOT, --root ROOT  make all paths relative to given folder (default is
                        current folder, $PWD)
  --folders             also process folders
  -x ACTION, --execute ACTION
                        action to perform
  -n, --dryrun          dryrun mode, do not modify files
  --continue            continue in case of error

配置文件

sample configuration filessamples documentation

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

推荐PyPI第三方库


热门话题
java两个构造函数?   java for(inti:x)做什么?   java如何将一个bean的构造函数参数传递给嵌套bean   java从易趣链接提取项目ID   java多线程BufferedReader   安卓全新应用程序在R.java中抛出“语法错误,插入“}”以完成类体”   java Spring启动依赖注入请求范围的bean   java给定的时间,然后约定和异常处理。和莫基托和朱尼特在一起   与Android Studio的java Oracle数据库连接   在web服务器(Heroku)上承载可运行jar文件(Discord bot)的java   java如何每隔n秒在imageview中更改图像   java不理解“volatile”关键字   java使用JPA编写自定义SQL查询   java如何使用filechannel作为参数来编写对象