Skip to main content

A Python package that detects and warns against slopsquatted or suspicious import statements in code, helping developers avoid accidentally using malicious or mistyped packages suggested by LLMs or found in legacy code.

Project description

slopsquat-detector is a Python package that helps detect fake, incorrect, or suspicious Python package imports. These may come from typos, hallucinated names generated by AI LLMS and tools like ChatGPT or Copilot, or from packages designed to trick users. This tool checks if the packages you are using actually exist on PyPI. If any package is missing, it flags it as potentially fake or unsafe. This can help prevent you from installing malicious or useless code.

Why use it?

  • Flags hallucinated imports generated by AI tools
  • Detects typos in package names
  • Catches fake or non-existent packages before installation
  • Protects against supply chain attacks and slopsquatting
  • Works with .py scripts, requirements.txt files, and .ipynb notebooks

How to install using pip

  • Python 3.6 or higher
  • pip (Python package installer)

Installation

You can install slopsquat-detector using pip. Make sure you have Python and pip installed on your system. pip install slopsquat-detector This will install the slopsquat command-line tool on your system.

How to install locally

To install the tool from source, first clone the repository:

git clone https://github.com/prashantpandeygit/slopsquat cd slopsquat Then install it using pip: pip install .

How to use

You can run slopsquat-detector from the terminal and give it a file to scan. Supported files include:

  • requirements.txt
  • Python files (.py)
  • Jupyter notebooks (.ipynb)

Examples

To check a requirements file: slopsquat requirements.txt

To check a Python script: slopsquat script.py

To check a notebook: slopsquat notebook.ipynb

The tool will show which packages exist and which are missing from PyPI. Missing packages are likely typos, hallucinations, or slopsquats.

License

This project is open source and licensed under the MIT License. See the LICENSE file for details.

Author

Prashant Pandey
Email: prashantpandeyiuet@gmail.com

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

slopsquat_detector-0.3.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

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

slopsquat_detector-0.3-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file slopsquat_detector-0.3.tar.gz.

File metadata

  • Download URL: slopsquat_detector-0.3.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for slopsquat_detector-0.3.tar.gz
Algorithm Hash digest
SHA256 76af5dc833d229e485e56608b2b21d68805d1928c883eead23fbc99305d60149
MD5 c9badafd20379962200dc7df0b63f945
BLAKE2b-256 7403e2cce0e00021ff9f87541a927051e2ce87f6fa0b6986afac7e34b3529dc1

See more details on using hashes here.

File details

Details for the file slopsquat_detector-0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for slopsquat_detector-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1e2dfbde92b9962dc3b2a19e8291e107bd6dc6ba4ecf5c37a19d7d59b8866865
MD5 93906348679b032fcf00cd7e34eb89c5
BLAKE2b-256 c13bdfaff8ac2740b854494f14baca82278059c0e99def6efca417df65f6ede3

See more details on using hashes here.

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