Skip to main content

Watches for file changes & runs tasks against your Python code.

Project description

Code Spy

Watches for file changes & runs tasks against your Python code.

Install

 pip install code-spy

Quickstart

from flask import Flask
from code_spy import (
    CodeSpy,
    MyPyTask,
    DevServerTask,
    PylintTask,
    PytestTask,
)


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(
        path=".",
        tasks=[
            MyPyTask(path="routes", mypy_file="mypy.ini"),
            PylintTask(path="routes", rcfile=".pylintrc"),
            PytestTask(path="tests"),
            DevServerTask(wsgi_app=flask),
        ]
    )
    
    # Now call `watch`, that's it!
    cs.watch()

Tasks

  • Mypy
  • SimpleHttpServer
  • Pylint
  • Pytest

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

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

code_spy-0.4.3.tar.gz (3.4 kB view details)

Uploaded Source

File details

Details for the file code_spy-0.4.3.tar.gz.

File metadata

  • Download URL: code_spy-0.4.3.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for code_spy-0.4.3.tar.gz
Algorithm Hash digest
SHA256 309ec1511a80f94bd6c5500cc169a1b98422c2542f0a3f788ec9ae2ceb6c819a
MD5 85736cf5db0cd69907e5419aececf026
BLAKE2b-256 be099c050f79217f0147f80b441fcfb3ee4266dfbf37dbe81d7c900ad3d26dc2

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