{"library":"pyre-check","title":"Pyre-check","description":"Pyre-check is a performant static type checker for Python, developed by Meta (formerly Facebook). It is compliant with PEP 484 and designed to analyze large codebases incrementally, providing quick feedback. It operates with a client-server architecture and includes Pysa, a security-focused static analysis tool. The library is actively maintained with regular updates.","language":"python","status":"active","last_verified":"Thu Apr 16","install":{"commands":["pip install pyre-check"],"cli":{"name":"pyre","version":""}},"imports":[],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\n\nproject_name = \"my_pyre_project\"\nos.system(f\"mkdir {project_name} && cd {project_name}\")\n\n# Simulate project directory\nos.chdir(project_name)\n\n# Setup virtual environment and install pyre-check\nos.system(\"python3 -m venv .venv\")\nos.system(\"source .venv/bin/activate\") # In a real shell, this would activate the venv\nos.system(\"pip install pyre-check\")\n\n# Initialize Pyre configuration\nos.system(\"pyre init --no-watchman-comments --no-touch-pysa\") # simplified for quickstart\n\n# Create a Python file with a type error\nwith open(\"test_file.py\", \"w\") as f:\n    f.write(\"\"\"\ndef greet(name: str) -> str:\n    return f\"Hello, {name}\"\n\ni: int = 'string' # This will cause a type error\nprint(greet(42)) # This will also cause a type error\n\"\"\")\n\n# Run Pyre to check for type errors\nprint(\"\\n--- Running Pyre Check ---\")\nos.system(\"pyre\")\n\n# In a real environment, you'd deactivate with 'deactivate'\n# os.system(\"deactivate\")\n","lang":"python","description":"This quickstart demonstrates setting up a basic Python project, installing `pyre-check` in a virtual environment, initializing its configuration, and running a simple type check to identify errors. The primary interaction with Pyre-check is through its command-line interface.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}