Skip to main content

Code Spy

Python developer tool that watches for file changes & runs tasks against your Python code.

Terminal Example

Install

 pip install code-spy

Quickstart

from flask import Flask  # Or any WSGI application framework
from code_spy.core import CodeSpy
from code_spy.tasks import (
    MyPyTask,
    DevServerTask,
    PylintTask,
    PytestTask,
    BlackTask,
)

if __name__ == "__main__":
    # Create an instance of a WSGI application
    flask = Flask(__name__)

    # Pass the code spy shipped tasks to the `tasks` kwarg:
    cs = CodeSpy(
        watch_path=".",  # Optional: The path that codespy will run tasks against on file system change.
        interval=1,  # Optional (Default is 1 second) Restrict how often codespy can rerun tasks.
        ignore_dirs=["some_file"],  # Optional: Ignore files & directories from this directory path.
        log_length=100, # Optional: Restrict the character length of logs.
        tasks=[
            MyPyTask(path="routes", mypy_file="mypy.ini"),
            PylintTask(path="routes", rcfile=".pylintrc"),
            PytestTask(path="tests"),
            BlackTask(path="routes"),
            DevServerTask(wsgi_app=flask),
        ]
    )

    # Now call `watch`, that's it!
    cs.watch()

Tasks

  • Mypy ✅
  • SimpleHttpServer ✅
  • Pylint ✅
  • Pytest ✅
  • Black ✅

Tasks Requiring Library Installs

To restrict the amount of third party libraries that ship with code-spy, the rest of the tasks require library installs:

  • ISort TODO
  • Flake8 TODO
  • Bandit TODO
  • Sphinx TODO
  • Custom Task TODO

Metadata

Release files for code-spy 0.6.0

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

Source distribution (sdist)

Source distribution for code-spy 0.6.0
File Size Uploaded
code_spy-0.6.0.tar.gz 7.9 kB Details

Release files / code_spy-0.6.0.tar.gz

Download URL code_spy-0.6.0.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5e28e8b1140b59e6b68b28acdd3a84155c3c28fd695829991343ad8389148016
BLAKE2b-256 checksum
How to use checksums
9de520946876c66101e0dc7fbd6669e56051b8933f5eba3aa0b84286705ddd93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.6

Release history Release notifications | RSS feed

This release

0.6.0 This release

1 release file

0.5.2

1 release file

0.5.1

1 release file

0.5.0

1 release file

0.4.7

1 release file

0.4.6

1 release file

0.4.5

1 release file

0.4.4

1 release file

0.4.3

1 release file

0.4.2

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.0

1 release file

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