Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Simple python3 hello world

Project description

Build Status Github PyPi Python

RegexTagForMusic

RegexTagForMusic is a tool to tag mp3 files using regular expressions to extract ID3 tags the the file path. In other words, if the path matches a regex, you can use any matching group as ID3 tag.

I originally developed RegexTagForMusic to automatize tagging my music using eyeD3. ID3 tags are some metadata just like the way you store your files on your filesystem so I wanted a way to synchronize tags from the filesystem:

  • the album field is the parent folder of the file
  • the artist field is the parent folder of the album folder
  • the tracknumber field is the first digit of the filename
  • the title field is the rest of the filename

Install

You can install RegexTagForMusic directly from PyPI using pip:

# 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

You can also build RegexTagForMusic from the sources:

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

Try it

See the default configuration file and samples documentation.

$ cd samples/config/default
$ tree

tree

Now verify that all the files are recognized using the filters from the configuration file:

$ rtfm --config ../default.json

list

Also check all the properties declared in the filters:

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

list-verbose

The command check verifies that the existing tags in the mp3 files are matching the properties extracted from the file path:

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

check

In our example, the files are not tagged yet, so le's tag them:

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

tag

The clean action removes all the tags present in the files:

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

clean

Command line options and arguments

$ 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

Configuration file

See sample configuration files and samples documentation

Project details


Release history Release notifications

This version

5.0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for RegexTagForMusic, version 5.0.1
Filename, size File type Python version Upload date Hashes
Filename, size RegexTagForMusic-5.0.1-py3-none-any.whl (19.9 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size RegexTagForMusic-5.0.1.tar.gz (548.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page