Skip to main content

Compiled versions of the Python standard library.

Project description

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_tests to run tests.

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 Distributions

compiled-0.3.0-cp312-cp312-win_amd64.whl (282.2 kB view details)

Uploaded CPython 3.12 Windows x86-64

compiled-0.3.0-cp312-cp312-win32.whl (244.8 kB view details)

Uploaded CPython 3.12 Windows x86

compiled-0.3.0-cp312-cp312-musllinux_1_1_x86_64.whl (630.1 kB view details)

Uploaded CPython 3.12 musllinux: musl 1.1+ x86-64

compiled-0.3.0-cp312-cp312-musllinux_1_1_i686.whl (650.7 kB view details)

Uploaded CPython 3.12 musllinux: musl 1.1+ i686

compiled-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (641.9 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

compiled-0.3.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (664.1 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

compiled-0.3.0-cp312-cp312-macosx_10_9_x86_64.whl (372.4 kB view details)

Uploaded CPython 3.12 macOS 10.9+ x86-64

compiled-0.3.0-cp311-cp311-win_amd64.whl (281.7 kB view details)

Uploaded CPython 3.11 Windows x86-64

compiled-0.3.0-cp311-cp311-win32.whl (241.5 kB view details)

Uploaded CPython 3.11 Windows x86

compiled-0.3.0-cp311-cp311-musllinux_1_1_x86_64.whl (601.5 kB view details)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

compiled-0.3.0-cp311-cp311-musllinux_1_1_i686.whl (604.2 kB view details)

Uploaded CPython 3.11 musllinux: musl 1.1+ i686

compiled-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (616.4 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

compiled-0.3.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (621.0 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

compiled-0.3.0-cp311-cp311-macosx_10_9_x86_64.whl (365.7 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

File details

Details for the file compiled-0.3.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: compiled-0.3.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 282.2 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for compiled-0.3.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 cd06d9909d752f16ce90617f4a0204968f5c4975425d83f68a901746d58c524d
MD5 77c30a80228bb8935a552f74bef022af
BLAKE2b-256 3505395e7e2c63f859c5ffac46fd9d1b2feae13e6942f026558df33e5d47a251

See more details on using hashes here.

File details

Details for the file compiled-0.3.0-cp312-cp312-win32.whl.

File metadata

  • Download URL: compiled-0.3.0-cp312-cp312-win32.whl
  • Upload date:
  • Size: 244.8 kB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for compiled-0.3.0-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 25e4c2eff101c1a9f537828fd6ff5ff87e88c3ac4119fd30bafa25c44a35f767
MD5 bd2935fb0b1899d9cb34377567bbe1ac
BLAKE2b-256 e72f53438983eab774c5ff02ad85143c826fb5c8f40c91c38791bd1f9a9ea609

See more details on using hashes here.

File details

Details for the file compiled-0.3.0-cp312-cp312-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for compiled-0.3.0-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 1eac787a73cf913206e10d81c5b7433d8978f28cf9a3726927a5931f18fefd1d
MD5 7baae55fdf95bee5c4bdc9101e1fc61f
BLAKE2b-256 95242580333c221b42f0d732c6c403653c836a6bab0906edd9cb1dc585228cea

See more details on using hashes here.

File details

Details for the file compiled-0.3.0-cp312-cp312-musllinux_1_1_i686.whl.

File metadata

File hashes

Hashes for compiled-0.3.0-cp312-cp312-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 210159a8f4f9b79b5f6ee5a27181f4ea41201f5a9bfeec5315c544c3279a9b43
MD5 3df472c54e4f41c570ecbf8ec22c26d1
BLAKE2b-256 dcdd0d67add281095ac0171ff0b5856e5c795b1331491de27b1f04e86d371957

See more details on using hashes here.

File details

Details for the file compiled-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for compiled-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7c013d3ecfb5df707e62147133b394f70d86899bde58382aac447fe2d3e75fe8
MD5 44a023e929eeaa25ce7635df21fb69e7
BLAKE2b-256 60e65d3e160f47ac2d96a74a85089aaefb5da226bd663a4639b5dac97b793b30

See more details on using hashes here.

File details

Details for the file compiled-0.3.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for compiled-0.3.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 58be75de75b01f4e7b55106dd7291a20216617fd94017eb40f2c9034550fb1a5
MD5 2e3d3eb220f58615d5fe2ac3bd893152
BLAKE2b-256 53245fae96b075999146297ecb5f4cd6581ea4e8d1e467916366e9eaefd395e1

See more details on using hashes here.

File details

Details for the file compiled-0.3.0-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for compiled-0.3.0-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3ee2eae122a50883846c8632fbeee73965edd652c2988e2acc2d278829bb29de
MD5 fef63bb7ac1517a3f524aff13a68635d
BLAKE2b-256 fe145b18c437104ff774c648cfbf9df45d91d01ca890bb9492e356663814bc82

See more details on using hashes here.

File details

Details for the file compiled-0.3.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: compiled-0.3.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 281.7 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for compiled-0.3.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 140daff116ef6b60096e47baae53c31acf035f93464ef2e9d5afcb73ebaad9c7
MD5 280aab477e912bac38c5c1183c5c95e3
BLAKE2b-256 f1e5e61073ed03051fa679cfe657a410da517c581544aa981a2f3cfa89612471

See more details on using hashes here.

File details

Details for the file compiled-0.3.0-cp311-cp311-win32.whl.

File metadata

  • Download URL: compiled-0.3.0-cp311-cp311-win32.whl
  • Upload date:
  • Size: 241.5 kB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for compiled-0.3.0-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 e25057a19a033a4fc9a6e8ebe7ab6255bab15ef5a3b657a47e555c5e1ccdbcdf
MD5 c32d2f114ce5f31e0dca092e597d4e87
BLAKE2b-256 546adbab8aef52f1074bbb73ce36106efc601cf6a219e2f7669b47b0eacf2713

See more details on using hashes here.

File details

Details for the file compiled-0.3.0-cp311-cp311-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for compiled-0.3.0-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 9d950792149a50d6fccf0a131406790bb30252a9e38ee5d26c7f079738fe1c3f
MD5 134d5afd257a924668172abd71362dfa
BLAKE2b-256 f1a26eaec2571ad93930a088440fbf22ee502394ea8e0fbd88cb8b2fd74145c9

See more details on using hashes here.

File details

Details for the file compiled-0.3.0-cp311-cp311-musllinux_1_1_i686.whl.

File metadata

File hashes

Hashes for compiled-0.3.0-cp311-cp311-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 b055093de480614806752c9552af53212a2bd4a230aa795b3fcf1a2f9a9623e6
MD5 0abd804034a9f6bbec453ed4e0aa17ee
BLAKE2b-256 79b40644a32cd9e507d551c4a6f6fa262847f00d6452916f982f8440e0b4076b

See more details on using hashes here.

File details

Details for the file compiled-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for compiled-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4e524ee0110a33f975753ba38060fe6913e77eb96c9c5e8c07f8ceb03713d2ee
MD5 57ec4237e6bd4c29be7bb6b712734760
BLAKE2b-256 e2e2eeff2aa541ee90d4836a57589a7f62ac2a3031a7b7b0285fefdc406fcb91

See more details on using hashes here.

File details

Details for the file compiled-0.3.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for compiled-0.3.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 5bcd962214a2b12467d2a2a574670d293326015ebac4dc740d137c5295e35337
MD5 78bb943588c554be790b8bec6e8a528d
BLAKE2b-256 317d25ee2c3813fc20d1cfaac71238d1e528ac06aa0989528b607269d48bffbb

See more details on using hashes here.

File details

Details for the file compiled-0.3.0-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for compiled-0.3.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 eec5dc1302d3e906c73de786ecdd48bd190b3dde35dcbebda37a860c96c5ab40
MD5 a76eba90c46a3bcee4fb6e34dc34c889
BLAKE2b-256 c6883df92dd0fc3b689d9f977468b579a287a815c37241cd929e4927c925582f

See more details on using hashes here.

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