Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression. Learn more →
Top 23 Python Typing Projects
Optional static typing for PythonProject mention: CS176a and Research Advice | reddit.com/r/UCSantaBarbara | 2023-03-24
I'll try to address both of your replies, sorry for the wait. You should be comfortable with The Python Tutorial -- everything through Chapter 9 is really useful. Python is a good language to know for rapidly getting your ideas into the computer, for programming interviews and festive things like Advent of Code. I really recommend getting comfortable with Python's type annotations and a type checker like mypy. It will save you a lot of headache.
A static type analyzer for Python codeProject mention: The Python Paradox | news.ycombinator.com | 2023-01-26
Check out https://github.com/google/pytype
Access the most powerful time series database as a service. Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.
Collection of library stubs for Python, with static typesProject mention: Ask HN: Will we see a TypeScript for Python? | news.ycombinator.com | 2023-02-26
https://github.com/python/typeshed is Python's equivalent of DefinitelyTyped. I'm not 100% sure why it's not more of a popular thing the way DefinitelyTyped is; I think there might, to some extent, be different attitudes around the appropriateness of having third-party typings for packages, when the actual maintainer of the package isn't interested in providing first-party ones.
Python TUI framework with mouse support, modular widget system, customizable and rapid terminal markup language and more!Project mention: Any Good Recommendations for a Tutorial on PyTermGUI? | reddit.com/r/commandline | 2022-09-24
Talking about resources, their docs are pretty good and contains some examples too. Documentation: https://ptg.bczsalba.com/pytermgui.html
Python static typing home. Hosts the documentation and a user help forum.Project mention: Library for single dispatch on Generic subscript | reddit.com/r/learnpython | 2023-02-09
Type annotations and dynamic checking for a tensor's shape, dtype, names, etc.Project mention: [D] Have their been any attempts to create a programming language specifically for machine learning? | reddit.com/r/MachineLearning | 2023-02-11
Not really an answer to your question, but there are Python packages that try to solve the problem of tensor shapes that you mentioned, e.g. https://github.com/patrick-kidger/torchtyping or https://github.com/deepmind/tensor_annotations
Prisma Client Python is an auto-generated and fully type-safe database client designed for ease of useProject mention: Alternatives to SQLAlchemy for your project - Prisma case | dev.to | 2022-08-08
Anyway, prisma is a relatively new project, and it is very pleasant to use. I encourage you to give it a try and support the python client (at least a star on GitHub). For me who doesn't like SQL, being able to retrieve models from the database and make queries with prisma is a breath of fresh air. 🤣
Write Clean Python Code. Always.. Sonar helps you commit clean code every time. With over 225 unique rules to find Python bugs, code smells & vulnerabilities, Sonar finds the issues while you focus on the work.
A typing application to level up your fingers!Project mention: how to fix settings button missing from top bar drop-down | reddit.com/r/pop_os | 2022-08-03
Python 3.5+ runtime type checking for integration testing and data validationProject mention: Python’s “Type Hints” are a bit of a disappointment to me | news.ycombinator.com | 2022-04-21
Every point in this blog post strikes me as either (1) unaware of the tooling around python typing other than mypy, or (2) a criticism of static-typing-bolted-on-to-a-dynamically-typed-language, rather than Python's hints. Regarding (1), my advise to OP is to try out Pyright, Pydantic, and Typeguard. Pyright, especailly, is amazing and makes the process of working with type hints 2 or 3 times smoother IMO. And, I don't think points that fall under (2) are fair criticisms of type *hints*. They are called hints for a reason.
Otherwise, here's a point-by-point response, either recommending OP checks out tooling, or showing that the point being made is not specific to Python.
> type hints are not binding.
There are projects  that allow you to enforce type hints at runtime if you so choose.
It's worth mentioning that this is very analogous to how Typescript does it, in that type info is erased completely at runtime.
> Type checking is your job after all, ...[and that] requires maintenance.
There are LSPs like Pyright (pyright specifically is the absolute best, IMO) that report type errors as you code. Again, this is very very similar to typescript.
> There is an Any type and it renders everything useless
I have never seen a static-typing tool that was bolted on to a dynamically typed language, without an `Any` type, including typescript.
> Duck type compatibility of int and float
The author admits that they cannot state why this behavior is problematic, except for saying that it's "ambiguous".
> Most projects need third-party type hints
Again, this is a criticism of all cases where static types are bolted on dynamically typed languages, not Python's implementation specifically.
> Sadly, dataclasses ignore type hints as well
Pydantic is an amazing data parsing library that takes advantage of type hints, and it's interface is a superset of that of dataclasses. What's more, it underpins FastAPI, an amazing API-backend framework (with 44K Github stars).
> Type inference and lazy programmers
The argument of this section boils down to using `Any` as a generic argument not being an error by default. This is configurable to be an error both in Pyright, and mypy.
> Exceptions are not covered [like Java]
I can't find the interview/presentation, but Guido Van Rossum specifically calls out Java's implementation of "exception annotations" as a demonstration of why that is a bad idea, and that it would never happen in Python. I'm not saying Guido's opinion is the absolute truth, but just letting you know that this is an explicit decision, not an unwanted shortcoming.
Mypy plugin and stubs for SQLAlchemyProject mention: Welcome to hassle free coding | reddit.com/r/ProgrammerHumor | 2022-05-28
SQL Alchemy: https://github.com/dropbox/sqlalchemy-stubs
Design by contract for Python. Write bug-free code. Add a few decorators, get static analysis and tests for free.Project mention: What features would you want in a new programming language? | reddit.com/r/ProgrammingLanguages | 2023-01-03
I started using a design by contract library for a Python project this year and it made my code safer and easier to use.
Type annotations and runtime checking for shape and dtype of JAX arrays, and PyTrees.Project mention: [D] Have their been any attempts to create a programming language specifically for machine learning? | reddit.com/r/MachineLearning | 2023-02-11
Heads-up that my newer jaxtyping project now exists.
Command line tool for improving typing skills (programmers friendly)Project mention: Practice typing by retyping ENTIRE novels | news.ycombinator.com | 2023-01-01
https://github.com/jankrepl/mltype is something like this. It is tuned for programmers though. And the quality of generated text might vary a lot. But it gives reasonable char sequences.
Typed argument parser for PythonProject mention: I am sick of writing argparse boilerplate code, so I made "duckargs" to do it for me | reddit.com/r/Python | 2023-03-03
Hmm… did you try such approaches, as [click](https://github.com/pallets/click) or[tap](https://github.com/swansonk14/typed-argument-parser)?
Runtime inspection utilities for Python typing module
Python library to load dynamically typed data into statically typed data structuresProject mention: Show HN: Up to 100x Faster FastAPI with simdjson and io_uring on Linux 5.19 | news.ycombinator.com | 2023-03-06
Author of typedload here!
FastAPI relies on (not so fast) pydantic, which is one of the slowest libraries in that category.
Don't expect to find such benchmarks on the pydantic documentation itself, but the competing libraries will have them.
Utilities for run-time type validation and multiple dispatch
Phantom types for Python.Project mention: Sunday Daily Thread: What's everyone working on this week? | reddit.com/r/Python | 2022-10-09
I've written and published about a static type checking technique and a library of mine that implements it: phantom-types.
🪄 Auto-generate Streamlit UI from Pydantic Models and Dataclasses.
Flake8 plugin for managing type-checking imports & forward references.
A CLI tool to automatically add type annotations into Python code. Must have tool for annotating existing code.Project mention: infer-types: A CLI tool to automatically add type annotations into Python code. Must have tool for annotating existing code. | reddit.com/r/coding | 2023-02-07
flake8 plugin which checks that typing imports are properly guarded
Rust like Option and Result types in Python (by MaT1g3R)Project mention: Personally I have to go with nil | reddit.com/r/ProgrammerHumor | 2023-02-06
Should be pretty straightforward to implement. https://github.com/MaT1g3R/option
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
Python Typing related posts
[D] Have their been any attempts to create a programming language specifically for machine learning?
12 projects | reddit.com/r/MachineLearning | 11 Feb 2023
Why Type Hinting Sucks!
7 projects | reddit.com/r/Python | 10 Feb 2023
Library for single dispatch on Generic subscript
1 project | reddit.com/r/learnpython | 9 Feb 2023
Informatica serve a qualcosa?
1 project | reddit.com/r/Universitaly | 4 Feb 2023
Python interfaces with Protocols: time to ditch ABC?
1 project | dev.to | 31 Jan 2023
Welche Programmiersprachen, bzw. -umgebung?
1 project | reddit.com/r/de_EDV | 20 Jan 2023
Is it bad practice from me or mypy is wrong (typing and @property)?
1 project | reddit.com/r/learnpython | 16 Jan 2023
A note from our sponsor - InfluxDB
www.influxdata.com | 24 Mar 2023
What are some of the best open-source Typing projects in Python? This list will help you: