Weekly is a comprehensive Python project quality analyzer that helps developers maintain high code quality by automatically detecting issues and suggesting improvements. It analyzes various aspects of your Python projects and generates actionable reports with clear next steps.
coverage.xml)pip-audit integration and AST parsing)Weekly can scan multiple Git repositories in a directory structure and generate comprehensive reports for each one, plus a summary report.
It also extracts Recent Changes (commits, files/lines changed, commit type breakdown) and writes a per-repo changelog.md into the report directory.
# Scan all Git repositories in ~/github
weekly scan ~/github
# Only show repositories with changes in the last 7 days (default)
weekly scan ~/github --since "7 days ago"
# Specify a custom output directory
weekly scan ~/github -o ./weekly-reports
# Run with 8 parallel jobs for faster scanning
weekly scan ~/github -j 8
# Generate JSON reports instead of HTML
weekly scan ~/github --format json
When you run weekly scan ... --since "...", the per-repo reports include a Recent Changes section and a changelog.md file in the repository report directory.
git-cliff is available, Weekly uses it to generate changelog.md.git-cliff is not available, Weekly falls back to an internal summary (commit + diff stats).Optional installation (recommended) for richer changelog output:
cargo install git-cliff
๐ Scanning Git repositories in /Users/username/github...
โ
Scan complete! Generated reports for 3 repositories.
๐ Summary report: weekly-reports/summary.html
โ
org1/repo1: 5 checks
โ style: Passed
โ code_quality: Passed
โ dependencies: 2 outdated packages found
โ docs: Documentation is 85% complete
โ tests: 92% test coverage
Usage: weekly scan [OPTIONS] [ROOT_DIR]
Scan multiple Git repositories and generate reports.
ROOT_DIR: Directory containing Git repositories (default: current directory)
Options:
-o, --output PATH Output directory for reports (default: ./weekly-reports)
-s, --since TEXT Only include repositories with changes since this date (e.g., "7 days ago", "2023-01-01")
--recursive / --no-recursive Scan directories recursively (default: True)
-j, --jobs INTEGER Number of parallel jobs (default: 4)
-f, --format [html|json|markdown] Output format (default: html)
--summary-only Only generate a summary report, not individual reports
-v, --verbose Show detailed output
--help Show this message and exit.
from pathlib import Path
from datetime import datetime, timedelta
from weekly import GitScanner
# Create a scanner instance
scanner = GitScanner(
root_dir=Path.home() / "github",
output_dir="weekly-reports",
since=datetime.now() - timedelta(days=7),
recursive=True,
jobs=4
)
# Run the scan
results = scanner.scan_all()
# Process results
for result in results:
print(f"{result.repo.org}/{result.repo.name}:")
for name, check in result.results.items():
status = "โ" if check.is_ok else "โ"
print(f" {status} {name}: {check.message}")
pip install weekly
poetry add weekly
# Clone the repository
git clone https://github.com/wronai/weekly.git
cd weekly
# Install with Poetry
poetry install --with dev
# Install pre-commit hooks
pre-commit install
# Activate the virtual environment
poetry shell
Analyze a Python project:
weekly analyze /path/to/your/project
Usage: weekly analyze [OPTIONS] PROJECT_PATH
Analyze a Python project and provide quality insights.
PROJECT_PATH: Path to the project directory (default: current directory)
Options:
-f, --format [text|json|markdown] Output format (default: text)
-o, --output FILE Output file (default: stdout)
--show-suggestions / --no-suggestions
Show improvement suggestions (default: true)
-v, --verbose Show detailed output
--help Show this message and exit.
weekly analyze .
weekly analyze -f markdown -o report.md /path/to/project
weekly analyze -f json -o report.json /path/to/project
๐ Weekly Project Analysis Report
================================================================================
Project: example-project
Generated: 2025-06-07 12:34:56
Summary:
--------------------------------------------------------------------------------
โ
5 passed
โ ๏ธ 3 warnings
โ 1 errors
Detailed Results:
--------------------------------------------------------------------------------
โ
Project Structure
Found Python project with proper structure
โ
Dependencies
All dependencies are properly specified
โ ๏ธ Test Coverage
Test coverage is below 80% (currently 65%)
Suggestions:
โข Add more test cases to improve coverage
โข Consider using pytest-cov for coverage reporting
โ Documentation
Missing API documentation
Suggestions:
โข Add docstrings to all public functions and classes
โข Consider using Sphinx or MkDocs for API documentation
Recommended Actions:
--------------------------------------------------------------------------------
1. Improve Test Coverage
โข Add unit tests for untested modules
โข Add integration tests for critical paths
โข Set up code coverage reporting in CI
2. Enhance Documentation
โข Add docstrings to all public APIs
โข Create API documentation using Sphinx or MkDocs
โข Add examples to the README
from pathlib import Path
from weekly import analyze_project
from weekly.core.report import Report
# Analyze a project
report = analyze_project(Path("/path/to/your/project"))
# Get report as dictionary
report_data = report.to_dict()
# Get markdown report
markdown = report.to_markdown()
# Print summary
print(f"โ
{report.summary['success']} passed")
print(f"โ ๏ธ {report.summary['warnings']} warnings")
print(f"โ {report.summary['errors']} errors")
# Get suggestions
for suggestion in report.get_suggestions():
print(f"\n{suggestion['title']}:")
for item in suggestion['suggestions']:
print(f" โข {item}")
### Most Active Files
- `src/main.py`: 12 changes
- `tests/test_main.py`: 8 changes
- `README.md`: 5 changes
### Languages Used
- `.py`: 15 files
- `.md`: 3 files
- `.json`: 2 files
## ๐ Next Steps
- [ ] Add tests for recent changes
- [ ] Refactor large files: src/utils.py, src/processor.py...
## ๐ Recent Commits
- `a1b2c3d` Fix bug in data processing (2023-05-15)
- `f4e5d6a` Add new feature X (2023-05-14)
- `b3c4d5e` Update documentation (2023-05-13)
- `c6d7e8f` Refactor module Y (2023-05-12)
- `d9e0f1a` Initial commit (2023-05-10)
*[View full history in the JSON file]*
git clone https://github.com/wronai/weekly.git
cd weekly
poetry install --with dev
poetry run pytest
This project uses:
Run all checks:
black .
isort .
flake8
mypy .
Contributions are welcome! Please feel free to submit a Pull Request.
Apache License 2.0 - see LICENSE for details.
Created by Tom Sapletta - tom@sapletta.com