pycdio


Namepycdio JSON
Version 2.1.1 PyPI version JSON
download
home_pagehttp://www.gnu.org/software/libcdio
SummaryPython OO interface to libcdio (CD Input and Control library)
upload_time2021-08-01 00:24:41
maintainer
docs_urlNone
authorRocky Bernstein
requires_python
licenseGPL
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            |Package Status 1| |Package Status 2| |Pypi Installs|


Introduction
==============

pycdio is a Python interface to the *libcdio*, the CD Input and
Control library http://www.gnu.org/software/libcdio


You can get the source at the same place as libcdio:
ftp://ftp.gnu.org:/pub/gnu/libcdio/

The *pycdio* and *libcdio* libraries encapsulate CD-ROM reading and
control. Python programs wishing to be oblivious of the OS- and
device-dependent properties of a CD-ROM can use this library.


Sample Usage
============

Getting CD-ROM Drive Information
--------------------------------

.. code-block:: python

    import sys
    import cdio, pycdio

    try:
        d = cdio.Device(driver_id=pycdio.DRIVER_UNKNOWN)
        drive_name = d.get_device()
    except IOError:
        print("Problem finding a CD-ROM")
        sys.exit(1)

    ok, vendor, model, release = d.get_hwinfo()
    print("drive: %s, vendor: %s, model: %s, release: %s" \
      % (drive_name, vendor, model, release))

    # Show CD-Text for an audio CD
    cdt = d.get_cdtext()
    i_tracks = d.get_num_tracks()
    i_first_track = pycdio.get_first_track_num(d.cd)

    for t in range(i_first_track, i_tracks + i_first_track):
        for i in range(pycdio.MIN_CDTEXT_FIELD, pycdio.MAX_CDTEXT_FIELDS):
            value = cdt.get(i, t)
            # value can be empty but exist, compared to NULL values
            if value is not None:
                print("\t%s: %s" % (pycdio.cdtext_field2str(i), value))
                pass
            pass
        pass
    return
    d.close()

Other sample code can be found in the *example* directory of the distribution.

Requirements
=============

* A C compiler so the extension can be compiled when it is installed.
* libcdio (http://www.gnu.org/software/libcdio) and it's header files installed.
* SWIG http://www.swig.org
* pkg-config http://pkg-config.freedesktop.org

To build on Debian (e.g. Ubuntu):
-------------------------------------

::

    $ apt-get install python-dev
    $ apt-get install libcdio-dev
    $ apt-get install libiso9660-dev
    $ apt-get install swig pkg-config
    $ pip install -e .
    $ make check

SWIG Problems
===============

I've tried to make this work back to Python 2.3 or so.

I've noticed however problems in various distutils.

If you see a message like this when running `make check`:

::

     File "/home/rocky/.pyenv/versions/3.5.6/lib/python3.5/distutils/unixccompiler.py", line 207, in library_dir_option
      return "-L" + dir
     TypeError: Can't convert 'bytes' object to str implicitly


Copy in a recent distutils `unixccompiler.py` like this:

::

   $ cp admin-tools/unixccompiler.py /home/rocky/.pyenv/versions/3.5.6/lib/python3.5/distutils/unixccompiler.py

The distutils distribution says that it tries to be compatible with all Python versions from 2.3. The
`unixccompiler.py` in `admin_tools` is from the Python 3.7.4 distribution.

Completeness
=============

*libcdio* is rather large and yet may still grow a bit.

What is in *pycdio* is incomplete; over time it may grow to completion
depending on various factors: e.g. interest, whether others help
out.

Sections of *libcdio* that are currently missing are the (SCSI) MMC
commands, and the cdparanoia library. Of the audio controls, I put in
those things that didn't require any thought. The ISO 9660 library is
pretty complete, except file *stat()* information which is at present is
pretty minimal.

That said, what's in there is very usable. It contains probably more
access capabilities than what most media players that don't use
libcdio have.

The encapsulation by SWIG is done in two parts. The lower-level python
interface is called pycdio and is generated by SWIG.

The more object-oriented module is *cdio*; it is a Python class that
uses pycdio. Although pycdio is perfectly usable on its own, it is
expected that *cdio* is what most people will use. As *pycdio* more
closely models the C interface, it is conceivable (if unlikely) that
diehard libcdio C users who are very familiar with that interface
could prefer that.

It is probably possible to change the SWIG in such a way to combine
these pieces. However there are the problems. First, I'm not that much
of a SWIG expert. Second it looks as though the resulting SWIG code
would be more complex. Third the separation makes translation very
straight forward to understand and maintain: first get what's in C
into Python as a one-to-one translation. Then we implement some nice
abstraction off of that. The abstraction can be modified without
having to redo the underlying translation. (But the reverse is
generally not true: usually changes to the C-to-python translation,
pycdio, do result in small, but obvious and straightforward changes to
the abstraction layer cdio.)

There is much to be done - you want to help out, please do so!

Standalone documentation is missing although many of the methods,
classes and functions have some document strings. See also the
programs in the example directory.

pycdio for enterprise
=====================

Available as part of the Tidelift Subscription.

The maintainers of pycdio and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. `Learn more. <https://tidelift.com/subscription/pkg/pypi-pycdio?utm_source=pypi-pycdio&utm_medium=referral&utm_campaign=readme>`_

Security contact information
============================

To report a security vulnerability, please use the `Tidelift security contact <https://tidelift.com/security>`_ and Tidelift will coordinate the fix and disclosure.

.. |Package Status 1| image:: https://repology.org/badge/tiny-repos/pycdio.svg
		 :target: https://repology.org/project/pycdio/versions
.. |Package Status 2| image:: https://repology.org/badge/tiny-repos/python:pycdio.svg
		 :target: https://repology.org/project/pycdio/versions
.. |Pypi Installs| image:: https://pepy.tech/badge/pycdio
            

Raw data

            {
    "_id": null,
    "home_page": "http://www.gnu.org/software/libcdio",
    "name": "pycdio",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Rocky Bernstein",
    "author_email": "rocky@gnu.org",
    "download_url": "https://files.pythonhosted.org/packages/73/02/e482cd03681c641aba3863216029814443c023ac772ea5c638b3ff8e699f/pycdio-2.1.1.tar.gz",
    "platform": "",
    "description": "|Package Status 1| |Package Status 2| |Pypi Installs|\n\n\nIntroduction\n==============\n\npycdio is a Python interface to the *libcdio*, the CD Input and\nControl library http://www.gnu.org/software/libcdio\n\n\nYou can get the source at the same place as libcdio:\nftp://ftp.gnu.org:/pub/gnu/libcdio/\n\nThe *pycdio* and *libcdio* libraries encapsulate CD-ROM reading and\ncontrol. Python programs wishing to be oblivious of the OS- and\ndevice-dependent properties of a CD-ROM can use this library.\n\n\nSample Usage\n============\n\nGetting CD-ROM Drive Information\n--------------------------------\n\n.. code-block:: python\n\n    import sys\n    import cdio, pycdio\n\n    try:\n        d = cdio.Device(driver_id=pycdio.DRIVER_UNKNOWN)\n        drive_name = d.get_device()\n    except IOError:\n        print(\"Problem finding a CD-ROM\")\n        sys.exit(1)\n\n    ok, vendor, model, release = d.get_hwinfo()\n    print(\"drive: %s, vendor: %s, model: %s, release: %s\" \\\n      % (drive_name, vendor, model, release))\n\n    # Show CD-Text for an audio CD\n    cdt = d.get_cdtext()\n    i_tracks = d.get_num_tracks()\n    i_first_track = pycdio.get_first_track_num(d.cd)\n\n    for t in range(i_first_track, i_tracks + i_first_track):\n        for i in range(pycdio.MIN_CDTEXT_FIELD, pycdio.MAX_CDTEXT_FIELDS):\n            value = cdt.get(i, t)\n            # value can be empty but exist, compared to NULL values\n            if value is not None:\n                print(\"\\t%s: %s\" % (pycdio.cdtext_field2str(i), value))\n                pass\n            pass\n        pass\n    return\n    d.close()\n\nOther sample code can be found in the *example* directory of the distribution.\n\nRequirements\n=============\n\n* A C compiler so the extension can be compiled when it is installed.\n* libcdio (http://www.gnu.org/software/libcdio) and it's header files installed.\n* SWIG http://www.swig.org\n* pkg-config http://pkg-config.freedesktop.org\n\nTo build on Debian (e.g. Ubuntu):\n-------------------------------------\n\n::\n\n    $ apt-get install python-dev\n    $ apt-get install libcdio-dev\n    $ apt-get install libiso9660-dev\n    $ apt-get install swig pkg-config\n    $ pip install -e .\n    $ make check\n\nSWIG Problems\n===============\n\nI've tried to make this work back to Python 2.3 or so.\n\nI've noticed however problems in various distutils.\n\nIf you see a message like this when running `make check`:\n\n::\n\n     File \"/home/rocky/.pyenv/versions/3.5.6/lib/python3.5/distutils/unixccompiler.py\", line 207, in library_dir_option\n      return \"-L\" + dir\n     TypeError: Can't convert 'bytes' object to str implicitly\n\n\nCopy in a recent distutils `unixccompiler.py` like this:\n\n::\n\n   $ cp admin-tools/unixccompiler.py /home/rocky/.pyenv/versions/3.5.6/lib/python3.5/distutils/unixccompiler.py\n\nThe distutils distribution says that it tries to be compatible with all Python versions from 2.3. The\n`unixccompiler.py` in `admin_tools` is from the Python 3.7.4 distribution.\n\nCompleteness\n=============\n\n*libcdio* is rather large and yet may still grow a bit.\n\nWhat is in *pycdio* is incomplete; over time it may grow to completion\ndepending on various factors: e.g. interest, whether others help\nout.\n\nSections of *libcdio* that are currently missing are the (SCSI) MMC\ncommands, and the cdparanoia library. Of the audio controls, I put in\nthose things that didn't require any thought. The ISO 9660 library is\npretty complete, except file *stat()* information which is at present is\npretty minimal.\n\nThat said, what's in there is very usable. It contains probably more\naccess capabilities than what most media players that don't use\nlibcdio have.\n\nThe encapsulation by SWIG is done in two parts. The lower-level python\ninterface is called pycdio and is generated by SWIG.\n\nThe more object-oriented module is *cdio*; it is a Python class that\nuses pycdio. Although pycdio is perfectly usable on its own, it is\nexpected that *cdio* is what most people will use. As *pycdio* more\nclosely models the C interface, it is conceivable (if unlikely) that\ndiehard libcdio C users who are very familiar with that interface\ncould prefer that.\n\nIt is probably possible to change the SWIG in such a way to combine\nthese pieces. However there are the problems. First, I'm not that much\nof a SWIG expert. Second it looks as though the resulting SWIG code\nwould be more complex. Third the separation makes translation very\nstraight forward to understand and maintain: first get what's in C\ninto Python as a one-to-one translation. Then we implement some nice\nabstraction off of that. The abstraction can be modified without\nhaving to redo the underlying translation. (But the reverse is\ngenerally not true: usually changes to the C-to-python translation,\npycdio, do result in small, but obvious and straightforward changes to\nthe abstraction layer cdio.)\n\nThere is much to be done - you want to help out, please do so!\n\nStandalone documentation is missing although many of the methods,\nclasses and functions have some document strings. See also the\nprograms in the example directory.\n\npycdio for enterprise\n=====================\n\nAvailable as part of the Tidelift Subscription.\n\nThe maintainers of pycdio and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. `Learn more. <https://tidelift.com/subscription/pkg/pypi-pycdio?utm_source=pypi-pycdio&utm_medium=referral&utm_campaign=readme>`_\n\nSecurity contact information\n============================\n\nTo report a security vulnerability, please use the `Tidelift security contact <https://tidelift.com/security>`_ and Tidelift will coordinate the fix and disclosure.\n\n.. |Package Status 1| image:: https://repology.org/badge/tiny-repos/pycdio.svg\n\t\t :target: https://repology.org/project/pycdio/versions\n.. |Package Status 2| image:: https://repology.org/badge/tiny-repos/python:pycdio.svg\n\t\t :target: https://repology.org/project/pycdio/versions\n.. |Pypi Installs| image:: https://pepy.tech/badge/pycdio",
    "bugtrack_url": null,
    "license": "GPL",
    "summary": "Python OO interface to libcdio (CD Input and Control library)",
    "version": "2.1.1",
    "project_urls": {
        "Homepage": "http://www.gnu.org/software/libcdio"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1646aea3a36aa20923f48083a75f284dc4e5a2a3e217bbb4f4486ea5f147ddee",
                "md5": "3d7aa3190ac7142242196be9bb9a8b4d",
                "sha256": "8ec0d413ede189429c9f1e0d6cce559de2ef12eb8b0ad7478a163c3a663255c7"
            },
            "downloads": -1,
            "filename": "pycdio-2.1.1-py2.7-linux-x86_64.egg",
            "has_sig": false,
            "md5_digest": "3d7aa3190ac7142242196be9bb9a8b4d",
            "packagetype": "bdist_egg",
            "python_version": "2.1.1",
            "requires_python": null,
            "size": 438852,
            "upload_time": "2021-08-01T00:24:31",
            "upload_time_iso_8601": "2021-08-01T00:24:31.306209Z",
            "url": "https://files.pythonhosted.org/packages/16/46/aea3a36aa20923f48083a75f284dc4e5a2a3e217bbb4f4486ea5f147ddee/pycdio-2.1.1-py2.7-linux-x86_64.egg",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "caba1e9cb42a9c06f428ab83ca9346d186d6e292ce557801954bc352bf26b942",
                "md5": "3d395e35ada9b24afc4291ad318e2459",
                "sha256": "95bb4d60a5a5390b6be1c1505f714043f0afc29c3aebc5142718aca98b8fd8ef"
            },
            "downloads": -1,
            "filename": "pycdio-2.1.1-py3.3-linux-x86_64.egg",
            "has_sig": false,
            "md5_digest": "3d395e35ada9b24afc4291ad318e2459",
            "packagetype": "bdist_egg",
            "python_version": "2.1.1",
            "requires_python": null,
            "size": 438699,
            "upload_time": "2021-08-01T00:24:32",
            "upload_time_iso_8601": "2021-08-01T00:24:32.754443Z",
            "url": "https://files.pythonhosted.org/packages/ca/ba/1e9cb42a9c06f428ab83ca9346d186d6e292ce557801954bc352bf26b942/pycdio-2.1.1-py3.3-linux-x86_64.egg",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "755b0a6cd14c274b48bf95b3e6aad1dd5f824c13a3be99f0f1b37ff94bab5910",
                "md5": "b4cbd08844e2e9dc0631d758eea86016",
                "sha256": "1da96ffca622e0a057e27408afe5de79b5f8eadd1de41e70eebdaf3070fbb8ca"
            },
            "downloads": -1,
            "filename": "pycdio-2.1.1-py3.5-linux-x86_64.egg",
            "has_sig": false,
            "md5_digest": "b4cbd08844e2e9dc0631d758eea86016",
            "packagetype": "bdist_egg",
            "python_version": "2.1.1",
            "requires_python": null,
            "size": 444434,
            "upload_time": "2021-08-01T00:24:34",
            "upload_time_iso_8601": "2021-08-01T00:24:34.074349Z",
            "url": "https://files.pythonhosted.org/packages/75/5b/0a6cd14c274b48bf95b3e6aad1dd5f824c13a3be99f0f1b37ff94bab5910/pycdio-2.1.1-py3.5-linux-x86_64.egg",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0974096e9474bbb72f0b522c9d32bef2ad3b0184ec3493ef899652767b2a69dc",
                "md5": "583195ef19718832bd51f5bfc2b6608f",
                "sha256": "2f5adf9076b985cd47bdeca365f020abdb9e400a1d90effab3832b23f496ab94"
            },
            "downloads": -1,
            "filename": "pycdio-2.1.1-py3.6-linux-x86_64.egg",
            "has_sig": false,
            "md5_digest": "583195ef19718832bd51f5bfc2b6608f",
            "packagetype": "bdist_egg",
            "python_version": "2.1.1",
            "requires_python": null,
            "size": 444243,
            "upload_time": "2021-08-01T00:24:35",
            "upload_time_iso_8601": "2021-08-01T00:24:35.460370Z",
            "url": "https://files.pythonhosted.org/packages/09/74/096e9474bbb72f0b522c9d32bef2ad3b0184ec3493ef899652767b2a69dc/pycdio-2.1.1-py3.6-linux-x86_64.egg",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "70156a654ae04d9cec38650f83dd4c5e4fd610a6671782c1758ade3ee674ad2f",
                "md5": "f5377d83d86e2d33d7af89717d781c07",
                "sha256": "18c34df4f05064037c264310791a96f63d5b69de69cda87720e0e9a6c0ad320b"
            },
            "downloads": -1,
            "filename": "pycdio-2.1.1-py3.7-linux-x86_64.egg",
            "has_sig": false,
            "md5_digest": "f5377d83d86e2d33d7af89717d781c07",
            "packagetype": "bdist_egg",
            "python_version": "2.1.1",
            "requires_python": null,
            "size": 446273,
            "upload_time": "2021-08-01T00:24:37",
            "upload_time_iso_8601": "2021-08-01T00:24:37.499369Z",
            "url": "https://files.pythonhosted.org/packages/70/15/6a654ae04d9cec38650f83dd4c5e4fd610a6671782c1758ade3ee674ad2f/pycdio-2.1.1-py3.7-linux-x86_64.egg",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a09779c087f08e8f35ab80e511d1389ac35d680b6f9266afaa54adb91570f889",
                "md5": "169808b9c8b87195f4cd3bbf11f7467c",
                "sha256": "ea304e496c91c6eab219c053e9cad8b976bac70df9e43e5b362787c33a3f445d"
            },
            "downloads": -1,
            "filename": "pycdio-2.1.1-py3.8-linux-x86_64.egg",
            "has_sig": false,
            "md5_digest": "169808b9c8b87195f4cd3bbf11f7467c",
            "packagetype": "bdist_egg",
            "python_version": "2.1.1",
            "requires_python": null,
            "size": 457061,
            "upload_time": "2021-08-01T00:24:38",
            "upload_time_iso_8601": "2021-08-01T00:24:38.951188Z",
            "url": "https://files.pythonhosted.org/packages/a0/97/79c087f08e8f35ab80e511d1389ac35d680b6f9266afaa54adb91570f889/pycdio-2.1.1-py3.8-linux-x86_64.egg",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c49daaff18c098fb6a9ab7f98beaf3e8291858d006af7dc49716421553ea236c",
                "md5": "d238dbd0707dffb75baf46403fac9592",
                "sha256": "e72c896cc02b2282e6fdc66b16682820e8bb8d0764ca3efbd43481a450c02432"
            },
            "downloads": -1,
            "filename": "pycdio-2.1.1-py3.9-linux-x86_64.egg",
            "has_sig": false,
            "md5_digest": "d238dbd0707dffb75baf46403fac9592",
            "packagetype": "bdist_egg",
            "python_version": "2.1.1",
            "requires_python": null,
            "size": 464603,
            "upload_time": "2021-08-01T00:24:40",
            "upload_time_iso_8601": "2021-08-01T00:24:40.336803Z",
            "url": "https://files.pythonhosted.org/packages/c4/9d/aaff18c098fb6a9ab7f98beaf3e8291858d006af7dc49716421553ea236c/pycdio-2.1.1-py3.9-linux-x86_64.egg",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7302e482cd03681c641aba3863216029814443c023ac772ea5c638b3ff8e699f",
                "md5": "0d0e293ad18ecdda2c04a2afb95bd28c",
                "sha256": "61734db8c554b7b1a2cb2da2e2c15d3f9f5973a57cfb06f8854c38029004a9f8"
            },
            "downloads": -1,
            "filename": "pycdio-2.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "0d0e293ad18ecdda2c04a2afb95bd28c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 246562,
            "upload_time": "2021-08-01T00:24:41",
            "upload_time_iso_8601": "2021-08-01T00:24:41.955929Z",
            "url": "https://files.pythonhosted.org/packages/73/02/e482cd03681c641aba3863216029814443c023ac772ea5c638b3ff8e699f/pycdio-2.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-08-01 00:24:41",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pycdio"
}
        
Elapsed time: 0.66026s