FancyTypes
Syntax sugar for ctypes that provides a more confortable way to load and setup shared libraries for your projects. The goal of this simple package is to reduce boilerplate and replace tedious syntax with something more intuitive and fancier.
Features
- Load shared libraries and only interface the desired procedures.
- Parse argument and result types together through a dedicated parser function.
- Multiple type aliases available (e.g. real64 / float64 for 64-bit floating point numbers)
- Improved syntax to define C struct and union types
- Tools to work with NumPy arrays
All ctypes types are compatible even if FancyTypes does not provide its own specific class for them. For example, char support is limited since the main focus of the package is numerical computing, so syntax improvements to pass strings around are limited to turning them into NumPy arrays and not much else. Typically, strings and I/O can be handled on the Python side.
Dependency free
The only dependency is NumPy for array handling. The NumPy package is pretty much part of the standard library amongst the Python numerical computing ecosystem, so any project that could potentially use this will most likely already depend on NumPy on its own.
Documentation
Read the documentation and find out if this package could be useful to you.
Installation and importing
The package can be installed from PyPI
pip install fancy-ctypes
Alternatively, download this repository and run
pip install .
The package is imported as
import fancytypes
# For confort
import fancytypes as ft
Platform
The package is intended to be platform agnostic, although shared libraries are not. This is a tool that interfaces those libraries with Python, but users still need to build them first however they want.
Metadata
Release files for fancy-ctypes 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fancy_ctypes-0.2.1.tar.gz | 49.8 kB | Without provenance | Details for fancy_ctypes-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fancy_ctypes-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for fancy_ctypes-0.2.1-py3-none-any.whl |
Total release size: 89.2 kB
Release files / fancy_ctypes-0.2.1.tar.gz
| Download URL | fancy_ctypes-0.2.1.tar.gz |
|---|---|
| Size | 49.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
748f0b8aa0b834ac327403e479a78746e4b2cbd099482613437b1b2d475e3804
|
|
BLAKE2b-256 checksum How to use checksums |
9d1d27f972e01a6878d7f0f59bcea9b4997f0337dc92c3e375c45b98b9146da6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / fancy_ctypes-0.2.1-py3-none-any.whl
| Download URL | fancy_ctypes-0.2.1-py3-none-any.whl |
|---|---|
| Size | 39.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
adcfcc92963654b672663a28ad9fe3c936133d95bd234345295774714334ab43
|
|
BLAKE2b-256 checksum How to use checksums |
8630dea7a443fea01731a0609fe40c94135e5cd32d171b8b8224cfdbfe226574
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Security for fancy-ctypes 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.