Skip to main content

CLI and importable library for Python dependency analysis and bootstrap.

Project description

pyre_tools

pyre_tools is a Python dependency analysis tool that works both as a CLI and as an importable module.

Install

pip install pyre_tools

CLI

Analyze a project:

pyre_tools path/to/project

Analyze and install missing dependencies:

pyre_tools path/to/project --install

Generate requirements.txt and pyproject.toml:

pyre_tools path/to/project --write-files

The legacy pyre command is still available as a compatibility alias.

pyre_tools -h also shows how to call the package as a module from other Python code. If you hit Ubuntu/Debian user-site pip environment issues, run:

pyre --repair-hints

The CLI defaults to English for terminal compatibility. You can switch languages with:

pyre --lang zh path/to/project
pyre --lang en path/to/project

Python API

import pyre_tools; pyre_tools.shield()

Put that line at the top of your entry script. pyre_tools will infer the current project, install missing dependencies, and restart the process once if it had to patch the environment.

shield() now does a fast preflight on the current script first:

  • local project modules like utils.py or utils/ are treated as already satisfied
  • already importable dependencies are accepted immediately
  • only real missing modules fall back to full project analysis and installation
  • in REPL / python -c mode, it falls back to the current working directory instead of trying to parse <stdin> or <string>

Public API

  • analyze_path(path, include_stdlib=False)
  • bootstrap(path=".", auto_install=True, output_dir=None, write_files=False, include_stdlib=False, upgrade=False)
  • check_and_install_dependencies(path=".", auto_install=True, output_dir=None, write_files=False, include_stdlib=False, upgrade=False)
  • shield(path=None, auto_install=True, output_dir=None, write_files=False, include_stdlib=False, upgrade=False, restart_on_install=True)
  • find_missing_requirements(report_or_requirements)
  • install_requirements(requirements, python_executable=None, upgrade=False)
  • export_requirements(requirements, output_path)
  • export_pyproject_toml(requirements, output_path, project_name)
  • get_install_hint(package_name="pyre_tools")
  • format_module_not_found_hint(module_name="pyre_tools", package_name="pyre_tools")

Notes

  • The importable module name is pyre_tools.
  • The primary console command is also pyre_tools.
  • This makes missing-module guidance straightforward: if users see ModuleNotFoundError: No module named 'pyre_tools', the install command is pip install pyre_tools.
  • The shortest module integration is import pyre_tools; pyre_tools.shield().

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyre_tools-1.6.4.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyre_tools-1.6.4-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file pyre_tools-1.6.4.tar.gz.

File metadata

  • Download URL: pyre_tools-1.6.4.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for pyre_tools-1.6.4.tar.gz
Algorithm Hash digest
SHA256 500b1c027aa142825c5d063d1d0288c3f62d3de54d1604f764a4dd95991ad02b
MD5 2f69b66c15d904d482b710d241339bcf
BLAKE2b-256 2ec68f67a67e84d0330fe29f43e44f76d04f3b7b3dda4c1145758fd70b3c37c7

See more details on using hashes here.

File details

Details for the file pyre_tools-1.6.4-py3-none-any.whl.

File metadata

  • Download URL: pyre_tools-1.6.4-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for pyre_tools-1.6.4-py3-none-any.whl
Algorithm Hash digest
SHA256 40383dc10610f8edaca69f1fd613490084e10fd3426ce6d931bfdfb2c29e1ed8
MD5 385605f174316d03ee63cb5082f86cd5
BLAKE2b-256 cba8fbb771a8aea08935ee631dab83331a343d2a70b495fc587c4e25520e1ee9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page