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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py3c-1.3.tar.gz (2.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py3c-1.3-py2.py3-none-any.whl (9.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file py3c-1.3.tar.gz.

File metadata

  • Download URL: py3c-1.3.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for py3c-1.3.tar.gz
Algorithm Hash digest
SHA256 339af9f553ec3a72c5f474f619c63fbafe49d4c9934bc35e0010c58ce9e30e5b
MD5 0eb132aecacb1cf7e7d75d2d284aa481
BLAKE2b-256 c4f17cdf86dfe1fc8c7a01d4c5baaca1c4ade36437ec7de4ec27fe5889ab0cfb

See more details on using hashes here.

File details

Details for the file py3c-1.3-py2.py3-none-any.whl.

File metadata

  • Download URL: py3c-1.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for py3c-1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 17435bc65a392179309844b15cc9d412f7c29f0f5f220bc3eec103ffbf8d777f
MD5 412acde1cc116cedf65abf0201b2e3a1
BLAKE2b-256 1c5f52898cb92aadeb0aef87cbe0add82ec3f978cd5c519f2041a4b20ebe7cc9

See more details on using hashes here.

Release history Release notifications | RSS feed

1.4

1 file

This release

1.3 This release

2 files

1.2

2 files

1.0

2 files

0.9.3

1 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