Git Product home page Git Product logo

cueparser's Introduction

PyPI version shields.io

CueParser

Simple cue file parser and generator written in python. Parser outputs cue file content in plain text. Generator can create cue file from timed tracklist.

Installation

$ pip install CueParser

Usage

usage: cueparser.py [-h] [-H HEADER] [-t TRACK] file
positional arguments:
  file                  path to cue file

optional arguments:
  -h, --help            show this help message and exit
  -H HEADER, --header HEADER
                        header output template
  -t TRACK, --track TRACK
                        track output template
usage: cuegen.py [-h] [-p PERFORMER] [-t TITLE] [-a AUDIO_FILE] [-e AUDIO_FILE_EXT] [-f FILE]
options:
  -h, --help            show this help message and exit
  -p PERFORMER, --performer PERFORMER
                        PERFORMER
  -t TITLE, --title TITLE
                        TITLE
  -a AUDIO_FILE, --audio_file AUDIO_FILE
                        FILE
  -e AUDIO_FILE_EXT, --audio_file_ext AUDIO_FILE_EXT
                        FILE EXTENSION
  -f FILE, --file FILE  path to tracklist file

Example

$ cueparser.py file.cue

will output content with such template:

  • for header: %performer% - %title%\n%file%\n%tracks% (also can be %format%, %rem%, %songwriter%)
  • for tracks: %performer% - %title% (also can be %cuetime%, %offset%, %index%, %songwriter%)

$ cuegen.py -f file.txt

will create cue file from tracklist looks like:

[00:00] Artist 1 - Title 1

[03:00] Artist 2 - Title 2

etc...

Library example

cuesheet = CueSheet()
cuesheet.setOutputFormat(args.header, args.track)
with open(cuefile, "r") as f:
    cuesheet.setData(f.read())

cuesheet.parse()
print(cuesheet.output())

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.