Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

scant

CI image image

Find the Python dependencies you barely use.

Most tools tell you what's unused. scant also tells you what's barely used. Think of those dependencies pulled in for one function, called on a couple of lines, that might be stopping you from your next Python upgrade (true story).

Built for plain English: flags are spelled out in full (--threshold-lines, not -L), and every result or error reads in words a non-developer can follow. The idea is to continue making the CLI very nice to look at. Like candy for your eyes.

Written in rust ⚡️

Install

pipx install scant

Usage

scant .
scant . --threshold-lines 5
scant . --env path/to/venv
scant . --env path/to/venv/bin/python

scant needs to read your dependencies' installed metadata to map a declared name to what you actually import (e.g. PyYAML -> yaml) -- there's no reliable way to do that without them being installed somewhere. It looks, in order, at: --env if you passed it, $VIRTUAL_ENV, $CONDA_PREFIX, then any pyvenv.cfg-marked folder under the scanned path (so .venv, venv, env, venv311, etc. are all found automatically -- no need to name it right). --env also accepts a direct interpreter path, not just a directory (--env .venv/bin/python), which is handy inside containers or CI images that install packages straight into a system Python.

If none of that resolves -- or more than one folder looks like a venv -- scant explains what it checked and how to point it at the right one, rather than guessing:

$ scant .
Couldn't find a Python environment for this project.

scant needs to read your dependencies' installed metadata to map declared
names to imports (e.g. "PyYAML" -> "yaml") -- there's no reliable way to
do that without them actually being installed somewhere.

Checked:
  ├── $VIRTUAL_ENV   not set
  ├── $CONDA_PREFIX  not set
  └── ./   no .venv, venv, or other pyvenv.cfg-marked folder

To fix this:
  1. Activate a virtualenv with your dependencies installed, then re-run scant
  2. Or point at one directly:    scant . --env path/to/venv
  3. Or point at an interpreter:  scant . --env path/to/venv/bin/python

Example output

mkdocs -- 15 packages declared, 65 files read, 0.4s
Plan: drop 3, inline 4, keep 8.

  ACTION  PACKAGE             USES  LINES  USE       WHERE
  drop    colorama               0      0  none      --

  inline  markupsafe             1      1  trivial   mkdocs/utils/templates.py:55
  inline  pyyaml_env_tag         1      1  trivial   mkdocs/utils/yaml.py:120

  keep    click                  4     41  heavy     mkdocs/__main__.py +3 files
  keep    watchdog               2      2  light     mkdocs/livereload/__init__.py

License

MIT

Download files

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

Source Distribution

scant-0.0.1a3.tar.gz (44.7 kB view details)

Uploaded Source

Built Distributions

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

scant-0.0.1a3-py3-none-win_amd64.whl (2.4 MB view details)

Uploaded Python 3Windows x86-64

scant-0.0.1a3-py3-none-manylinux_2_28_x86_64.whl (2.5 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

scant-0.0.1a3-py3-none-manylinux_2_28_aarch64.whl (2.3 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

scant-0.0.1a3-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (4.6 MB view details)

Uploaded Python 3macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file scant-0.0.1a3.tar.gz.

File metadata

  • Download URL: scant-0.0.1a3.tar.gz
  • Upload date:
  • Size: 44.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for scant-0.0.1a3.tar.gz
Algorithm Hash digest
SHA256 841e6a6e25101626fe71dee92e0203bf4d3f33d7c2e2729109671d4d4a977db8
MD5 88d8923e34f212925c5160ec45bef7aa
BLAKE2b-256 68d523fdd1543dfb385a3224d3fc9855a833262135ccd73f1aca7c9c3a537f51

See more details on using hashes here.

Provenance

The following attestation bundles were made for scant-0.0.1a3.tar.gz:

Publisher: release.yml on alan707/scant

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

File details

Details for the file scant-0.0.1a3-py3-none-win_amd64.whl.

File metadata

  • Download URL: scant-0.0.1a3-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/7.0.0 CPython/3.13.14

File hashes

Hashes for scant-0.0.1a3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 a6da4d7ff32586143bbe1ad08a47e6267a5ef08db0bc818b3ce305d0a67b5f88
MD5 308c59839e8470d3058484db0dc865f0
BLAKE2b-256 1cedb7c5a13fc05048fee1bc889945c9cd727a51c17c1d88f11527ac6f564fca

See more details on using hashes here.

Provenance

The following attestation bundles were made for scant-0.0.1a3-py3-none-win_amd64.whl:

Publisher: release.yml on alan707/scant

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

File details

Details for the file scant-0.0.1a3-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for scant-0.0.1a3-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3f174ca355ef3fd7b1068d7377c72005e5407fcb10dce3ac8303cb787ec7892a
MD5 0df9eb588f5ceb3ddc1ba6c633eed73d
BLAKE2b-256 ef81a7cbf9b53609bbfda1310597b468a0e85975aaf19d1ac3b2becedbedadfa

See more details on using hashes here.

Provenance

The following attestation bundles were made for scant-0.0.1a3-py3-none-manylinux_2_28_x86_64.whl:

Publisher: release.yml on alan707/scant

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

File details

Details for the file scant-0.0.1a3-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for scant-0.0.1a3-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 a3f8cb44d133000892c69e7d61923a4b6c266f9e918a824a11e0192901c2b91d
MD5 6c4dcd155938d8554dc0b06bcc574407
BLAKE2b-256 99b57d373ae0e68a2c6acf708143528b58960ade4713e75a0f9103beb83922c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for scant-0.0.1a3-py3-none-manylinux_2_28_aarch64.whl:

Publisher: release.yml on alan707/scant

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

File details

Details for the file scant-0.0.1a3-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for scant-0.0.1a3-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 87bd240d016b86d6729eb3dc53b32efadc7d82572f04442c461d3649e83edb90
MD5 54e8f4e05c8c847de58c4af279afcbc5
BLAKE2b-256 a25164e41e07d8d9c204d2bc21c99465692e4536b77f1abcdde9495ee14d4b16

See more details on using hashes here.

Provenance

The following attestation bundles were made for scant-0.0.1a3-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: release.yml on alan707/scant

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

Release history Release notifications | RSS feed

0.0.1

5 files

This release

0.0.1a3 This release

5 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page