Skip to main content

THIS PROJECT HAS MIGRATED TO RUST, CHECK OUT SongParse, A LIBRARY AND CLI TOOL WRITTEN IN RUST

audiodotturn 0.5.5

General tool/library for extracting simple metadata and producing new file formats from only a filename(s).

Metadata can be catalogued and viewed via a sql database created by audiodotturn

Extraction and construction reports can be generated in multiple file formats.

INSTALLATION

    pip install audiodotturn

CONFIGURATION

User configuration settings can be set in a config.ini file placed in one of the following locations

  • ~/.config/audiodotturn/config.ini,
  • ~/config/audiodotturn/config.ini,
  • ~/audiodotturn/config.ini,
  • ~/.audiodotturn/config.ini,

User Configuration options shown below

    [DATABASE]
    path = <DATABASE PATH>

    [PROGRAM]
    exts = <COMMA SEPERATED LIST OF EXTS ie. .mp3, .mp4, .wav>
    dry = <True/False>

To make sure the config settings are loaded correctly you can run adt -s to get an overview of the current settings being used

Dependencies

External libraries:

Standard:

  • os
  • typing
  • datetime
  • sqlite3
  • re
  • json
  • argparse
  • shutil

USAGE

The extract, construct, and database modules are non-dependent on any other part of the program

Rich is only neccessary for use with the adt module or run module. The run module will soon be non-dependent on rich. It is only used for better user experience.

Refer to USAGE

EXAMPLES

Refer to EXAMPLES

Choosing a constructor

  • "simple": This will produce several file options formatted as a standard audio track ie. Artist - Title ft. Feat (etc etc).mp3
  • "enclosed": This will produce several file options formatted as an enclosed file name ie. (Artist)(Title)(Feat)(etc)(yt-id).mp3

Creating a database

Database path is set in config or during runtime.

A new database will be created upon the first database update.

Increased database funcitonality can be obtained through importing adt as a library. See examples in EXAMPLES

License

MIT

This project is licensed under the MIT License. See the LICENSE file for more info.

GENERAL

    usage: adt [-h] [-v] [-p CFGPATH] [-d DBPATH] [-s] {extract,construct,database} ...

    Format, organize and retrieve data from audio files.

    positional arguments:
    {extract,construct,database}
        extract             Extraction commands
        construct           Construction commands
        database            Database commands

    options:
    -h, --help            show this help message and exit
    -v, --version         Show current version of audiodotturn
    -p CFGPATH, --cfgpath CFGPATH
                            Path to a specific configuration file to use for the session.
    -d DBPATH, --dbpath DBPATH
                            Path to .db file for library database
    -s, --settings        Show current settings

EXTRACT

    usage: adt extract [-h] [-o OUT] [-f FILE] [-m MULTI [MULTI ...]] [-l DIR]

    options:
    -h, --help            show this help message and exit
    -o OUT, --out OUT     Output format for extraction, default is dict.
    -f FILE, --file FILE  Extract info from single file.
    -m MULTI [MULTI ...], --multi MULTI [MULTI ...]
                            Extract info from multiple files.
    -l DIR, --dir DIR     Extract info from files in a directory.

CONSTRUCT

    usage: adt construct [-h] [-a] [-c CONSTRUCTOR] [-f FILE] [-m MULTI [MULTI ...]]

    options:
    -h, --help            show this help message and exit
    -a, --auto            Set auto-choice
    -c CONSTRUCTOR, --constructor CONSTRUCTOR
                            Constructor to use
    -f FILE, --file FILE  Construct from a single file
    -m MULTI [MULTI ...], --multi MULTI [MULTI ...]
                            Construct from multiple files

DATABASE

    usage: adt database [-h] [-f UPDATEFILE] [-m UPDATEMULTI [UPDATEMULTI ...]] [-A] [-S] [-Ai ARTISTID] [-Si SONGID]

    options:
    -h, --help            show this help message and exit
    -f UPDATEFILE, --updatefile UPDATEFILE
                            Update database via file.
    -m UPDATEMULTI [UPDATEMULTI ...], --updatemulti UPDATEMULTI [UPDATEMULTI ...]
                            Update database via multiple files.
    -A, --artists         View all artists within the database
    -S, --songs           View all songs by each artist within the database
    -Ai ARTISTID, --artistid ARTISTID
                            View songs by artist id
    -Si SONGID, --songid SONGID
                            View song by song id

audiodotturn package basic usage

EXTRACTING AND CONSTRUCTING

    import audiodotturn

    file = 'turn (ft. tester) "long john" ft. me, turner.wav'

    files = [
        'turn (ft. tester) "long john" ft. me, turner.wav',
        'YG Feat. Dj Mustard "Pop It, Shake It" (Uncut) (WSHH Exclusive - Official Music Video) [kQ2KSPz4iSw].wav',
        'Lady Gaga, Ariana Grande - Rain On Me (Official Music Video) [AOm9Fv8NTG0].mp3'
    ]

    audiodotturn = audiodotturn.AudioDotTurn()
    extraction = audiodotturn.extract_file(file)
    extractions = audiodotturn.extract_files(files)

    for extract in extraction:
        print('extraction single:\n', extract, '\n')

    for extract in extractions:
        print('extraction:\n', extract, '\n')

    constructions = audiodotturn.construct("enclosed", extraction, auto=False)
    auto_constructions = audiodotturn.construct("simple", extractions, auto=True)

    print(constructions, '\n')
    print(auto_constructions, '\n')

EXTRACTION IN DESIRED FORMAT

    from rich.pretty import pprint
    import audiodotturn

    file = 'turn (ft. tester) "long john" ft. me, turner.wav'

    adt_runner = audiodotturn.AudioDotTurn()
    adt_runner.extract_file(file)

    _dict = adt_runner.extractor.get_extraction("dict")
    _yaml = adt_runner.extractor.get_extraction("yaml")
    _str = adt_runner.extractor.get_extraction("str")
    _values = adt_runner.extractor.get_extraction("values")

UPDATING DATABASE

    from rich.pretty import pprint
    from rich.console import Console
    import audiodotturn

    console = Console()

    file = 'turn (ft. tester) "long john" ft. me, turner.wav'

    adt_runner = audiodotturn.AudioDotTurn()
    extraction = adt_runner.extract_file(file)

    adt_runner.update_database(extraction)

    artists = adt_runner.get_all_artists()

    for artist in artists:
        print(artist["artist_id"])
        print(artist["name"])

    # The above produces:
    #
    # 1
    # turn

Metadata

Release files for audiodotturn 0.5.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for audiodotturn 0.5.5
File Size Uploaded
audiodotturn-0.5.5.tar.gz 20.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for audiodotturn 0.5.5
File Interpreter ABI Platform
audiodotturn-0.5.5-py3-none-any.whl Python 3 none any Details

Total release size: 41.7 kB

Release files / audiodotturn-0.5.5.tar.gz

Download URL audiodotturn-0.5.5.tar.gz
Size 20.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ad3c0885a1ac82754abff83e073d65880023ba6a0a99df32103ce45631560a90
BLAKE2b-256 checksum
How to use checksums
54c7fb8fe018cf2430d1e22cdbbee79a35c622f87aaeba60262dc947021da2ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Release files / audiodotturn-0.5.5-py3-none-any.whl

Download URL audiodotturn-0.5.5-py3-none-any.whl
Size 21.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
656b28a50797938d4aab2753990444ce2a765be553704170f12523d13fd9f48e
BLAKE2b-256 checksum
How to use checksums
9f92fd1df41c6d498710a46979ba0b02b1dd86283ac839bf6b5f1a82b8d308df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Release history Release notifications | RSS feed

This release

0.5.5 This release

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.0

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page