Skip to main content

py3c helps you port C extensions to Python 3.

It provides a detailed guide, and a set of macros to make porting easy and reduce boilerplate.

Design principles

  • Reduce chances of accidental subtle errors

  • Minimize boilerplate

  • Prefer the Python 3 way of doing things

  • Minimize semantic changes under Python 2

Versions

Projects using py3c will be compatible with CPython 2.6, 2.7, and 3.3+.

Guides

A detailed porting guide is provided.

A cheatsheet is available for those that already know the Python C API, and want to know what the py3c macros do.

Installation

If your build system supports pkg-config, you can set it up to look for a system-wide installation of py3c.

Alternately, py3c can be used as a header-only library: copy the headers to your project and use them.

If you wish to install py3c system-wide (e.g. if you are a distro packager), see the Contributing chapter in the documentation.

Contribute

License

The code is licensed under the MIT license. May it serve you well.

The documentation is licensed under CC-BY-SA 3.0.

See the files LICENSE.MIT and doc/LICENSE.CC-BY-SA-3.0.

Release files for py3c 1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for py3c 1.4
File Interpreter ABI Platform
py3c-1.4-py2.py3-none-any.whl Python 3, Python 2 none any Details

Release files / py3c-1.4-py2.py3-none-any.whl

Download URL py3c-1.4-py2.py3-none-any.whl
Size 9.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
1c2574a77c6e42cb4900f7876dc62821f1b1221a647973c18c63a874e680fee6
BLAKE2b-256 checksum
How to use checksums
84da02c19dec3be18e46fcef0c02d379429a3cbd6e91e7c048b5b1c63ce5127d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/58.0.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.7

Release history Release notifications | RSS feed

This release

1.4 This release

1 release file

1.3

2 release files

1.2

2 release files

1.0

2 release files

0.9.3

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page