{"id":19248487,"url":"https://github.com/rocky/pycdio","last_synced_at":"2025-04-21T11:34:15.472Z","repository":{"id":48098940,"uuid":"204266268","full_name":"rocky/pycdio","owner":"rocky","description":"Python interface to the libcdio - the CD Input and Control library","archived":false,"fork":false,"pushed_at":"2024-04-28T17:58:06.000Z","size":399,"stargazers_count":16,"open_issues_count":3,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-01T13:01:47.086Z","etag":null,"topics":["bindings","cd","cdrom","libcdio","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rocky.png","metadata":{"files":{"readme":"README.rst","changelog":"ChangeLog","contributing":null,"funding":".github/FUNDING.yml","license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":"pypi/pycdio","community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2019-08-25T08:20:08.000Z","updated_at":"2025-03-30T00:46:12.000Z","dependencies_parsed_at":"2022-08-12T18:40:11.826Z","dependency_job_id":null,"html_url":"https://github.com/rocky/pycdio","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocky%2Fpycdio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocky%2Fpycdio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocky%2Fpycdio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocky%2Fpycdio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rocky","download_url":"https://codeload.github.com/rocky/pycdio/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250048109,"owners_count":21366176,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bindings","cd","cdrom","libcdio","python"],"created_at":"2024-11-09T18:08:17.583Z","updated_at":"2025-04-21T11:34:14.996Z","avatar_url":"https://github.com/rocky.png","language":"Python","funding_links":["https://tidelift.com/funding/github/pypi/pycdio","https://tidelift.com/subscription/pkg/pypi-pycdio?utm_source=pypi-pycdio\u0026utm_medium=referral\u0026utm_campaign=readme","https://tidelift.com/security"],"categories":[],"sub_categories":[],"readme":"|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. \u003chttps://tidelift.com/subscription/pkg/pypi-pycdio?utm_source=pypi-pycdio\u0026utm_medium=referral\u0026utm_campaign=readme\u003e`_\n\nSecurity contact information\n============================\n\nTo report a security vulnerability, please use the `Tidelift security contact \u003chttps://tidelift.com/security\u003e`_ 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\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frocky%2Fpycdio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frocky%2Fpycdio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frocky%2Fpycdio/lists"}