Skip to main content

No project description provided

Project description

TODO

  • Add README sections for release workflow

  • Use Sphinx: build docs for zoom-ability

  • Add note about configuring secrets

Is Python interpreted or compiled?

c2f.py

# cython: language_level=3
"Celsius to Fahrenheit Library"

def convert(celsius: float) -> float:
    "Convert Celsius to Fahrenheit"
    fahrenheit = celsius * 1.8 + 32
    return fahrenheit

setup.py

from setuptools import setup
from Cython.Build import cythonize

setup(
    name='c2f',
    version='0.0.0',
    py_modules=['c2f'],
    ext_modules=cythonize('c2f.py'),
)

c2f.cpython-38.pyc

>>> dis.dis(c2f.convert)
  6           0 LOAD_FAST                0 (celsius)
              2 LOAD_CONST               1 (1.8)
              4 BINARY_MULTIPLY
              6 LOAD_CONST               2 (32)
              8 BINARY_ADD
             10 STORE_FAST               1 (fahrenheit)
  7          12 LOAD_FAST                1 (fahrenheit)
             14 RETURN_VALUE

c2f.c

$ cython c2f.py
static PyObject * __pyx_pf_3c2f_convert(double __pyx_v_celsius) {
  double __pyx_v_fahrenheit;
  PyObject *__pyx_r = NULL;
  __pyx_v_fahrenheit = ((__pyx_v_celsius * 1.8) + 32.0);
  __pyx_r = PyFloat_FromDouble(__pyx_v_fahrenheit);
  return __pyx_r;
}

c2f.so

$ pip install wheel
$ python setup.py bdist_wheel
___pyx_pw_3c2f_1convert:
push   rbp
mov    rbp, rsp
sub    rsp, 16
movsd  xmm0, qword ptr [rbp - 8]
mulsd  xmm0, qword ptr [rip + 1379]
addsd  xmm0, qword ptr [rip + 1379]
call   502 <PyFloat_FromDouble ...>
add    rsp, 16
pop    rbp
ret

GitHub Workflow

Summmary

Is Python an interpreted or compiled language? Trick question. It’s actually both. With tools like Cython, we can take the compilation step further and remove the interpreter loop almost entirely. Cython produces binaries much like C++, Go, and Rust do. Now with GitHub Actions the cross-platform build and release process can be automated for free for Open Source projects. This is an enormous opportunity to make the Python ecosystem 20-50% faster with a single pull request. The lightning talk will walk through a GitHub workflow that publishes Cython-optimized wheels to PyPI. Discover how Cython can turbo-charge your Python code and GitHub Actions can simplify your cross-platform release process for free.

Appendix

$ gcc -g -shared -pthread -fPIC -fwrapv -O2 -Wall -fno-strict-aliasing -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -L/Library/Frameworks/Python.framework/Versions/3.8/lib -o c2f.so c2f.c -lpython3.8
$ objdump -S -df=___pyx_pw_3c2f_1convert c2f.so

Project details


Download files

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

Source Distribution

c2f-0.0.2.tar.gz (26.1 kB view details)

Uploaded Source

Built Distributions

c2f-0.0.2-cp38-cp38-win_amd64.whl (15.8 kB view details)

Uploaded CPython 3.8 Windows x86-64

c2f-0.0.2-cp38-cp38-manylinux2014_x86_64.whl (48.4 kB view details)

Uploaded CPython 3.8

c2f-0.0.2-cp38-cp38-manylinux1_x86_64.whl (48.4 kB view details)

Uploaded CPython 3.8

c2f-0.0.2-cp38-cp38-macosx_10_13_x86_64.whl (12.8 kB view details)

Uploaded CPython 3.8 macOS 10.13+ x86-64

c2f-0.0.2-cp37-cp37m-win_amd64.whl (15.6 kB view details)

Uploaded CPython 3.7m Windows x86-64

c2f-0.0.2-cp37-cp37m-manylinux2014_x86_64.whl (46.1 kB view details)

Uploaded CPython 3.7m

c2f-0.0.2-cp37-cp37m-manylinux1_x86_64.whl (46.1 kB view details)

Uploaded CPython 3.7m

c2f-0.0.2-cp37-cp37m-macosx_10_13_x86_64.whl (12.7 kB view details)

Uploaded CPython 3.7m macOS 10.13+ x86-64

c2f-0.0.2-cp36-cp36m-win_amd64.whl (20.1 kB view details)

Uploaded CPython 3.6m Windows x86-64

c2f-0.0.2-cp36-cp36m-manylinux2014_x86_64.whl (45.1 kB view details)

Uploaded CPython 3.6m

c2f-0.0.2-cp36-cp36m-manylinux1_x86_64.whl (45.1 kB view details)

Uploaded CPython 3.6m

c2f-0.0.2-cp36-cp36m-macosx_10_13_x86_64.whl (12.7 kB view details)

Uploaded CPython 3.6m macOS 10.13+ x86-64

c2f-0.0.2-cp35-cp35m-manylinux2014_x86_64.whl (44.4 kB view details)

Uploaded CPython 3.5m

c2f-0.0.2-cp35-cp35m-manylinux1_x86_64.whl (44.4 kB view details)

Uploaded CPython 3.5m

c2f-0.0.2-cp35-cp35m-macosx_10_13_x86_64.whl (12.5 kB view details)

Uploaded CPython 3.5m macOS 10.13+ x86-64

File details

Details for the file c2f-0.0.2.tar.gz.

File metadata

  • Download URL: c2f-0.0.2.tar.gz
  • Upload date:
  • Size: 26.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.8.0

File hashes

Hashes for c2f-0.0.2.tar.gz
Algorithm Hash digest
SHA256 05b0c597d4ce7d41354c881e8b5d85a00384fb896d1bfc495da063cfa0d574b7
MD5 3bf1d621a5537e715e75a9c0f1e3ea93
BLAKE2b-256 ac7ecf9353dea58519c8c7818f6b592422a5d14f1f44effe30048cc38e2344a5

See more details on using hashes here.

File details

Details for the file c2f-0.0.2-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: c2f-0.0.2-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.8.0

File hashes

Hashes for c2f-0.0.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 8930945f08f2d857bb9c52b7074509e831d6c9a232432c68c2010682c5dba48a
MD5 7a321002610777393964af06a409ca3a
BLAKE2b-256 0a1709ea664cd1ef68b7df5e2201d57ac3f31585d715db866f39ba331c939804

See more details on using hashes here.

File details

Details for the file c2f-0.0.2-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

  • Download URL: c2f-0.0.2-cp38-cp38-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 48.4 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.8.0

File hashes

Hashes for c2f-0.0.2-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 aee576c220b5993b7094f554df9e69775df63d8b13b9c74805ada5b7ab49ea39
MD5 e9e775b406b5246830bad7e85ea3d530
BLAKE2b-256 eec4172cdf9f68de93b1a80bb474b960973f8c26635bf86c91f54d67d558024c

See more details on using hashes here.

File details

Details for the file c2f-0.0.2-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: c2f-0.0.2-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 48.4 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.8.0

File hashes

Hashes for c2f-0.0.2-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7848d903aa23571f474bba435583748c03c5cff50f354502a7e2ac94d905e8ac
MD5 42299b5fbe3359f9f36121a92a5a7df1
BLAKE2b-256 7d72d1eda8c6a7053ec98070828f3efba1b8e876e4125f131ed1f4418eb2ba65

See more details on using hashes here.

File details

Details for the file c2f-0.0.2-cp38-cp38-macosx_10_13_x86_64.whl.

File metadata

  • Download URL: c2f-0.0.2-cp38-cp38-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: CPython 3.8, macOS 10.13+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.8.0

File hashes

Hashes for c2f-0.0.2-cp38-cp38-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 aab698483ea97bb938e9fd62a4caa8525bcd9daa5960cef1d00acba91ce68b19
MD5 f678c3dc282c806855d7541db114b322
BLAKE2b-256 a0c3cc1b91452cdbe3b6afaa2fd210a1bbfbeea9c63e5a56d4c806aae2f06e17

See more details on using hashes here.

File details

Details for the file c2f-0.0.2-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: c2f-0.0.2-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 15.6 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.8.0

File hashes

Hashes for c2f-0.0.2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 3bf3ac4008e1b9ff635127111d2f0f652c632fdad92d11d5592b0a464f608d49
MD5 6f3f190e58ccc1728aa972bfca24dc73
BLAKE2b-256 e24c784f8626d5a4448108f0fd5620d11092193cc15522b5e988bd97d029ac8d

See more details on using hashes here.

File details

Details for the file c2f-0.0.2-cp37-cp37m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: c2f-0.0.2-cp37-cp37m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 46.1 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.8.0

File hashes

Hashes for c2f-0.0.2-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2f44c823b6626d2b16eb7b4b0570d977024b016b047bdc576c4a151ae874db01
MD5 f15b274b95337bbb4c0620c06f3b63eb
BLAKE2b-256 c003034d5541903fe9c1ff834816a3a3793ac1e2749da224f78c45b2e0414ac3

See more details on using hashes here.

File details

Details for the file c2f-0.0.2-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: c2f-0.0.2-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 46.1 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.8.0

File hashes

Hashes for c2f-0.0.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b8c445598a5207a33f3d8738ef71fc07a3b7d0f57fc993e8d83a00015cba663e
MD5 ccf597ae4365d5c82dd9c44324b31ce2
BLAKE2b-256 da17da4765a5243beb948c42d6f81f4fea710a8ff507835f9a6a0198ba33a720

See more details on using hashes here.

File details

Details for the file c2f-0.0.2-cp37-cp37m-macosx_10_13_x86_64.whl.

File metadata

  • Download URL: c2f-0.0.2-cp37-cp37m-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: CPython 3.7m, macOS 10.13+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.8.0

File hashes

Hashes for c2f-0.0.2-cp37-cp37m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 2c5300981897b7275192ec6567212d14a767203799ae9c3dd2fdd81b01fd5cdb
MD5 222e545ba95d1d1ef510950a1d7909d1
BLAKE2b-256 fbb3d5a2d86b5b6d972cc92e31e451a18f9bcb52de456177bcd5e4749b22b64e

See more details on using hashes here.

File details

Details for the file c2f-0.0.2-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: c2f-0.0.2-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 20.1 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.8.0

File hashes

Hashes for c2f-0.0.2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 8075583c588696ae241344fd35938f2d496d377c86cb64ad1abc450a40666dea
MD5 7b69a70c1470be21865a9c61a0e46b24
BLAKE2b-256 9051f04e9eb76a194fdcee0573d3c466a7d83d38d5e6545fd0ac8c2cf64aa05a

See more details on using hashes here.

File details

Details for the file c2f-0.0.2-cp36-cp36m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: c2f-0.0.2-cp36-cp36m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 45.1 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.8.0

File hashes

Hashes for c2f-0.0.2-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 09ffad9493320cb82fc1783f3bda06278b88d6248f8b8204690b579f074408c7
MD5 d0a6182168bfd287d8905cdf2eca72b1
BLAKE2b-256 7cbed6033d91015772de11ed08cac0822008366ca6afb4918ef81bdc11f4c67a

See more details on using hashes here.

File details

Details for the file c2f-0.0.2-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: c2f-0.0.2-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 45.1 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.8.0

File hashes

Hashes for c2f-0.0.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 bc6b65129b9348efcd3def16284f7932f6387fa28612949bb3157495dcd7b31e
MD5 32a561e68fe1b7fac95509f29187d874
BLAKE2b-256 5a7364fd1c5aa6a83f4d86dbcb1977945f2faca7e58ed2a34173a8af5e79e82e

See more details on using hashes here.

File details

Details for the file c2f-0.0.2-cp36-cp36m-macosx_10_13_x86_64.whl.

File metadata

  • Download URL: c2f-0.0.2-cp36-cp36m-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: CPython 3.6m, macOS 10.13+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.8.0

File hashes

Hashes for c2f-0.0.2-cp36-cp36m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 ca234ff209fa274cae85894511f32b834fc9973902ebf8030a87fd912222fef8
MD5 741d3eca7d1f46c190f71d44f83c782e
BLAKE2b-256 a753d10119282e7b9f370a5c26f7116f6ae07417a8aa418f17208ed840b38fc3

See more details on using hashes here.

File details

Details for the file c2f-0.0.2-cp35-cp35m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: c2f-0.0.2-cp35-cp35m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 44.4 kB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.8.0

File hashes

Hashes for c2f-0.0.2-cp35-cp35m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4e5a9466844bd06acfd3e3f39f47c823f35424352e48c5f820c4a0cf3fa1da92
MD5 8e362ea95bd2cb46660cc8fc451b8d29
BLAKE2b-256 6634b85e269c60c0c516f8288db82524563410a21732db8a6f3bf6fee484ebd4

See more details on using hashes here.

File details

Details for the file c2f-0.0.2-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

  • Download URL: c2f-0.0.2-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 44.4 kB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.8.0

File hashes

Hashes for c2f-0.0.2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 401b8d7e572172fa5560dd5e6fc8b42b70677f51fe7486b862dab8e35d31c1f1
MD5 d685e4579fa4a3a83dde9efba2d3851c
BLAKE2b-256 5faac1347c28104616cd2b97a628d1de9564a1decd82eed12e163ae11dd69ecb

See more details on using hashes here.

File details

Details for the file c2f-0.0.2-cp35-cp35m-macosx_10_13_x86_64.whl.

File metadata

  • Download URL: c2f-0.0.2-cp35-cp35m-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: CPython 3.5m, macOS 10.13+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.8.0

File hashes

Hashes for c2f-0.0.2-cp35-cp35m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 2e8efe4a1addd3960127f3524bf9fcd8b5467cfaad538f22bed6dff37fa31ed8
MD5 30396b0aa99dc41cafb196a25d5009ea
BLAKE2b-256 01668b76798642f57d5f1198f84138b915850186c5d783ee8b9dffa1893373e8

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