Skip to main content

Overview

The cdecimal package is a fast drop-in replacement for the decimal module in Python’s standard library. Both modules provide complete implementations of Mike Cowlishaw/IBM’s General Decimal Arithmetic Specification.

Testing

Both cdecimal and the underlying library - libmpdec - are extremely well tested. libmpdec is one of the few open source projects with 100% code coverage. cdecimal is rigorously tested against decimal.py.

Short benchmarks

Typical performance gains are between 30x for I/O heavy benchmarks and 80x for numerical programs. In a database benchmark, cdecimal exhibits a speedup of 12x over decimal.py.

decimal

cdecimal

speedup

pi

42.75s

0.58s

74x

telco

172.19s

5.68s

30x

psycopg

3.57s

0.29s

12x

Documentation

Since cdecimal is compatible with decimal.py, the official documentation is valid. For the few remaining differences, refer to the second link.

Linux Notes

The build process requires a working C compiler and a full Python install with development headers. Linux distributions often ship the Python header files as a separate package, called python-dev or python-devel.

Install headers on Debian/Ubuntu:

  • sudo apt-get install python-dev

Windows Notes

Release files for pypi-cdecimal 2.3

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

Source distribution (sdist)

Source distribution for pypi-cdecimal 2.3
File Size Uploaded
pypi-cdecimal-2.3.tar.gz 90.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pypi-cdecimal 2.3
File Interpreter ABI Platform
pypi_cdecimal-2.3-cp27-none-macosx_10_11_x86_64.whl CPython 2.7 none macOS 10.11+ x86-64 Details

Total release size: 225.8 kB

Release files / pypi-cdecimal-2.3.tar.gz

Download URL pypi-cdecimal-2.3.tar.gz
Size 90.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4b7fd1bf6e680ff6f094576a6a791b1ac959d7a489cc29125a3c3ffdcc169dc8
BLAKE2b-256 checksum
How to use checksums
c63e0e8408545ef9bca6e11956c1e78215b820f0193669afe8750f9cbaa054d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pypi_cdecimal-2.3-cp27-none-macosx_10_11_x86_64.whl

Download URL pypi_cdecimal-2.3-cp27-none-macosx_10_11_x86_64.whl
Size 135.2 kB
Tags CPython 2.7 macOS 10.11+ x86-64
SHA-256 checksum
How to use checksums
8ed3b8a876f88d8244c73d4f584bbc0937b70911e14ff4e613cb2a3f0e10906b
BLAKE2b-256 checksum
How to use checksums
263de52c0a8216bfb8be649733276c2555a88b67345b519d556926758d0f1592
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

2.3 This release

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