semvec/pypi-packages huggingface dataset:
analyze-drafter-site 0.4.1
A python tool for analyzing and summarizing a Drafter website in various ways, to simplify grading

# analyze_drafter_site

[![codecov](https://codecov.io/gh/drafter-edu/analyze-drafter-site/branch/main/graph/badge.svg?token=analyze-drafter-site_token_here)](https://codecov.io/gh/drafter-edu/analyze-drafter-site)
[![CI](https://github.com/drafter-edu/analyze-drafter-site/actions/workflows/main.yml/badge.svg)](https://github.com/drafter-edu/analyze-drafter-site/actions/workflows/main.yml)

A Python tool for analyzing and summarizing Drafter websites in various ways, to simplify grading.

## Install it from PyPI

```bash
pip install analyze_drafter_site
```

## Usage

### Command Line Interface

Analyze a Drafter website Python file:

```bash
$ 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 in the `./dist` directory:
- `dist/analysis.csv` - All complexity and dataclass data in CSV format
- `dist/analysis.mmd` - Mermaid class diagram and function call graph
- `dist/analysis.html` - Full HTML report with tables and rendered diagrams

### Command Line Options

```bash
$ analyze_drafter_site --help

Options:
  --output-dir TEXT         Output directory for all files (default: ./dist)
  --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

Specify a custom output directory:
```bash
$ analyze_drafter_site site.py --output-dir ./results
```

Generate only HTML output with custom filename:
```bash
$ analyze_drafter_site site.py --no-csv --no-mermaid --html-file report.html
```

Generate all outputs with custom directory and filenames:
```bash
$ analyze_drafter_site site.py \
  --output-dir ./grading \
  --csv-file results.csv \
  --mermaid-file diagrams.mmd \
  --html-file report.html
```

Disable stdout, only generate files:
```bash
$ analyze_drafter_site site.py --no-stdout
```

### Programmatic Usage

```py
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](CONTRIBUTING.md) file.
alignllm-case-alignment-package 0.1.3
A package for computing case alignment using embeddings - AlignLLM
Requires Python: >=3.8

# AlignLLM - Case Alignment Package

This package contains the mathematical implementation of ILRAlign and WILRAlign from AlignLLM. 

 - Original paper: https://dl.acm.org/doi/10.1007/978-3-031-96559-3_2
 - Original SRC: https://github.com/RAbeyratne/aligned-ensemble-judge
 - Exploration SRC: https://github.com/RAbeyratne/alignllm-exploration

# Sample usage

```
!pip install alignllm-case-alignment-package
import numpy as np
from case_alignment_package import get_case_alignment, get_weighted_case_alignment

# Example case embedding
case_ = [np.array([1, 0, 1]), np.array([1, 2, 1])]

# Example casebase
case_base = [
    [np.array([0, 3, 2]), np.array([3, 2, 2])],
    [np.array([1, 0, 1]), np.array([1, 0, 2])]
]

# ILR Score (standard case alignment)
print("ILRScore:", get_case_alignment(case_, case_base))
# 0.7077719041151351

# WILR Score (weighted case alignment)
print("WILRScore:", get_weighted_case_alignment(case_, case_base))
# 0.7366226857266566
```