Skip to main content

A statically-typed authoring language that compiles to standard Python

Project description

TypePython

A statically-typed authoring language that compiles to standard Python.

TypePython lets you write .tpy source files with features such as interface, data class, sealed class, inline generics, and strict null safety. The compiler emits standard .py and .pyi files that run on ordinary Python interpreters and type-check with mypy or pyright.

Install

pip install type-python
typepython --help

Published wheels are platform-specific because they bundle the Rust CLI binary. Supported releases publish prebuilt wheels for Windows AMD64, macOS x86_64, macOS arm64, and Linux x86_64, so those platforms can install and run TypePython without Rust. Other platforms fall back to the source distribution and require a Rust toolchain with cargo.

The Python package bridge supports Python 3.9+. Generated TypePython projects currently target Python 3.10, 3.11, or 3.12.

Quick Start

Create a project:

typepython init --dir my-project
cd my-project
typepython check --project .
typepython build --project .

Example source:

sealed class Expr:
    pass

data class Num(Expr):
    value: int

data class Add(Expr):
    left: Expr
    right: Expr

def evaluate(expr: Expr) -> int:
    match expr:
        case Num(value=v):
            return v
        case Add(left=l, right=r):
            return evaluate(l) + evaluate(r)

What You Get

  • Standard .py and .pyi output with no custom runtime
  • Type system features such as unknown, strict nulls, sealed exhaustiveness, TypedDict utilities, and generic defaults
  • CLI commands for init, check, build, watch, clean, verify, lsp, and migrate
  • Interoperability with standard Python typing tools and package publishing workflows

Documentation

Project 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 Distribution

type_python-0.1.0.tar.gz (925.4 kB view details)

Uploaded Source

Built Distributions

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

type_python-0.1.0-py3-none-win_amd64.whl (4.2 MB view details)

Uploaded Python 3Windows x86-64

type_python-0.1.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (4.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

type_python-0.1.0-py3-none-macosx_11_0_arm64.whl (3.9 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

type_python-0.1.0-py3-none-macosx_10_13_x86_64.whl (4.2 MB view details)

Uploaded Python 3macOS 10.13+ x86-64

File details

Details for the file type_python-0.1.0.tar.gz.

File metadata

  • Download URL: type_python-0.1.0.tar.gz
  • Upload date:
  • Size: 925.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for type_python-0.1.0.tar.gz
Algorithm Hash digest
SHA256 547c9d8f9d2f2d6fc84e88a9ce025cf3413857008720d2de453f85a914a25cd6
MD5 68c08f9189bace56e33e7425f62498f7
BLAKE2b-256 e22b3537f16526a0a7763c8e6fd5184209cd7a0a21a2b63cf46b5832246e3492

See more details on using hashes here.

Provenance

The following attestation bundles were made for type_python-0.1.0.tar.gz:

Publisher: publish.yml on type-python/type-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file type_python-0.1.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: type_python-0.1.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 4.2 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for type_python-0.1.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 eee623f5b976e4e71a0e92e649689538a05db5aaa3bb931686b88fdee567eb39
MD5 6e7db7de69f122b35446f68b87480c11
BLAKE2b-256 df8290a18e037383f278fee99290268c2b3f165db883abbd9e97d03ee25f00e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for type_python-0.1.0-py3-none-win_amd64.whl:

Publisher: publish.yml on type-python/type-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file type_python-0.1.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for type_python-0.1.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 6a694009859803e50984872827198e5467ad742a638db0bb74ce739230c23ed1
MD5 38af04b369758bbfd88056414e9d051f
BLAKE2b-256 b1494f1dc386fc76f1ac587d0bdfd5636a7be34f2053e107acaa95c6a23bb7d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for type_python-0.1.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl:

Publisher: publish.yml on type-python/type-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file type_python-0.1.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for type_python-0.1.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4b94a40dc74f8a08868e40f26baea6a99f00d7357e8cb25a629205ae0645446d
MD5 6af040863ede15a89afe89a40ddafd16
BLAKE2b-256 a8662abdee1aca0431fc3429fff5577dbb579a414a24f47c50348200bee2f8e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for type_python-0.1.0-py3-none-macosx_11_0_arm64.whl:

Publisher: publish.yml on type-python/type-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file type_python-0.1.0-py3-none-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for type_python-0.1.0-py3-none-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 6ef69b333bbb5428b94c200230e80248dc6eb298d2314c884d6e5bf3a6292f49
MD5 42ddbb07402b1604aafd6f57e09854c5
BLAKE2b-256 a0fac8bcf4f3828b1b6a1369047ab79ed1eb6900188e60bf8ac5fc343f887941

See more details on using hashes here.

Provenance

The following attestation bundles were made for type_python-0.1.0-py3-none-macosx_10_13_x86_64.whl:

Publisher: publish.yml on type-python/type-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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