https://github.com/joegasewicz/code-spy
Watches for file changes & runs tasks against your Python code.
https://github.com/joegasewicz/code-spy
developer-tools mypy pylint pytest simple-server task-runner wsgi
Last synced: about 2 months ago
JSON representation
Watches for file changes & runs tasks against your Python code.
- Host: GitHub
- URL: https://github.com/joegasewicz/code-spy
- Owner: joegasewicz
- Created: 2025-11-16T14:38:53.000Z (5 months ago)
- Default Branch: master
- Last Pushed: 2025-11-25T20:35:27.000Z (5 months ago)
- Last Synced: 2026-01-05T22:23:26.094Z (4 months ago)
- Topics: developer-tools, mypy, pylint, pytest, simple-server, task-runner, wsgi
- Language: Python
- Homepage: https://pypi.org/project/code-spy
- Size: 1.48 MB
- Stars: 12
- Watchers: 0
- Forks: 0
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Code Spy
Python developer tool that watches for file changes & runs tasks against your Python code.

### Install
```bash
pip install code-spy
```
### Quickstart
```python
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*