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
.pyand.pyioutput with no custom runtime - Type system features such as
unknown, strict nulls, sealed exhaustiveness,TypedDictutilities, and generic defaults - CLI commands for
init,check,build,watch,clean,verify,lsp, andmigrate - Interoperability with standard Python typing tools and package publishing workflows
Documentation
- Getting started: https://github.com/type-python/type-python/blob/main/docs/getting-started.md
- Syntax guide: https://github.com/type-python/type-python/blob/main/docs/syntax-guide.md
- Type system: https://github.com/type-python/type-python/blob/main/docs/type-system.md
- Configuration: https://github.com/type-python/type-python/blob/main/docs/configuration.md
- CLI reference: https://github.com/type-python/type-python/blob/main/docs/cli-reference.md
- Interoperability: https://github.com/type-python/type-python/blob/main/docs/interop.md
- Language spec: https://github.com/type-python/type-python/blob/main/docs/spec/language-spec-v1.md
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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
547c9d8f9d2f2d6fc84e88a9ce025cf3413857008720d2de453f85a914a25cd6
|
|
| MD5 |
68c08f9189bace56e33e7425f62498f7
|
|
| BLAKE2b-256 |
e22b3537f16526a0a7763c8e6fd5184209cd7a0a21a2b63cf46b5832246e3492
|
Provenance
The following attestation bundles were made for type_python-0.1.0.tar.gz:
Publisher:
publish.yml on type-python/type-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
type_python-0.1.0.tar.gz -
Subject digest:
547c9d8f9d2f2d6fc84e88a9ce025cf3413857008720d2de453f85a914a25cd6 - Sigstore transparency entry: 1279678753
- Sigstore integration time:
-
Permalink:
type-python/type-python@300854d2941ac4747c99e3cb0c5886694e82cd04 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/type-python
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@300854d2941ac4747c99e3cb0c5886694e82cd04 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eee623f5b976e4e71a0e92e649689538a05db5aaa3bb931686b88fdee567eb39
|
|
| MD5 |
6e7db7de69f122b35446f68b87480c11
|
|
| BLAKE2b-256 |
df8290a18e037383f278fee99290268c2b3f165db883abbd9e97d03ee25f00e8
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
type_python-0.1.0-py3-none-win_amd64.whl -
Subject digest:
eee623f5b976e4e71a0e92e649689538a05db5aaa3bb931686b88fdee567eb39 - Sigstore transparency entry: 1279678812
- Sigstore integration time:
-
Permalink:
type-python/type-python@300854d2941ac4747c99e3cb0c5886694e82cd04 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/type-python
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@300854d2941ac4747c99e3cb0c5886694e82cd04 -
Trigger Event:
release
-
Statement type:
File details
Details for the file type_python-0.1.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.
File metadata
- Download URL: type_python-0.1.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
- Upload date:
- Size: 4.3 MB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a694009859803e50984872827198e5467ad742a638db0bb74ce739230c23ed1
|
|
| MD5 |
38af04b369758bbfd88056414e9d051f
|
|
| BLAKE2b-256 |
b1494f1dc386fc76f1ac587d0bdfd5636a7be34f2053e107acaa95c6a23bb7d6
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
type_python-0.1.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl -
Subject digest:
6a694009859803e50984872827198e5467ad742a638db0bb74ce739230c23ed1 - Sigstore transparency entry: 1279678780
- Sigstore integration time:
-
Permalink:
type-python/type-python@300854d2941ac4747c99e3cb0c5886694e82cd04 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/type-python
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@300854d2941ac4747c99e3cb0c5886694e82cd04 -
Trigger Event:
release
-
Statement type:
File details
Details for the file type_python-0.1.0-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: type_python-0.1.0-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 3.9 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b94a40dc74f8a08868e40f26baea6a99f00d7357e8cb25a629205ae0645446d
|
|
| MD5 |
6af040863ede15a89afe89a40ddafd16
|
|
| BLAKE2b-256 |
a8662abdee1aca0431fc3429fff5577dbb579a414a24f47c50348200bee2f8e7
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
type_python-0.1.0-py3-none-macosx_11_0_arm64.whl -
Subject digest:
4b94a40dc74f8a08868e40f26baea6a99f00d7357e8cb25a629205ae0645446d - Sigstore transparency entry: 1279678866
- Sigstore integration time:
-
Permalink:
type-python/type-python@300854d2941ac4747c99e3cb0c5886694e82cd04 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/type-python
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@300854d2941ac4747c99e3cb0c5886694e82cd04 -
Trigger Event:
release
-
Statement type:
File details
Details for the file type_python-0.1.0-py3-none-macosx_10_13_x86_64.whl.
File metadata
- Download URL: type_python-0.1.0-py3-none-macosx_10_13_x86_64.whl
- Upload date:
- Size: 4.2 MB
- Tags: Python 3, macOS 10.13+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ef69b333bbb5428b94c200230e80248dc6eb298d2314c884d6e5bf3a6292f49
|
|
| MD5 |
42ddbb07402b1604aafd6f57e09854c5
|
|
| BLAKE2b-256 |
a0fac8bcf4f3828b1b6a1369047ab79ed1eb6900188e60bf8ac5fc343f887941
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
type_python-0.1.0-py3-none-macosx_10_13_x86_64.whl -
Subject digest:
6ef69b333bbb5428b94c200230e80248dc6eb298d2314c884d6e5bf3a6292f49 - Sigstore transparency entry: 1279678838
- Sigstore integration time:
-
Permalink:
type-python/type-python@300854d2941ac4747c99e3cb0c5886694e82cd04 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/type-python
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@300854d2941ac4747c99e3cb0c5886694e82cd04 -
Trigger Event:
release
-
Statement type: