Start here
Install and set up
Astrolabe needs Python 3.12 or later, mypy 1.13 or later, and Polars 1.43.2.
Install the package
Section titled “Install the package”uv add git+https://github.com/thomasblanchet/astrolabepip install git+https://github.com/thomasblanchet/astrolabepoetry add git+https://github.com/thomasblanchet/astrolabeSet up the project
Section titled “Set up the project”Run this command in the directory of your project:
uv run astrolabe initastrolabe initpoetry run astrolabe initThe command changes pyproject.toml:
- It adds the plugin to
[tool.mypy]and setsallow_redefinition = true. - It writes a
[tool.astrolabe]table with every setting at its default, each with a comment.
The command keeps the comments and the format of the file. A second run changes nothing. To see the changes before it writes them, add --dry-run. See CLI for the other options.
If mypy reads its configuration from mypy.ini, .mypy.ini or the [mypy] section of setup.cfg, the command changes nothing. It shows the lines to add to that file.
Set up by hand
Section titled “Set up by hand”Add these lines to pyproject.toml:
[tool.mypy]plugins = ["astrolabe.plugin"]allow_redefinition = trueThe plugin needs allow_redefinition = true. The type of an expression that a loop builds settles only when mypy lets the loop rebind its variable. If the setting is off, the plugin logs a warning.
Run the checker
Section titled “Run the checker”Run mypy as before:
mypy .The errors of the plugin show wherever mypy runs: in the terminal, in an editor that runs mypy, in pre-commit hooks and in CI. Each error ends with a code in brackets, for example [unknown-column]. See Error codes.
Next, type your first frame in the Quickstart.