Torchlight
Find .collect() and .distinct() calls without running your code. Uses only
the Python standard library (Python 3.12+).
Install and run
pip install torchlight-spark
torchlight path/to/file.py path/to/notebook.ipynb path/to/directory
For an isolated CLI installation, use pipx install torchlight-spark instead.
The distribution is named torchlight-spark, but the command and Python package
are named torchlight. Do not install it alongside the unrelated torchlight
PyPI distribution in the same environment.
You can also run directly from a checkout:
python main.py path/to/file.py path/to/notebook.ipynb path/to/directory
# Or: python -m torchlight <paths...>
- Directories are scanned recursively, skipping virtual environments, version
control folders, notebook checkpoints,
__pycache__, andnode_modules. - Notebooks support top-level
await, line magics, shell escapes, and Python cell magics (capture,debug,prun,time,timeit). Other cell magics are skipped. Cell numbers count code cells only. - Detection is based on method names, not Spark type information.
Findings go to stdout; errors go to stderr:
pipeline.py:4: spark method .collect()
report.ipynb:cell 3,line 2: spark method .distinct()
Exit codes: 0 = no findings or errors, 1 = findings (even with errors), 2 = errors only.
Run the regression tests:
python -m unittest discover -s tests
Development and security
See CONTRIBUTING.md for setup, linting, and the pull request
workflow. CI tests Python 3.12–3.14 on Linux and Python 3.12 on macOS and Windows.
It also builds and tests both the wheel and source distribution in clean environments.
The main branch requires passing CI and CodeQL checks through pull requests;
direct pushes and protection bypasses are disabled.
See SECURITY.md for safe-use guidance and private vulnerability reporting. Never share credentials or private notebooks in issues.
Release notes are in CHANGELOG.md.
License
Copyright 2026 Kyle Bush. Licensed under the Apache License 2.0
(Apache-2.0). See NOTICE for attribution.
Metadata
Release files for torchlight-spark 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| torchlight_spark-0.1.0.tar.gz | 16.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| torchlight_spark-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.6 kB
Release files / torchlight_spark-0.1.0.tar.gz
| Download URL | torchlight_spark-0.1.0.tar.gz |
|---|---|
| Size | 16.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b13c290308698e612a7c2c9fffeb9c5ad50619d88545b2da7fa1201a5f360adb
|
|
BLAKE2b-256 checksum How to use checksums |
8957b97573594e7bc6c9e21a563dad16f1ef1f2c4121fd3e2c5d3b4b747c8f0f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.
Transparency logRelease files / torchlight_spark-0.1.0-py3-none-any.whl
| Download URL | torchlight_spark-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
35456aeee147b4ca890ae6bd3a5edfd42e771691f66b101e7c463935e9b40244
|
|
BLAKE2b-256 checksum How to use checksums |
2cf731a784c1a29af4630e55a9eb79ba1eb1aeefd524c4b629e086a96b18fcb2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.
Transparency log