{"id":15008168,"url":"https://github.com/python/pythoncapi-compat","last_synced_at":"2025-04-05T23:12:28.057Z","repository":{"id":37924142,"uuid":"269418584","full_name":"python/pythoncapi-compat","owner":"python","description":"  The pythoncapi-compat project can be used to write a C extension supporting a wide range of Python versions with a single code base.","archived":false,"fork":false,"pushed_at":"2024-10-17T09:50:17.000Z","size":228,"stargazers_count":80,"open_issues_count":1,"forks_count":23,"subscribers_count":12,"default_branch":"main","last_synced_at":"2024-10-29T16:05:38.887Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pythoncapi-compat.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"0bsd","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/python.png","metadata":{"funding":{"custom":"https://www.python.org/psf/donations/python-dev/","github":["python"]},"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-04T17:09:06.000Z","updated_at":"2024-10-22T08:27:23.000Z","dependencies_parsed_at":"2023-01-21T12:34:06.444Z","dependency_job_id":"937e7827-aa88-438f-8edc-ca24dcbd3a8d","html_url":"https://github.com/python/pythoncapi-compat","commit_stats":{"total_commits":216,"total_committers":11,"mean_commits":"19.636363636363637","dds":0.05555555555555558,"last_synced_commit":"0041177c4f348c8952b4c8980b2c90856e61c7c7"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python%2Fpythoncapi-compat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python%2Fpythoncapi-compat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python%2Fpythoncapi-compat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python%2Fpythoncapi-compat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/python","download_url":"https://codeload.github.com/python/pythoncapi-compat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246945078,"owners_count":20858878,"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":[],"created_at":"2024-09-24T19:15:28.141Z","updated_at":"2025-04-05T23:12:28.040Z","avatar_url":"https://github.com/python.png","language":"Python","funding_links":["https://www.python.org/psf/donations/python-dev/","https://github.com/sponsors/python"],"categories":[],"sub_categories":[],"readme":"++++++++++++++++++++++++++\nPython C API compatibility\n++++++++++++++++++++++++++\n\n.. image:: https://github.com/python/pythoncapi-compat/actions/workflows/build.yml/badge.svg\n   :alt: Build status of pythoncapi-compat on GitHub Actions\n   :target: https://github.com/python/pythoncapi-compat/actions\n\nThe ``pythoncapi-compat`` project can be used to write a C or C++ extension\nsupporting a wide range of Python versions with a single code base.  It is made\nof the ``pythoncapi_compat.h`` header file and the ``upgrade_pythoncapi.py``\nscript.\n\n``upgrade_pythoncapi.py`` requires Python 3.6 or newer.\n\nSee the `documentation at ReadTheDocs\n\u003chttps://pythoncapi-compat.readthedocs.io/en/latest/\u003e`_\nfor more details.\n\nGetting started\n===============\n\nTo upgrade a specific file::\n\n    python3 upgrade_pythoncapi.py module.c\n\nTo upgrade all C/C++ files in a directory::\n\n    python3 upgrade_pythoncapi.py src/\n\nSelect operations\n-----------------\n\nTo only replace ``op-\u003eob_type`` with ``Py_TYPE(op)``, select the ``Py_TYPE``\noperation with::\n\n    python3 upgrade_pythoncapi.py -o Py_TYPE module.c\n\nOr the opposite, to apply all operations but leave ``op-\u003eob_type`` unchanged,\ndeselect the ``Py_TYPE`` operation with::\n\n    python3 upgrade_pythoncapi.py -o all,-Py_TYPE module.c\n\nDownload pythoncapi_compat.h\n----------------------------\n\nIf you want to ``pythoncapi_compat.h`` to your code base, use the\n``upgrade_pythoncapi.py`` tool to fetch it::\n\n    python3 upgrade_pythoncapi.py --download PATH\n\n\nThis project is distributed under the `Zero Clause BSD (0BSD) license\n\u003chttps://opensource.org/licenses/0BSD\u003e`_ and is covered by the `PSF Code of\nConduct \u003chttps://www.python.org/psf/codeofconduct/\u003e`_.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython%2Fpythoncapi-compat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpython%2Fpythoncapi-compat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython%2Fpythoncapi-compat/lists"}