compiled
Compiled variants of the Python standard library.
What is this project exactly?
Pure Python modules in the standard library can be a speed bottleneck sometimes, this package aims to provide "compiled" variants of the pure Python standard library modules, which are somewhere between 2-4x faster than the builtin ones.
Installation
pip install compiled
✨ This will install the pycompile CLI script as well.
Usage
Say your program asd.py looks like this:
import tomllib
from difflib import get_close_matches
# ... rest of the code
You can use the bundled pycompile script to turn those imports into the
"compiled" variants:
$ pycompile asd.py
✨ Rewrote asd.py with compiled imports.
$ cat asd.py
import compiled.tomllib as tomllib
from compiled.difflib import get_close_matches
# ... rest of the code
With a real world program using tomllib and difflib, we get the following
difference in speed:
| Program | Pure Python time | compiled time |
Speedup % |
|---|---|---|---|
| hashes.py | 1.907 seconds | 1.028 seconds | 85.5% faster |
Local Development / Testing
-
Create and activate a virtual environment.
-
Run
pip install mypy, as mypy[c] is the only dependency. -
Scripts to test, build and package standard libraries are present in
build.py:$ ./build.py test tomllib ............. ---------------------------------------------------------------------- Ran 13 tests in 0.006s OK $ ./build.py mypy tomllib Success: no issues found in 4 source files $ ./build.py package [...] ✨Built ./build/dist/compiled-0.2.1-cp311-cp311-macosx_13_0_arm64.whl
-
Run
pytest compiled_teststo run tests.
Metadata
Release files for compiled 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 6.8 MB
Release files / compiled-0.3.0-cp312-cp312-win_amd64.whl
| Download URL | compiled-0.3.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 282.2 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
cd06d9909d752f16ce90617f4a0204968f5c4975425d83f68a901746d58c524d
|
|
BLAKE2b-256 checksum How to use checksums |
3505395e7e2c63f859c5ffac46fd9d1b2feae13e6942f026558df33e5d47a251
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / compiled-0.3.0-cp312-cp312-win32.whl
| Download URL | compiled-0.3.0-cp312-cp312-win32.whl |
|---|---|
| Size | 244.8 kB |
| Tags | CPython 3.12 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
25e4c2eff101c1a9f537828fd6ff5ff87e88c3ac4119fd30bafa25c44a35f767
|
|
BLAKE2b-256 checksum How to use checksums |
e72f53438983eab774c5ff02ad85143c826fb5c8f40c91c38791bd1f9a9ea609
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / compiled-0.3.0-cp312-cp312-musllinux_1_1_x86_64.whl
| Download URL | compiled-0.3.0-cp312-cp312-musllinux_1_1_x86_64.whl |
|---|---|
| Size | 630.1 kB |
| Tags | CPython 3.12 Linux musl 1.1+ x86-64 |
|
SHA-256 checksum How to use checksums |
1eac787a73cf913206e10d81c5b7433d8978f28cf9a3726927a5931f18fefd1d
|
|
BLAKE2b-256 checksum How to use checksums |
95242580333c221b42f0d732c6c403653c836a6bab0906edd9cb1dc585228cea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / compiled-0.3.0-cp312-cp312-musllinux_1_1_i686.whl
| Download URL | compiled-0.3.0-cp312-cp312-musllinux_1_1_i686.whl |
|---|---|
| Size | 650.7 kB |
| Tags | CPython 3.12 Linux musl 1.1+ x86-32 |
|
SHA-256 checksum How to use checksums |
210159a8f4f9b79b5f6ee5a27181f4ea41201f5a9bfeec5315c544c3279a9b43
|
|
BLAKE2b-256 checksum How to use checksums |
dcdd0d67add281095ac0171ff0b5856e5c795b1331491de27b1f04e86d371957
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / compiled-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | compiled-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 641.9 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
7c013d3ecfb5df707e62147133b394f70d86899bde58382aac447fe2d3e75fe8
|
|
BLAKE2b-256 checksum How to use checksums |
60e65d3e160f47ac2d96a74a85089aaefb5da226bd663a4639b5dac97b793b30
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / compiled-0.3.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
| Download URL | compiled-0.3.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl |
|---|---|
| Size | 664.1 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-32 Linux glibc 2.5+ x86-32 |
|
SHA-256 checksum How to use checksums |
58be75de75b01f4e7b55106dd7291a20216617fd94017eb40f2c9034550fb1a5
|
|
BLAKE2b-256 checksum How to use checksums |
53245fae96b075999146297ecb5f4cd6581ea4e8d1e467916366e9eaefd395e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / compiled-0.3.0-cp312-cp312-macosx_10_9_x86_64.whl
| Download URL | compiled-0.3.0-cp312-cp312-macosx_10_9_x86_64.whl |
|---|---|
| Size | 372.4 kB |
| Tags | CPython 3.12 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
3ee2eae122a50883846c8632fbeee73965edd652c2988e2acc2d278829bb29de
|
|
BLAKE2b-256 checksum How to use checksums |
fe145b18c437104ff774c648cfbf9df45d91d01ca890bb9492e356663814bc82
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / compiled-0.3.0-cp311-cp311-win_amd64.whl
| Download URL | compiled-0.3.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 281.7 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
140daff116ef6b60096e47baae53c31acf035f93464ef2e9d5afcb73ebaad9c7
|
|
BLAKE2b-256 checksum How to use checksums |
f1e5e61073ed03051fa679cfe657a410da517c581544aa981a2f3cfa89612471
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / compiled-0.3.0-cp311-cp311-win32.whl
| Download URL | compiled-0.3.0-cp311-cp311-win32.whl |
|---|---|
| Size | 241.5 kB |
| Tags | CPython 3.11 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
e25057a19a033a4fc9a6e8ebe7ab6255bab15ef5a3b657a47e555c5e1ccdbcdf
|
|
BLAKE2b-256 checksum How to use checksums |
546adbab8aef52f1074bbb73ce36106efc601cf6a219e2f7669b47b0eacf2713
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / compiled-0.3.0-cp311-cp311-musllinux_1_1_x86_64.whl
| Download URL | compiled-0.3.0-cp311-cp311-musllinux_1_1_x86_64.whl |
|---|---|
| Size | 601.5 kB |
| Tags | CPython 3.11 Linux musl 1.1+ x86-64 |
|
SHA-256 checksum How to use checksums |
9d950792149a50d6fccf0a131406790bb30252a9e38ee5d26c7f079738fe1c3f
|
|
BLAKE2b-256 checksum How to use checksums |
f1a26eaec2571ad93930a088440fbf22ee502394ea8e0fbd88cb8b2fd74145c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / compiled-0.3.0-cp311-cp311-musllinux_1_1_i686.whl
| Download URL | compiled-0.3.0-cp311-cp311-musllinux_1_1_i686.whl |
|---|---|
| Size | 604.2 kB |
| Tags | CPython 3.11 Linux musl 1.1+ x86-32 |
|
SHA-256 checksum How to use checksums |
b055093de480614806752c9552af53212a2bd4a230aa795b3fcf1a2f9a9623e6
|
|
BLAKE2b-256 checksum How to use checksums |
79b40644a32cd9e507d551c4a6f6fa262847f00d6452916f982f8440e0b4076b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / compiled-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | compiled-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 616.4 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
4e524ee0110a33f975753ba38060fe6913e77eb96c9c5e8c07f8ceb03713d2ee
|
|
BLAKE2b-256 checksum How to use checksums |
e2e2eeff2aa541ee90d4836a57589a7f62ac2a3031a7b7b0285fefdc406fcb91
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / compiled-0.3.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
| Download URL | compiled-0.3.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl |
|---|---|
| Size | 621.0 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-32 Linux glibc 2.5+ x86-32 |
|
SHA-256 checksum How to use checksums |
5bcd962214a2b12467d2a2a574670d293326015ebac4dc740d137c5295e35337
|
|
BLAKE2b-256 checksum How to use checksums |
317d25ee2c3813fc20d1cfaac71238d1e528ac06aa0989528b607269d48bffbb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / compiled-0.3.0-cp311-cp311-macosx_10_9_x86_64.whl
| Download URL | compiled-0.3.0-cp311-cp311-macosx_10_9_x86_64.whl |
|---|---|
| Size | 365.7 kB |
| Tags | CPython 3.11 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
eec5dc1302d3e906c73de786ecdd48bd190b3dde35dcbebda37a860c96c5ab40
|
|
BLAKE2b-256 checksum How to use checksums |
c6883df92dd0fc3b689d9f977468b579a287a815c37241cd929e4927c925582f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Security for compiled 0.3.0
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.