Skip to content

encukou/py3c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a586763 · Aug 1, 2024
Apr 12, 2023
Aug 1, 2024
Jan 26, 2021
Jan 26, 2021
Jun 26, 2020
Jan 7, 2021
Sep 7, 2015
Aug 25, 2015
Aug 25, 2015
Oct 15, 2021
May 19, 2016
Oct 15, 2021
Feb 28, 2023
Feb 14, 2023
Jan 7, 2021
Oct 15, 2021

Repository files navigation

py3c

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.