Skip to main content

A hyper-fast Python docstring cross-reference checker

Project description

drefs

CI PyPI Python versions License: MIT

An extremely fast Python docstring cross-reference checker, written in Rust.

Shows a bar chart with benchmark results.

Validating cross-references in tinygrad (697 Python files). ~460x faster.

Usage

uvx drefs .
src/my_pkg/models.py:12:5: DREF001 Unresolved reference `my_pkg.old_module.Foo`
src/my_pkg/views.py:45:9: DREF001 Unresolved reference `Nonexistent`
Found 2 errors.

That's it.

Supported syntax

  • MkDocs: [text][pkg.mod.Class], [pkg.mod.Class][]
  • Sphinx: :class:`pkg.mod.Class`
  • Rust-style: [Symbol], [`Symbol`], [pkg.mod.Class]

[User] resolves via the current file's imports. [pkg.models.User] resolves directly. Escape with \[not a ref\].

drefs understands __init__.py re-exports, inheritance chains, and self.x attributes.

Configuration

Optional. Add to pyproject.toml:

[tool.drefs]
src = ["src"]                  # auto-detected if omitted
style = "auto"                 # "mkdocs" | "sphinx" | "auto"
inventories = [                # validate against external symbols
    "https://docs.python.org/3/objects.inv",
]

Editor support

PyCharm / IntelliJ

  • Ctrl+Click on each segment of a dotted path
  • Syntax highlighting on cross-references
  • Red squiggles on broken references

Install from editors/pycharm/build/distributions/drefs-pycharm-*.zip via Settings > Plugins > Install from Disk.

Contributing

See CONTRIBUTING.md.

License

MIT

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

drefs-0.1.0.tar.gz (107.6 kB view details)

Uploaded Source

Built Distributions

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

drefs-0.1.0-py3-none-win_amd64.whl (2.4 MB view details)

Uploaded Python 3Windows x86-64

drefs-0.1.0-py3-none-manylinux_2_28_x86_64.whl (2.6 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

drefs-0.1.0-py3-none-manylinux_2_28_aarch64.whl (2.4 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

drefs-0.1.0-py3-none-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

drefs-0.1.0-py3-none-macosx_10_12_x86_64.whl (2.5 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file drefs-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for drefs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 56057dfd22eb75ff384cd23715c62ce6a2357838acecd3d89d0fdd71bd582073
MD5 2624a3636c3e3e831a8c5fdc821d635b
BLAKE2b-256 79cbdef2a8028e9d55ec0c5ae33c227fa9b5351b497579530f6b1851d31da6b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for drefs-0.1.0.tar.gz:

Publisher: release.yml on scriptogre/drefs

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

File details

Details for the file drefs-0.1.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: drefs-0.1.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for drefs-0.1.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 f4075ab2b5dab31c5c7ece5fd70b047a8bf2932e21b0798230e0698dfa3644eb
MD5 36a6c135645972c3d492a6b292fe6213
BLAKE2b-256 a9f747fdd1ffa0d9c2bbc245eb04bbfc74da76e500dccaedc30338217ffaf130

See more details on using hashes here.

Provenance

The following attestation bundles were made for drefs-0.1.0-py3-none-win_amd64.whl:

Publisher: release.yml on scriptogre/drefs

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

File details

Details for the file drefs-0.1.0-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for drefs-0.1.0-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 91095aa647c6d92f83c4d840a63fefef542c2e7dda1bbae77cc32f80a3a6b4a3
MD5 9c38ae3d2acb127d2103fb482a8a919e
BLAKE2b-256 4dc63420c7fdeb5b13b6375fb5a4817a649a9e6f9d7076c57ed82d7e580e9904

See more details on using hashes here.

Provenance

The following attestation bundles were made for drefs-0.1.0-py3-none-manylinux_2_28_x86_64.whl:

Publisher: release.yml on scriptogre/drefs

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

File details

Details for the file drefs-0.1.0-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for drefs-0.1.0-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8c2b6136cfb5f644a47e73e6d044937c9901e7cf17330fed973dec3c2768e3bb
MD5 09a30b5f91cea37aa0cf997dbf96a895
BLAKE2b-256 ae05488e1d3aa8b3279748b2efe31103428cf54d2b48d0477ef12f857201a64a

See more details on using hashes here.

Provenance

The following attestation bundles were made for drefs-0.1.0-py3-none-manylinux_2_28_aarch64.whl:

Publisher: release.yml on scriptogre/drefs

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

File details

Details for the file drefs-0.1.0-py3-none-macosx_11_0_arm64.whl.

File metadata

  • Download URL: drefs-0.1.0-py3-none-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 2.3 MB
  • Tags: Python 3, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for drefs-0.1.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6cda116e30cb6d0d033949341eb8a63faeeaa3c010a6a75b371def8a40969bb0
MD5 639cb62a638eed7afc10d6a6586f199d
BLAKE2b-256 bc04b0493e4642b29470f1f8d5c600a53cac6f79dcce007372335a5518ca2684

See more details on using hashes here.

Provenance

The following attestation bundles were made for drefs-0.1.0-py3-none-macosx_11_0_arm64.whl:

Publisher: release.yml on scriptogre/drefs

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

File details

Details for the file drefs-0.1.0-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for drefs-0.1.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 961a03fbe5d7172c4f7b5d4eceae5b0e9274155af20921cfcf70043f35094e7b
MD5 a0b80cc5c383648e00043b15dd5f3656
BLAKE2b-256 5e7b886782068ba45aa8e4fbe33c2c9056f0f482ceb684759d690903c15dddb3

See more details on using hashes here.

Provenance

The following attestation bundles were made for drefs-0.1.0-py3-none-macosx_10_12_x86_64.whl:

Publisher: release.yml on scriptogre/drefs

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