Skip to main content

rust → python made easy

Project description

carefree-pyo3

cfpyo3 is a collection of performant utilities.

Installation

carefree-pyo3 requires:

  • Python 3.8 or higher.
  • numpy < 2.x, because currently rust numpy doesn't support numpy 2.x.
pip install carefree-pyo3

Test

pytest

Benchmark (Rust)

cargo bench -F criterion -p cfpyo3_rs_core -- --verbose

Architecture

This project is divided into four parts - looks clumsy, but I'll introduce them and explain their necessity.

cfpyo3_rs_core

This is the Rust core of the project, and is meant to be responsible for the heavy lifting. Its necessity is almost self-explanatory.

cfpyo3_rs_bindings

This one looks redundant at first glance, as we already have cfpyo3_rs_py. Initially this member did not exist, until I find some bindings in cfpyo3_rs_py very useful, want to reuse them, and failed because:

  • It is not an rlib.
  • Even I managed to make it an rlib, it's just not good to import the whole package because cfpyo3_rs_py itself is exposing lots of APIs to Python.

Another choice is to put these useful bindings in cfpyo3_rs_core, but then GitHub CI cannot build it for whatever reason.

So at last, this member is born.

cfpyo3_rs_py

This is the 'direct' Python bindings of this project. It is just a REALLY thin wrapper around cfpyo3_rs_core and cfpyo3_rs_bindings, and is responsible for exposing the APIs to Python.

cfpyo3

This is the Python package that users will interact with. It is a relatively thin wrapper that dispatches the calls to cfpyo3_rs_py.

A typical use case is the f32 & f64 dispatch.

Project details


Download files

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

Source Distribution

carefree_pyo3-0.1.10.tar.gz (49.6 kB view hashes)

Uploaded Source

Built Distributions

carefree_pyo3-0.1.10-cp38-abi3-win_amd64.whl (266.5 kB view hashes)

Uploaded CPython 3.8+ Windows x86-64

carefree_pyo3-0.1.10-cp38-abi3-manylinux_2_24_aarch64.whl (432.9 kB view hashes)

Uploaded CPython 3.8+ manylinux: glibc 2.24+ ARM64

carefree_pyo3-0.1.10-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (425.1 kB view hashes)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ x86-64

carefree_pyo3-0.1.10-cp38-abi3-macosx_11_0_arm64.whl (381.2 kB view hashes)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

carefree_pyo3-0.1.10-cp38-abi3-macosx_10_12_x86_64.whl (392.6 kB view hashes)

Uploaded CPython 3.8+ macOS 10.12+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page