
gawain
Python type annotation checker for developers
Developer ToolsFreeOpen source · verified#python#type-checking#linting
Listed by the ProductPerch team from Hacker News · not launched here yet
What is gawain?
Gawain is a command line tool that checks Python code for missing type annotations. It enforces type hints on variables, function parameters, return values, and class attributes. The tool was created to reduce reliance on generic types like dict[str, Any].
When you run gawain check on a directory, it first scans for missing annotations. If all required annotations are present, it automatically runs a type checker such as ty or pyrefly to verify that the declared types match the actual code. It reports specific errors for missing declarations and type mismatches.
You can install gawain using uv or pip. The default setup uses ty as the backend type checker, but you can switch to pyrefly by installing a different package extra. The tool integrates easily into development workflows and supports pre-commit hooks.
gawain features
- Enforces type annotations on variables, parameters, returns, and class attributes
- Runs ty or pyrefly type checkers after verifying annotation presence
- Provides clear error codes for missing declarations and type mismatches
- Supports installation via uv or pip with optional backend extras
- Integrates with pre-commit hooks for automated code quality checks
- Allows switching between strict and standard checking modes
Who uses gawain and for what
- Enforcing consistent type hints across a large Python codebase
- Catching missing variable or parameter annotations during development
- Validating return types against declared function signatures
- Checking class attribute declarations before running full type checks
- Automating annotation compliance in CI pipelines using pre-commit
gawain FAQ
Is gawain free?
Yes, gawain is released under the MIT license and can be installed at no cost using uv or pip.
Does gawain work on Mac?
The website does not say. It is a Python command line tool that typically runs on macOS, Windows, and Linux systems where Python is available.
What is gawain used for?
gawain is used to check Python projects for missing type annotations on variables, parameters, returns, and class attributes. It also runs backend type checkers to verify type correctness.
Is gawain open source?
Yes, the project source code is publicly available on GitHub under the MIT license.
Can I use gawain with pyrefly instead of ty?
Yes, you can install gawain with the pyrefly extra and configure it to use pyrefly as the type checker instead of the default ty backend.
Comments (0)
Comments and upvotes open when this product launches on ProductPerch.
More Developer Tools launches
Monitor Laravel scheduled tasks and queues
Convert Cursor rules to AGENTS.md in the browser. No upload.

Feel iOS haptic patterns on a real iPhone, copy the code
Deploy anywhere from your AI tool.
Python code quality analyzer for developers
eBay listing data for apps and agents