Skip to main content
Pre-release

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

scant

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.1a2.tar.gz (44.5 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.1a2-py3-none-win_amd64.whl (2.4 MB view details)

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.28+ x86-64

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

Uploaded Python 3manylinux: glibc 2.28+ ARM64

scant-0.0.1a2-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.1a2.tar.gz.

File metadata

  • Download URL: scant-0.0.1a2.tar.gz
  • Upload date:
  • Size: 44.5 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.1a2.tar.gz
Algorithm Hash digest
SHA256 752be80a310f2de0bd20ef2c96f3fdf82e57217a946e8c4a14c89e0156501993
MD5 ad5bf05928a9a0908009b8ff0ea8f992
BLAKE2b-256 a7ad6cdcba4fa9b22e518f9129efc5ee1e92ca1ce721a7287fb38abdb4b34fc0

See more details on using hashes here.

Provenance

The following attestation bundles were made for scant-0.0.1a2.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.1a2-py3-none-win_amd64.whl.

File metadata

  • Download URL: scant-0.0.1a2-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.1a2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 3b15b708b8961d18dec1220db909065d3294ba54b94cbd8c9030735ca4c28ffd
MD5 eeff1b39a1b35dc8402571ec518124ac
BLAKE2b-256 99da0e35f0dc1a919dd1bec48a5d5f828f0e10cf39d28f620e46e692f033ada5

See more details on using hashes here.

Provenance

The following attestation bundles were made for scant-0.0.1a2-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.1a2-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for scant-0.0.1a2-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c1c963398351cffb5c571ce9255897c82300f55486fd2fac6c07f80fa4cf46ba
MD5 527b5c70243c132842180785b90f45ff
BLAKE2b-256 de23c14fb3412aecb6dcaee1543a6de3020169edd8a9fd1dae8275fde8d2bc03

See more details on using hashes here.

Provenance

The following attestation bundles were made for scant-0.0.1a2-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.1a2-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for scant-0.0.1a2-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 27e42af9cc6ff9b9802233b0bc5a9b599665da8af9fc84a234d7436d2dc4d7e3
MD5 3b01a74091c01f5d575b71b4a5b8c0ce
BLAKE2b-256 e5e60f5b42dd89c5c55ab2e2fac240e42a97b1c7acbfa9bc36857f964b1ed82d

See more details on using hashes here.

Provenance

The following attestation bundles were made for scant-0.0.1a2-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.1a2-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.1a2-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 4398ecfe985a4ca5cf53da55daf2cb908a3d43e2d1e50554de9b2089e5fa56a8
MD5 3299df88f2729ac3e36a46b1b61548b9
BLAKE2b-256 963e8ec370b4b1aee079ec2ad425f1dc4c81af81df781aa7af0eb95415549479

See more details on using hashes here.

Provenance

The following attestation bundles were made for scant-0.0.1a2-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.1a2 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