Skip to main content

Import Policies

Project description

python-import-policies

python-import-policies is a Python package designed to enhance the management of import policies within your Python projects. It provides a set of contract types for the incredible import-linter. This package allows you to enforce consistent import practices, improve code readability, and maintain a clean and organized codebase.

Installation

Install the package using pip:

pip install python-import-policies

Usage

An example configuration for import-linter configuration

[importlinter]
root_package = your_package
contract_types =
    import_policy: import_policies.contracts.ImportPolicy

[importlinter:contract:import-policy]
name = Define import policy
type = import_policy
allow_modules =
    your_package.** -> another_package.**
    ** -> your_package.api

Then execute the linter

lint-imports

For more information visit import-linter website.

Contributing

We welcome contributions from the community! If you find a bug, have a feature request, or want to contribute code, please open an issue or submit a pull request on our Gitlab repository.

License

MIT License

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

python_import_policies-1.0.0.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

python_import_policies-1.0.0-py3-none-any.whl (3.5 kB view hashes)

Uploaded Python 3

Supported by

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