Skip to main content

svst

Python Version Stable Version Downloads Documentation Status Checked with mypy Code style: black Linting: ruff Uses: ast

Standalone Variables Static Typing

A full-on approach to Python static type checking.

Why?

Python is an amazing programming language; used to be my favorite one for a lot of reasons. With the broad functionality, ease of use, development speed, and friendly community; I could be here all day saying good things about it.

One of the major selling points the dynamic typing, at least initially.

When you start scaling Python and using it on huge projects dealing with a lot of different entities and flows you can make a mistake and find the pitfall of not knowing why your variable is not behaving as you wish it was; between other issues (if you try to statically type an existing codebase with mypy you'll find how bad your code is in terms of type consistency; at least that happened to me).

After fixing a huge mess I wanted to go a step further and not only enforce the typing of functions/classes input and output but to type my standalone variables as well until I found that mypy doesn't check that because his goal is to find the balance between dynamic and static typing; I wanted to go full-on static.

At first, I created a simple file to do this, but soon I found that I needed a proper implementation of this to spread to all my projects and possibly help the community.

I'd like to extend immense gratitude to @alphasensei for pioneering the research and developing the initial proof of concept for this library.

This is an attempt of bringing full-on static typing to Python and, with it, much more robust codebases.

For the core functionality svst uses Abstract Syntax Trees.

Quick start

Svst can be installed using pip:

python3 -m pip install -U svst

You can type-check the standalone variables of a program like this:

svst DIRECTORY_OR_FILE

You can type-check a program including the mypy functionality like this as well:

svst --mypy DIRECTORY_OR_FILE

You can run a simple check hiding the errors:

svst --mypy --check DIRECTORY_OR_FILE

Intended Integrations [WiP]

  • Vim
  • PyCharm
  • VS Code
  • pre-commit

Documentation [WiP]

svst.readthedocs.org

Contributing

As you can see this project is still in pretty rough shape and a lot of improvement can be done.

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".

Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the Mozilla Public License Version 2.0. See LICENSE for more information.

Metadata

Release files for svst 0.1.16

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for svst 0.1.16
File Size Uploaded Provenance Actions
svst-0.1.16.tar.gz 17.4 kB Without provenance Details for svst-0.1.16.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for svst 0.1.16
File Interpreter ABI Platform Actions
svst-0.1.16-py3-none-any.whl Python 3 none any Details for svst-0.1.16-py3-none-any.whl

Total release size: 34.1 kB

Release files / svst-0.1.16.tar.gz

Download URL svst-0.1.16.tar.gz
Size 17.4 kB
Tags Source
SHA-256 checksum
How to use checksums
de33fef6a0f5b255f7781d9632d929169972c0ba6d3d8ec6018b779b10e33cff
BLAKE2b-256 checksum
How to use checksums
6618db2665756566e4b28637fd0e6cd0432f07cb2bab2414acf1b849190c8254
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release files / svst-0.1.16-py3-none-any.whl

Download URL svst-0.1.16-py3-none-any.whl
Size 16.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7cccc705c8d323fc907750e6d882756f054a12fd576880597198bea1645513f6
BLAKE2b-256 checksum
How to use checksums
cc55f3186fc7c903cc6c60925566b5bf49143d612e63225c1554108310fd0ad5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Security for svst 0.1.16

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page