Arbitrary-precision decimal and integer arithmetic for Python, powered by Mojo
Project description
decimo
Arbitrary-precision decimal and integer arithmetic for Python, powered by Mojo.
⚠️ Pre-Alpha / Placeholder release.
The Python bindings are under active development. A proper installable wheel is coming soon.
Full Mojo library is already available — see the main repository.
What is decimo?
decimo is an arbitrary-precision decimal and integer library, originally written in Mojo.
This package exposes decimo's BigDecimal type to Python via a Mojo-built CPython extension module (_decimo.so),
with a thin Python wrapper providing full Pythonic operator support.
from decimo import Decimal
a = Decimal("1.234567890123456789012345678901234567890")
b = Decimal("9.876543210987654321098765432109876543210")
print(a + b) # 11.111111101111111110111111111111111111100
print(a * b) # 12.193263111263526900...
print(a / b) # 0.12499999...
Status
| Feature | Status |
|---|---|
Decimal (BigDecimal) arithmetic (+, -, *, /) |
✅ Working |
| Comparison operators | ✅ Working |
Unary -, abs(), bool() |
✅ Working |
| Pre-built wheels on PyPI | 🚧 Coming soon |
BigInt / Decimal128 Python bindings |
🔜 Planned |
Building from source
The extension requires Mojo and pixi:
git clone https://github.com/forfudan/decimo
cd decimo
pixi run buildpy
# .so is built at python/src/decimo/_decimo.so
Then install in editable mode:
pip install -e python/
Links
- GitHub: https://github.com/forfudan/decimo
- Changelog: https://github.com/forfudan/decimo/blob/main/docs/changelog.md
- Mojo library docs: https://github.com/forfudan/decimo/blob/main/docs/api.md
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file decimo-0.1.0.dev0-py3-none-any.whl.
File metadata
- Download URL: decimo-0.1.0.dev0-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ed3df81d002fb6363f151fadb35c8f308ac3e0bade075f58b7d1427acea4780
|
|
| MD5 |
21a707e40b5d5b30420b063506683879
|
|
| BLAKE2b-256 |
bc88b720d91b66d305b4c3d10218589be48a2f7dd765e7259e29f3d07b40e7ff
|