Skip to main content

A Python linting tool

Project description

chine

Chine is a static architecture checker for Python. It parses your code with ast, reads declared architecture roles, and reports dependency violations without importing or executing your modules.

What chine checks

Declare a role at module level:

__architecture_role__ = "use_case"

Supported roles:

  • use_case
  • domain_policy (and domain)
  • adapter

Current rules:

  • ARCH001: use case modules must not import adapter modules
  • ARCH002: domain/domain_policy modules must not import adapter modules
  • ARCH003: domain/domain_policy modules must not import use case modules

Modules without __architecture_role__ are treated as untyped (Any) for architecture checks.

Installation

Install from PyPI:

pip install chine

Or with pipx:

pipx install chine

End-user usage

Show CLI help:

chine --help

Check the current directory:

chine check

Check a specific path:

chine check src/

Show version:

chine --version

When no violations are found, chine exits successfully. If violations are found, it prints each ARCH rule violation with file and line number and exits with a non-zero status.

Development

uv sync --all-extras
uv run ruff check src/
uv run mypy src/
uv run pytest

License

See LICENSE for details.

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

chine-0.1.2.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

chine-0.1.2-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file chine-0.1.2.tar.gz.

File metadata

  • Download URL: chine-0.1.2.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for chine-0.1.2.tar.gz
Algorithm Hash digest
SHA256 62530eaa6905e957c358cd042ec385818e53ee96c2747bc3f16dba8aab1792c1
MD5 0d10cdf1035172e7ab834f58ca358174
BLAKE2b-256 1f4d580eed2614088536d746909b288479f73674aa7958d613e301dee78f8f11

See more details on using hashes here.

Provenance

The following attestation bundles were made for chine-0.1.2.tar.gz:

Publisher: release.yml on jbrixon/chine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file chine-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: chine-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for chine-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d83b3d8412dba1aaea1e89d22808965dfaa22d28d66263c1c1ee0ddf64d8dc47
MD5 38e3790909b0dd3d7042f4aeceef9571
BLAKE2b-256 3106ff74710fc1d7ddd95f9ea554835e09a7d6d53b829c0dcd35748cbc9287ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for chine-0.1.2-py3-none-any.whl:

Publisher: release.yml on jbrixon/chine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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