Skip to content

pythoninthegrass/m3uprsr

 
 

Repository files navigation

m3u_prsr

Parses an M3U playlist file into a list of track objects.

Builds on the excellent work of dvndrsn's M3uParser.

Setup

Quickstart

# setup virtual environment
python -m venv .venv
source .venv/bin/activate

# install
python -m pip install m3u-prsr

# run
m3u-prsr ./tests/fixtures/test.m3u

Development

  • Setup environment
    # install dependencies
    poetry install
    
    # activate virtual environment
    poetry shell
  • Run script
    # run against the example m3u file
    λ app/main.py tests/fixtures/test.m3u
    Minus The Bear - Burying Luck.mp3 (0s)
    Minus The Bear - Ice Monster.mp3 (0s)
    Minus The Bear - Knights.mp3 (0s)
    Minus The Bear - White Mystery.mp3 (0s)
    Minus The Bear - Dr. l'Ling.mp3 (0s)
    Minus The Bear - Part 2.mp3 (0s)
    Minus The Bear - Throwin' Shapes.mp3 (0s)
    Minus The Bear - When We Escape.mp3 (0s)
    Minus The Bear - Double Vision Quest.mp3 (0s)
    Minus The Bear - Lotus.mp3 (0s)
    Parsed 10 tracks from ../tests/fixtures/test.m3u
    
  • Testing
    # generate tests
    cd app/
    hypothesis write main.parsem3u > ../tests/test_m3u_prsr.py
    
    # run specific test
    pytest -k test_m3u_prsr
    
    # install from testpypi
    pip install -i https://test.pypi.org/simple/ m3u-prsr

TODO

  • Issues
  • Button up error handling for internal field separators on m3u track names
  • Tests
  • CI/CD

Further Reading

The M3U File Format « The Matthew Nielsen Web Experience

Repositories | Documentation | Poetry - Python dependency management and packaging made easy

How to Build and Publish Python Packages With Poetry

Packaging your Python Project

python - Use poetry to create binary distributable with pyinstaller on package? - Stack Overflow

poetry publish raises HTTP 403 · Issue #6320 · python-poetry/poetry

Tips and Tricks - Test and publish your Python packages to PyPI with poetry and GitHub Actions | TestDriven.io

About

A simple program in Python to parse M3U playlist files

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 59.9%
  • Shell 40.1%