Skip to main content
Pre-release

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

SparkGrep

Static Badge Lines of Code Quality Gate Status Maintainability Rating Security Rating Reliability Rating Coverage Bugs Vulnerabilities Code Smells Python Version Code style: Ruff Security: Bandit License

Pre-commit hook that detects debugging leftovers in Apache Spark applications.

🎯 Purpose

SparkGrep helps maintain clean Apache Spark codebases by detecting common debugging leftovers and performance anti-patterns that developers often forget to remove before committing code.

🔍 What it Detects

  • display() calls - Jupyter/Databricks debugging function
  • .show() methods - DataFrame inspection calls
  • .collect() without assignment - Potential performance issues
  • .count() without assignment - Unnecessary computations
  • Custom patterns - User-defined patterns via configuration

🚀 Installation

pip install sparkgrep

📋 Usage

As a Pre-commit Hook

Add to your .pre-commit-config.yaml:

repos:
  - repo: https://github.com/leandroasaservice/sparkgrep
    rev: v0.1.1a1  # Use this preview version.
    hooks:
      - id: sparkgrep

Command Line

# Check specific files
sparkgrep src/my_script.py notebook.ipynb

# Check with additional patterns
sparkgrep --additional-patterns "debug_print:Debug print statement" src/

# Disable default patterns and use only custom ones
sparkgrep --disable-default-patterns --additional-patterns "my_pattern:My description" src/

🛡️ Security & Quality

This project maintains high security and code quality standards:

🔒 Security Measures

  • Automated vulnerability detection and issue creation
  • Admin-protected CI/CD pipelines
  • Dependency vulnerability monitoring

📊 Code Quality

  • 80% minimum code coverage enforced in CI
  • SonarCloud integration for continuous code quality analysis
  • Automated testing on every PR
  • Code formatting with Ruff

📁 Project Structure

sparkgrep/
├── src/sparkgrep/          # Main package
│   ├── cli.py              # Command-line interface
│   ├── patterns.py         # Pattern definitions
│   ├── file_processors.py  # File processing logic
│   └── utils.py            # Utility functions
├── tests/                  # Test suite
│   ├── unit/               # Unit tests
│   └── integration/        # Integration tests
├── .github/                # GitHub configuration
│   ├── workflows/          # CI/CD pipelines
│   └── ISSUE_TEMPLATE/     # Issue templates
└── docs/                   # Documentation

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes with tests
  4. Ensure all checks pass (task quality, task test)
  5. Submit a pull request

Contribution Guidelines

  • Tests required for all new features
  • Security scans must pass
  • Code coverage must remain ≥ 80%
  • Admin approval required for all PRs to main
  • Follow existing code style and patterns See CONTRIBUTING.md for details.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

📞 Support


Made with ❤️ for the Apache Spark community

Metadata

Release files for sparkgrep 0.1.1a1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sparkgrep 0.1.1a1
File Size Uploaded
sparkgrep-0.1.1a1.tar.gz 10.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sparkgrep 0.1.1a1
File Interpreter ABI Platform
sparkgrep-0.1.1a1-py3-none-any.whl Python 3 none any Details

Total release size: 18.9 kB

Release files / sparkgrep-0.1.1a1.tar.gz

Download URL sparkgrep-0.1.1a1.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3d30cea61b3e315b1eef82f0ebf13b3ef676689bd52360f670e58004ef425473
BLAKE2b-256 checksum
How to use checksums
72deaa525ba89fdfa4b26460ffca69068dbb7cd39b967044e01024b82a9bce19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Sep 4, 2025.

Transparency log

Release files / sparkgrep-0.1.1a1-py3-none-any.whl

Download URL sparkgrep-0.1.1a1-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fb363d714c7883e4e6c344b973b83905164f401a18f7c670954deaf91baf00be
BLAKE2b-256 checksum
How to use checksums
84e925d6bc4400d372013c12cc5b098778c98d762dd4edab0ee19a32d3b9f650
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Sep 4, 2025.

Transparency log
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