Metadata-Version: 2.4
Name: pylibcue
Version: 0.5.1
Summary: CUE sheet parser library for Python.
Author-email: Cycloctane <Cycloctane@octane.top>
License-Expression: GPL-2.0-only
Project-URL: Homepage, https://github.com/Cycloctane/pylibcue
Project-URL: Repository, https://github.com/Cycloctane/pylibcue.git
Project-URL: Changelog, https://github.com/Cycloctane/pylibcue/blob/main/CHANGELOG.rst
Keywords: cue,libcue,cuetools,audio,music,cd,metadata
Classifier: Development Status :: 4 - Beta
Classifier: Topic :: Utilities
Classifier: Topic :: Multimedia
Classifier: Topic :: Multimedia :: Sound/Audio :: CD Audio
Classifier: Topic :: Multimedia :: Sound/Audio :: CD Audio :: CD Ripping
Classifier: Topic :: Software Development :: Libraries
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Cython
Classifier: Programming Language :: C
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Requires-Python: >=3.10
Description-Content-Type: text/x-rst
License-File: COPYING
License-File: vendor/libcue/LICENSE
Dynamic: license-file

pylibcue
========

pylibcue is a CUE sheet parser library for python. It provides fast and reliable
CUE sheets parsing interfaces for python by wrapping `libcue
<https://github.com/lipnitsk/libcue>`_ C library with Cython.

*Note:* since v0.2.1, pylibcue uses libcue fork with custom patches (`Cycloctane/libcue
<https://github.com/Cycloctane/libcue>`_) instead of original libcue to provide
additional bugfixes and features.

Install
-------

.. code-block:: bash

    pip install pylibcue

Compile from source
^^^^^^^^^^^^^^^^^^^

Requirements: bison, flex, make.

Clone the repo with ``--recurse-submodules`` argument.

.. code-block:: bash

    pip install --upgrade setuptools Cython build
    make test
    make

Usage
-----

Create a CD instance by parsing a CUE sheet file or string:

.. code-block:: python

    import pylibcue

    cd = pylibcue.parse_file("./example.cue", encoding="utf-8")
    # or
    cd = pylibcue.parse_str("...")

Extract CD metadata and iterate through tracks in CD:

.. code-block:: python

    print("Title:", cd.cdtext.title)
    print("Artist:", cd.cdtext.performer)
    print("Date:", cd.rem.date)
    print("Tracks:")

    for tr in cd:
        print(f"TRACK {tr.track_number:02d}: {tr.cdtext.title} - {tr.cdtext.performer}")

cueprint
^^^^^^^^

pylibcue also provides a command line tool ``cueprint.py`` to dump all information
from CUE sheet. (python version of cuetools ``cueprint`` and ``cuebreakpoints``)

Use ``cueprint.py`` to see how many fields pylibcue can extract from CUE sheet:

.. code-block:: bash

    cueprint.py ./example.cue
    # or
    python3 -m pylibcue.cueprint ./example.cue

License
-------

pylibcue is licensed under the GNU General Public License v2.0.
