A python tool for analyzing and summarizing a Drafter website in various ways, to simplify grading
Project description
analyze_drafter_site
A Python tool for analyzing and summarizing Drafter websites in various ways, to simplify grading.
Install it from PyPI
pip install analyze_drafter_site
Usage
Command Line Interface
Analyze a Drafter website Python file:
$ python -m analyze_drafter_site path/to/site.py
# or
$ analyze_drafter_site path/to/site.py
Output Formats
By default, the tool outputs to stdout and creates three files:
analysis.csv- All complexity and dataclass data in CSV formatanalysis.mmd- Mermaid class diagram and function call graphanalysis.html- Full HTML report with tables and rendered diagrams
Command Line Options
$ analyze_drafter_site --help
Options:
--csv / --no-csv Output CSV data to file (default: on)
--csv-file TEXT CSV output filename (default: analysis.csv)
--mermaid / --no-mermaid Output Mermaid diagrams to file (default: on)
--mermaid-file TEXT Mermaid output filename (default: analysis.mmd)
--html / --no-html Output HTML report to file (default: on)
--html-file TEXT HTML output filename (default: analysis.html)
--stdout / --no-stdout Output plain text to stdout (default: on)
Examples
Generate only HTML output with custom filename:
$ analyze_drafter_site site.py --no-csv --no-mermaid --html-file report.html
Generate all outputs with custom filenames:
$ analyze_drafter_site site.py \
--csv-file results.csv \
--mermaid-file diagrams.mmd \
--html-file report.html
Disable stdout, only generate files:
$ analyze_drafter_site site.py --no-stdout
Programmatic Usage
from analyze_drafter_site import Analyzer, calculate_complexity
# Read your code
with open('site.py') as f:
code = f.read()
# Calculate complexity
tree, complexity_by_section = calculate_complexity(code)
# Analyze details
analyzer = Analyzer()
analyzer.analyze(code)
# Access results
print(analyzer.get_dataclass_attribute_csv())
print(analyzer.generate_mermaid_class_diagram())
Development
Read the CONTRIBUTING.md file.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file analyze_drafter_site-0.4.0.tar.gz.
File metadata
- Download URL: analyze_drafter_site-0.4.0.tar.gz
- Upload date:
- Size: 73.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d4114440c9ef82f1ec95fc6502a0b193357726bafe406a758e251e21ce03cee
|
|
| MD5 |
b660b49dc3b82ab83a597c9548e856ca
|
|
| BLAKE2b-256 |
29428ede7ac0e4a14d3ee5b1dcfb3fc8a8c19ec4cee60b568c2cbae75d7c1449
|
File details
Details for the file analyze_drafter_site-0.4.0-py3-none-any.whl.
File metadata
- Download URL: analyze_drafter_site-0.4.0-py3-none-any.whl
- Upload date:
- Size: 22.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01ee0103afd00c608c2e6dd6360eab5f5c4415a6418e17240a0a0cebee2e88b3
|
|
| MD5 |
91b74843c2a46cfe80d9f91685e4834c
|
|
| BLAKE2b-256 |
3efb1b525bc1f2b640b6ef97a38bd6b9204521b84e4f26f480cee4a7ff92e5b6
|