# Pyre-Check | Performant Type-Checking For Python

**URL:** <https://onehack.st/t/pyre-check-performant-type-checking-for-python/102777>\
**Category:** Tools & Scripts\
**Tags:** tools, programming\
**Created:** [August 24, 2020, 1:12pm UTC](https://onehack.st/t/pyre-check-performant-type-checking-for-python/102777 "2020-08-24T13:12:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BlueHacker](https://onehack.st/user_avatar/onehack.st/bluehacker/32/174721_2.png) [@BlueHacker](https://onehack.st/u/BlueHacker)\
**Post date:** [August 24, 2020, 1:12pm UTC](https://onehack.st/t/pyre-check-performant-type-checking-for-python/102777/1 "2020-08-24T13:12:46Z")

</div>

![image](https://onehack.st/uploads/default/original/3X/8/f/8faa697b85d0778bb4670a088449cd252809c9e6.png)

Pyre is a performant type checker for Python compliant with [PEP 484](https://www.python.org/dev/peps/pep-0484/). Pyre can analyze codebases with millions of lines of code incrementally – providing instantaneous feedback to developers as they write code.

Pyre ships with **Pysa** , a security focused static analysis tool we’ve built on top of Pyre that reasons about data flows in Python applications. Please refer to our [documentation](https://pyre-check.org/docs/pysa-basics.html) to get started with our security analysis.

## Requirements

To get started, you need [Python 3.6 or later](https://www.python.org/getit/) and [watchman](https://facebook.github.io/watchman/) working on your system. On _MacOS_ you can get everything with [homebrew](https://brew.sh/):

$ brew install python3 watchman

On _Ubuntu_ , _Mint_ , or _Debian_ ; use `apt-get` :

$ sudo apt-get install python3 python3-pip watchman

We tested Pyre on _Ubuntu 16.04 LTS_ , _CentOS 7_ , as well as _OSX 10.11_ and later.

## Setting up a Project

We start by creating an empty project directory and setting up a virtual environment:

$ mkdir my\_project && cd my\_project $ python3 -m venv ~/.venvs/venv $ source ~/.venvs/venv/bin/activate (venv) $ pip install pyre-check

Next, we teach Pyre about our new project:

(venv) $ pyre init

This command will set up a configuration for Pyre ( `.pyre_configuration` ) as well as watchman ( `.watchmanconfig` ) in your project’s directory. Accept the defaults for now – you can change them later if necessary.

## Running Pyre

We are now ready to run Pyre:

(venv) $ echo “i: int = ‘string’” \> test.py (venv) $ pyre ƛ Found 1 type error! test.py:1:0 Incompatible variable type [9]: i is declared to have type `int` but is used as type `str`.

This first invocation will start a daemon listening for filesystem changes – type checking your project incrementally as you make edits to the code. You will notice that subsequent invocations of `pyre` will be faster than the first one.

For more detailed documentation, see [https://pyre-check.org](https://pyre-check.org/).

## Join the Pyre community

See [CONTRIBUTING.md](https://github.com/facebook/pyre-check/blob/master/CONTRIBUTING.md) for how to help out.

## License

Pyre is licensed under the MIT license.

## GitHub:

> **[GitHub - facebook/pyre-check: Performant type-checking for python.](https://github.com/facebook/pyre-check)**
>
> Performant type-checking for python.
