Skip to main content

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.

PyPI License

⚠️ 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

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

decimo-0.1.0.dev0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

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

Hashes for decimo-0.1.0.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 0ed3df81d002fb6363f151fadb35c8f308ac3e0bade075f58b7d1427acea4780
MD5 21a707e40b5d5b30420b063506683879
BLAKE2b-256 bc88b720d91b66d305b4c3d10218589be48a2f7dd765e7259e29f3d07b40e7ff

See more details on using hashes here.

Supported by

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