Skip to main content

PyPI GitHub repo size GitHub


annotatec helps you create Python packages with C embeddings.

Imagine you're developing C library and already have more than 50 functions. Sometimes you change signatures of old functions or rename them. It'll be headache to write and support all ctypes-declarations for Python wrapper. annotatec will create all Python objects for you. All you need is to provide declarations, which can be placed directly into your C code.

Minimal livable example

You have some library lib.c and it's header lib.h. These files were compiled into lib.so (or lib.dll in Windows).

lib.c source:

#include "lib.h"
int sum(int a, short b, long long c) { return a + b + c; }

lib.h source:

/* @function sum
 * @return int
 * @argument int
 * @argument short
 * @argument longlong
 */
int sum(int, short, long long);

Here's a Python wrapper:

import annotatec

libc = annotatec.Loader(
    library="lib.so", headers=["lib.h"])

That's all! Now you can test it like so:

>>> libc.sum(1, 2, 3)
<<< 6

Reference

Read detailed reference in wiki-pages.

Metadata

Release files for annotatec 1.0

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

Source distribution (sdist)

Source distribution for annotatec 1.0
File Size Uploaded
annotatec-1.0.tar.gz 12.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for annotatec 1.0
File Interpreter ABI Platform
annotatec-1.0-py3-none-any.whl Python 3 none any Details

Total release size: 14.8 kB

Release files / annotatec-1.0.tar.gz

Download URL annotatec-1.0.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c8a9f30ff3f24f21f3b91c4c8b8d04aab1ebd26ba1c34d8454a976263015c5ef
BLAKE2b-256 checksum
How to use checksums
a256eed223df9c63850fe401ef3479daee3567537b193e2a1c573f817f4b6fa8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.10

Release files / annotatec-1.0-py3-none-any.whl

Download URL annotatec-1.0-py3-none-any.whl
Size 2.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9039b6a45aa8b0a5f996678f0d149430f7ee50473daa03a01e001b2db01dc22a
BLAKE2b-256 checksum
How to use checksums
79edc3e992fbb8769d6f1d9673e6344e729a9d2b55e1d1d224fa1d0d2dc5d118
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.10

Release history Release notifications | RSS feed

This release

1.0 This release

2 release files

0.1

2 release files

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