text stringlengths 3 8.33k | repo stringclasses 52
values | path stringlengths 6 141 | language stringclasses 35
values | sha stringlengths 64 64 | chunk_index int32 0 273 | n_tokens int32 1 896 |
|---|---|---|---|---|---|---|
"""
Validator for PowerPoint presentation XML files against XSD schemas.
"""
import re
from .base import BaseSchemaValidator
class PPTXSchemaValidator(BaseSchemaValidator):
PRESENTATIONML_NAMESPACE = (
"http://schemas.openxmlformats.org/presentationml/2006/main"
)
ELEMENT_RELATIONSHIP_TYPES = ... | jku-assignments | .agents/skills/docx/scripts/office/validators/pptx.py | Python | 5ca39598174a7547b8a1518d13ed31c9de7390d1cab0eba8cdaad86eff83dbd6 | 0 | 896 |
rel_type = rel.get("Type", "")
if "slideLayout" in rel_type:
valid_layout_rids.add(rel.get("Id"))
for sld_layout_id in root.findall(
f".//{{{self.PRESENTATIONML_NAMESPACE}}}sldLayoutId"
):
r_id = sld_lay... | jku-assignments | .agents/skills/docx/scripts/office/validators/pptx.py | Python | 738c1185c15c3404f17f8fc58ff32c77144800d65eb7d81584f020dc743bdc1c | 1 | 896 |
"FAILED - Found {len([e for e in errors if not e.startswith(' ')])} notes slide reference validation errors:"
)
for error in errors:
print(error)
print("Each slide may optionally have its own slide file.")
return False
else:
if self.... | jku-assignments | .agents/skills/docx/scripts/office/validators/pptx.py | Python | 3b84a9dea9684d7a6c84b52045ceaa8aeacb050824a7781a3e1730277d60848a | 2 | 103 |
"""
Validator for tracked changes in Word documents.
"""
import subprocess
import tempfile
import zipfile
from pathlib import Path
class RedliningValidator:
def __init__(self, unpacked_dir, original_docx, verbose=False, author="Claude"):
self.unpacked_dir = Path(unpacked_dir)
self.original_docx ... | jku-assignments | .agents/skills/docx/scripts/office/validators/redlining.py | Python | ce524a42b8d934598ce0af892629deb6016505e0b1112fcba1971ebadab474cb | 0 | 896 |
original_text, modified_text):
try:
with tempfile.TemporaryDirectory() as temp_dir:
temp_path = Path(temp_dir)
original_file = temp_path / "original.txt"
modified_file = temp_path / "modified.txt"
original_file.write_text(original_tex... | jku-assignments | .agents/skills/docx/scripts/office/validators/redlining.py | Python | 71316735f0fcdf1175865b6cd5b772ba8e04056328269268d1a3d8139ea37180 | 1 | 794 |
<?xml version="1.0" ?>
<w:comments xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:cx1="http://schemas.microsoft.com/office/drawing/2015/9/8/chartex" xmlns:cx2="http://schemas.microsoft.com/office/drawing/2015/10/21... | jku-assignments | .agents/skills/docx/scripts/templates/comments.xml | XML | a08ba83ee8790ac9e3dc61921f4988f19edd7e06ac09d6f1897a877c1581818d | 0 | 854 |
<?xml version="1.0" ?>
<w16cex:commentsExtensible xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:cx1="http://schemas.microsoft.com/office/drawing/2015/9/8/chartex" xmlns:cx2="http://schemas.microsoft.com/office/dra... | jku-assignments | .agents/skills/docx/scripts/templates/commentsExtensible.xml | XML | bad10b3283e6ad6e7ef6d1ca5169683721ed690ee331282c65df04017e080631 | 0 | 878 |
<?xml version="1.0" ?>
<w15:people xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml">
</w15:people>
| jku-assignments | .agents/skills/docx/scripts/templates/people.xml | XML | 056f63aa1197fd8c9dda980c9f1b9ff016fd5fa4a462df8aec5f384f39d23e37 | 0 | 44 |
---
name: error-handling-patterns
description: Master error handling patterns across languages including exceptions, Result types, error propagation, and graceful degradation to build resilient applications. Use when implementing error handling, designing APIs, or improving application reliability.
---
# Error Handlin... | jku-assignments | .agents/skills/error-handling-patterns/SKILL.md | Markdown | fce8bf64b3f2740320fa3ab5e56218391bd645509be584cc0508db25c3acc6b8 | 0 | 896 |
exceptions=(NetworkError,))
def fetch_data(url: str) -> dict:
response = requests.get(url, timeout=5)
response.raise_for_status()
return response.json()
```
### TypeScript/JavaScript Error Handling
**Custom Error Classes:**
```typescript
// Custom error classes
class ApplicationError extends Error {
co... | jku-assignments | .agents/skills/error-handling-patterns/SKILL.md | Markdown | 4d9f80c3d50d908033192909ce767411287273ed466b7d84267f5e4b2914141c | 1 | 896 |
> Result<String, io::Error> {
let mut file = File::open(path)?; // ? operator propagates errors
let mut contents = String::new();
file.read_to_string(&mut contents)?;
Ok(contents)
}
// Custom error types
#[derive(Debug)]
enum AppError {
Io(io::Error),
Parse(std::num::ParseIntError),
NotFou... | jku-assignments | .agents/skills/error-handling-patterns/SKILL.md | Markdown | 42606b0244b380f6091a64cfc5e746f5de20cf761d96614da62aee624588949d | 2 | 896 |
:
if datetime.now() - self.last_failure_time > self.timeout:
self.state = CircuitState.HALF_OPEN
self.success_count = 0
else:
raise Exception("Circuit breaker is OPEN")
try:
result = func()
self.on_success()
... | jku-assignments | .agents/skills/error-handling-patterns/SKILL.md | Markdown | 1ab1cf4996cf0ba1be10ed4a82579d3077a9d1d13d38b33fb820cf8705cd995c | 3 | 896 |
Clean Up Resources**: Use try-finally, context managers, defer
7. **Don't Swallow Errors**: Log or re-throw, don't silently ignore
8. **Type-Safe Errors**: Use typed errors when possible
```python
# Good error handling example
def process_order(order_id: str) -> Order:
"""Process order with comprehensive error han... | jku-assignments | .agents/skills/error-handling-patterns/SKILL.md | Markdown | c5faea56ce1cf0750e5354a63a1e8b7755c96c2eb64ac32e344f29897791b450 | 4 | 395 |
---
name: git-advanced-workflows
description: Master advanced Git workflows including rebasing, cherry-picking, bisect, worktrees, and reflog to maintain clean history and recover from any situation. Use when managing complex Git histories, collaborating on feature branches, or troubleshooting repository issues.
---
#... | jku-assignments | .agents/skills/git-advanced-workflows/SKILL.md | Markdown | e7bc2d7cffc2c267ec257e40add33a0b131e23b36ea2d5cf92f5593dc1cc6674 | 0 | 896 |
git checkout release/1.9
git cherry-pick abc123
# Handle conflicts if they arise
git cherry-pick --continue
# or
git cherry-pick --abort
```
### Workflow 3: Find Bug Introduction
```bash
# Start bisect
git bisect start
git bisect bad HEAD
git bisect good v2.1.0
# Git checks out middle commit - run tests
npm test
#... | jku-assignments | .agents/skills/git-advanced-workflows/SKILL.md | Markdown | 751451217bc8774c90549984cb30805063af8d1444390a7aaac40e6f939ae6f9 | 1 | 896 |
**: Ensure history rewrite didn't break anything
6. **Keep Reflog Aware**: Remember reflog is your safety net for 90 days
7. **Branch Before Risky Operations**: Create backup branch before complex rebases
```bash
# Safe force push
git push --force-with-lease origin feature/branch
# Create backup before risky operatio... | jku-assignments | .agents/skills/git-advanced-workflows/SKILL.md | Markdown | ba659d50a611c7344086f9066a3f8fc88c82040371e214874337044447b9bfb3 | 2 | 297 |
**CRITICAL: You MUST complete these steps in order. Do not skip ahead to writing code.**
If you need to fill out a PDF form, first check to see if the PDF has fillable form fields. Run this script from this file's directory:
`python scripts/check_fillable_fields <file.pdf>`, and depending on the result go to either t... | jku-assignments | .agents/skills/pdf/forms.md | Markdown | 6461afe1e7777b5deb7befb9c2fd81bbfb639c94ee689a8e74a9f6594d240ace | 0 | 896 |
.
# Non-fillable fields
If the PDF doesn't have fillable form fields, you'll add text annotations. First try to extract coordinates from the PDF structure (more accurate), then fall back to visual estimation if needed.
## Step 1: Try Structure Extraction First
Run this script to extract text labels, lines, and check... | jku-assignments | .agents/skills/pdf/forms.md | Markdown | 205c28abb870b54700512f6c61b115c888aec50165f7c80bc12097f138be0a35 | 1 | 896 |
``
**Important**: Use `pdf_width`/`pdf_height` and coordinates directly from form_structure.json.
### A.4: Validate Bounding Boxes
Before filling, check your bounding boxes for errors:
`python scripts/check_bounding_boxes.py fields.json`
This checks for intersecting bounding boxes and entry boxes that are too small... | jku-assignments | .agents/skills/pdf/forms.md | Markdown | ad4d853b61e55da92d94262257192f5e64c613de6fdcf96584bb38cbe7147f6d | 2 | 896 |
most fields but misses some elements (e.g., circular checkboxes, unusual form controls).
1. **Use Approach A** for fields that were detected in form_structure.json
2. **Convert PDF to images** for visual analysis of missing fields
3. **Use zoom refinement** (from Approach B) for the missing fields
4. **Combine coordin... | jku-assignments | .agents/skills/pdf/forms.md | Markdown | da7a2d7810bb80408cae44e27f2ea5023d08d1eaa566b312a99dc6018a1edaf6 | 3 | 376 |
# PDF Processing Advanced Reference
This document contains advanced PDF processing features, detailed examples, and additional libraries not covered in the main skill instructions.
## pypdfium2 Library (Apache/BSD License)
### Overview
pypdfium2 is a Python binding for PDFium (Chromium's PDF library). It's excellent... | jku-assignments | .agents/skills/pdf/reference.md | Markdown | 8dedc38dc33d7050baa28dd3e0bec14d4864a5f67ee9fd2f195738cc983440c2 | 0 | 896 |
helveticaFont
});
xPos += 120;
});
yPos -= 25;
});
const pdfBytes = await pdfDoc.save();
fs.writeFileSync('created.pdf', pdfBytes);
}
```
#### Advanced Merge and Split Operations
```javascript
import { PDFDocument } from 'pdf-lib';
import fs from 'fs';
async functi... | jku-assignments | .agents/skills/pdf/reference.md | Markdown | cacca137af4fd59d8091c7ea41a2ba9c199124446d129ae7dafe86a36cd18876 | 1 | 896 |
=> {
console.log(`Annotation type: ${annotation.subtype}`);
console.log(`Content: ${annotation.contents}`);
console.log(`Coordinates: ${JSON.stringify(annotation.rect)}`);
});
}
}
```
## Advanced Command-Line Operations
### poppler-utils Advanced Features
#### Extract ... | jku-assignments | .agents/skills/pdf/reference.md | Markdown | 9de1a05d04a52fd704f8f901c78378fe7bcd295faa34d1a446e035ca64b3cb5a | 2 | 896 |
("debug_layout.png")
```
### reportlab Advanced Features
#### Create Professional Reports with Tables
```python
from reportlab.platypus import SimpleDocTemplate, Table, TableStyle, Paragraph
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.lib import colors
# Sample data
data = [
['Product', '... | jku-assignments | .agents/skills/pdf/reference.md | Markdown | 165a196384ec7371f893123cd4f8be72838731602301ccf2c136d7d074925830 | 3 | 896 |
'.txt')
with open(output_file, 'w', encoding='utf-8') as f:
f.write(text)
logger.info(f"Extracted text from: {pdf_file}")
except Exception as e:
logger.error(f"Failed to extract text from {pdf_file}: {e}")
c... | jku-assignments | .agents/skills/pdf/reference.md | Markdown | 24ddace5fe60592b09442446cbe0c1c2ff699a4d97c9f53bc0ec471f710afb9b | 4 | 706 |
---
name: pdf
description: Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PD... | jku-assignments | .agents/skills/pdf/SKILL.md | Markdown | 95626a11374067d43d3f96574671e31bca798a7b1d163ec1ceeab8f8679e7db5 | 0 | 896 |
reportlab - Create PDFs
#### Basic PDF Creation
```python
from reportlab.lib.pagesizes import letter
from reportlab.pdfgen import canvas
c = canvas.Canvas("hello.pdf", pagesize=letter)
width, height = letter
# Add text
c.drawString(100, height - 100, "Hello World!")
c.drawString(100, height - 120, "This is a PDF cre... | jku-assignments | .agents/skills/pdf/SKILL.md | Markdown | 33dbb4f6618db276c8880fb89ca7393972f8205eccec3d4a7a492264bea5aca5 | 1 | 896 |
# Add Watermark
```python
from pypdf import PdfReader, PdfWriter
# Create watermark (or load existing)
watermark = PdfReader("watermark.pdf").pages[0]
# Apply to all pages
reader = PdfReader("document.pdf")
writer = PdfWriter()
for page in reader.pages:
page.merge_page(watermark)
writer.add_page(page)
with ... | jku-assignments | .agents/skills/pdf/SKILL.md | Markdown | 5861c28f5bf7605e23f437b82d852aded8400feb337767f7de82a0ccaff44622 | 2 | 452 |
from dataclasses import dataclass
import json
import sys
@dataclass
class RectAndField:
rect: list[float]
rect_type: str
field: dict
def get_bounding_box_messages(fields_json_stream) -> list[str]:
messages = []
fields = json.load(fields_json_stream)
messages.append(f"Read {len(fields['form... | jku-assignments | .agents/skills/pdf/scripts/check_bounding_boxes.py | Python | 0ced522402dd7b3c82a0be9518cf4e485fa9cc0467d7beab6ddb04cb36fcc3e1 | 0 | 637 |
import sys
from pypdf import PdfReader
reader = PdfReader(sys.argv[1])
if (reader.get_fields()):
print("This PDF has fillable form fields")
else:
print("This PDF does not have fillable form fields; you will need to visually determine where to enter data")
| jku-assignments | .agents/skills/pdf/scripts/check_fillable_fields.py | Python | 1fe10b9980a5493c9bbec8c20630c603eaa475b45403751c08f26738736647b8 | 0 | 63 |
import os
import sys
from pdf2image import convert_from_path
def convert(pdf_path, output_dir, max_dim=1000):
images = convert_from_path(pdf_path, dpi=200)
for i, image in enumerate(images):
width, height = image.size
if width > max_dim or height > max_dim:
scale_factor = min(m... | jku-assignments | .agents/skills/pdf/scripts/convert_pdf_to_images.py | Python | 7f58e292a67e18a8ff000d30bad2469389546731f7e8a698cc1d0aed001ea15d | 0 | 232 |
import json
import sys
from PIL import Image, ImageDraw
def create_validation_image(page_number, fields_json_path, input_path, output_path):
with open(fields_json_path, 'r') as f:
data = json.load(f)
img = Image.open(input_path)
draw = ImageDraw.Draw(img)
num_boxes = 0
... | jku-assignments | .agents/skills/pdf/scripts/create_validation_image.py | Python | 8fa9fd7962c9f940045b81cf6b991e7c1057c1838e3f9cc6d305007a222ffebf | 0 | 259 |
import json
import sys
from pypdf import PdfReader
def get_full_annotation_field_id(annotation):
components = []
while annotation:
field_name = annotation.get('/T')
if field_name:
components.append(field_name)
annotation = annotation.get('/Parent')
return ".".join(re... | jku-assignments | .agents/skills/pdf/scripts/extract_form_field_info.py | Python | c742b43b85c68712a5cc990235b83bd4e4560b09deb5dd053cf788a53a517565 | 0 | 896 |
reader)
with open(json_output_path, "w") as f:
json.dump(field_info, f, indent=2)
print(f"Wrote {len(field_info)} fields to {json_output_path}")
if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: extract_form_field_info.py [input pdf] [output json]")
sys.exit(1)
wr... | jku-assignments | .agents/skills/pdf/scripts/extract_form_field_info.py | Python | a12ead1c4c1b5bc3953bf648c75dff1048bc77da19f45ca0caa4548c82e7a7c6 | 1 | 103 |
"""
Extract form structure from a non-fillable PDF.
This script analyzes the PDF to find:
- Text labels with their exact coordinates
- Horizontal lines (row boundaries)
- Checkboxes (small rectangles)
Output: A JSON file with the form structure that can be used to generate
accurate field coordinates for filling.
Usa... | jku-assignments | .agents/skills/pdf/scripts/extract_form_structure.py | Python | 49c6d1b4b6c8737b2d445d964e3c1c1943af4c22ce1b735306b44b78e3043ca9 | 0 | 896 |
)
sys.exit(1)
pdf_path = sys.argv[1]
output_path = sys.argv[2]
print(f"Extracting structure from {pdf_path}...")
structure = extract_form_structure(pdf_path)
with open(output_path, "w") as f:
json.dump(structure, f, indent=2)
print(f"Found:")
print(f" - {len(structure['p... | jku-assignments | .agents/skills/pdf/scripts/extract_form_structure.py | Python | 47013902de265cd3b92a43dee8154a558eb53d5098558a0d8167e14f2de6760c | 1 | 196 |
import json
import sys
from pypdf import PdfReader, PdfWriter
from extract_form_field_info import get_field_info
def fill_pdf_fields(input_pdf_path: str, fields_json_path: str, output_pdf_path: str):
with open(fields_json_path) as f:
fields = json.load(f)
fields_by_page = {}
for field in field... | jku-assignments | .agents/skills/pdf/scripts/fill_fillable_fields.py | Python | d140872c2e92e41b1e05370ae8d270c5b7f5ebdf55d9905f03bc974a9c708ff5 | 0 | 763 |
import json
import sys
from pypdf import PdfReader, PdfWriter
from pypdf.annotations import FreeText
def transform_from_image_coords(bbox, image_width, image_height, pdf_width, pdf_height):
x_scale = pdf_width / image_width
y_scale = pdf_height / image_height
left = bbox[0] * x_scale
right = bbox[... | jku-assignments | .agents/skills/pdf/scripts/fill_pdf_form_with_annotations.py | Python | 8a56e063a49ed53c0b0e1d312ecf8023af76816ed139486ec3b539873de202fd | 0 | 608 |
# Editing Presentations
## Template-Based Workflow
When using an existing presentation as a template:
1. **Analyze existing slides**:
```bash
python scripts/thumbnail.py template.pptx
python -m markitdown template.pptx
```
Review `thumbnails.jpg` to see layouts, and markitdown output to see placeholde... | jku-assignments | .agents/skills/pptx/editing.md | Markdown | eb70eaaab002110ed78ca143e82a00d6cf27cf7b75e366751f5a88ab11694276 | 0 | 896 |
then run `clean.py`.
**Add**: Use `add_slide.py`. Never manually copy slide files—the script handles notes references, Content_Types.xml, and relationship IDs that manual copying misses.
---
## Editing Content
**Subagents:** If available, use them here (after completing step 4). Each slide is a separate XML file, s... | jku-assignments | .agents/skills/pptx/editing.md | Markdown | 230462e84540199e0c0ef8187f12a5907d3f264399462f13b3fd0d76e23c5c76 | 1 | 896 |
<a:pPr algn="l"><a:lnSpc><a:spcPts val="3919"/></a:lnSpc></a:pPr>
<a:r><a:rPr lang="en-US" sz="2799" b="1" .../><a:t>Step 2</a:t></a:r>
</a:p>
<!-- continue pattern -->
```
Copy `<a:pPr>` from the original paragraph to preserve line spacing. Use `b="1"` on headers.
### Smart Quotes
Handled automatically by unpack/... | jku-assignments | .agents/skills/pptx/editing.md | Markdown | 18b66a0b95cf5670a74471bb2195c73a0e3c448bdc603af599173ea77cb7737c | 2 | 395 |
# PptxGenJS Tutorial
## Setup & Basic Structure
```javascript
const pptxgen = require("pptxgenjs");
let pres = new pptxgen();
pres.layout = 'LAYOUT_16x9'; // or 'LAYOUT_16x10', 'LAYOUT_4x3', 'LAYOUT_WIDE'
pres.author = 'Your Name';
pres.title = 'Presentation Title';
let slide = pres.addSlide();
slide.addText("Hell... | jku-assignments | .agents/skills/pptx/pptxgenjs.md | Markdown | afab29b3a7537c55f3045d0db88d619730be1f8bff799cdae219140b2574de98 | 0 | 896 |
, h: 2, fill: { color: "0000FF" } });
slide.addShape(pres.shapes.LINE, {
x: 1, y: 3, w: 5, h: 0, line: { color: "FF0000", width: 3, dashType: "dash" }
});
// With transparency
slide.addShape(pres.shapes.RECTANGLE, {
x: 1, y: 1, w: 3, h: 2,
fill: { color: "0088CC", transparency: 50 }
});
// Rounded rectangle (r... | jku-assignments | .agents/skills/pptx/pptxgenjs.md | Markdown | dabf79888ee070725e20b24a0190be32fc4f52b8cdd117b09a80332ad1a5680c | 1 | 896 |
/ Cover - fill area, preserve ratio (may crop)
{ sizing: { type: 'cover', w: 4, h: 3 } }
// Crop - cut specific portion
{ sizing: { type: 'crop', x: 0.5, y: 0.5, w: 2, h: 2 } }
```
### Calculate Dimensions (preserve aspect ratio)
```javascript
const origWidth = 1978, origHeight = 923, maxHeight = 3.0;
const calcWidt... | jku-assignments | .agents/skills/pptx/pptxgenjs.md | Markdown | 2ffea855c6f77304142ef7505bc8a4bba4d3a7ddb82d7d1d50dbfb41b935910e | 2 | 896 |
y: 3.5, w: 8, colW: [4, 4] });
```
---
## Charts
```javascript
// Bar chart
slide.addChart(pres.charts.BAR, [{
name: "Sales", labels: ["Q1", "Q2", "Q3", "Q4"], values: [4500, 5500, 6200, 7100]
}], {
x: 0.5, y: 0.6, w: 6, h: 3, barDir: 'col',
showTitle: true, title: 'Quarterly Sales'
});
// Line chart
slide.ad... | jku-assignments | .agents/skills/pptx/pptxgenjs.md | Markdown | b092e7b3199a563c81971ccc065254a6ebe6b30d57ce9c1b2831f776a74812c3 | 3 | 896 |
6, offset: 2, color: "00000020" } // ❌ CORRUPTS FILE
shadow: { type: "outer", blur: 6, offset: 2, color: "000000", opacity: 0.12 } // ✅ CORRECT
```
3. **Use `bullet: true`** - NEVER unicode symbols like "•" (creates double bullets)
4. **Use `breakLine: true`** between array items or text runs together... | jku-assignments | .agents/skills/pptx/pptxgenjs.md | Markdown | 16e3c7e7516ac8cc5139671283477f3f02c10f21ea75183928a3e8cd471a7295 | 4 | 674 |
---
name: pptx
description: "Use this skill any time a .pptx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx file (even if the extracted content will be used elsewhere, like in an email or su... | jku-assignments | .agents/skills/pptx/SKILL.md | Markdown | 229e0d2ba5be90576dc427b7ff65b47d6aa9015a8614298fa218d0a00de92473 | 0 | 896 |
(midnight) |
| **Charcoal Minimal** | `36454F` (charcoal) | `F2F2F2` (off-white) | `212121` (black) |
| **Teal Trust** | `028090` (teal) | `00A896` (seafoam) | `02C39A` (mint) |
| **Berry & Cream** | `6D2E46` (berry) | `A26769` (dusty rose) | `ECE2D0` (cream) |
| **Sage Calm** | `84B59F` (sage) | `69A297` (eucalyptus) ... | jku-assignments | .agents/skills/pptx/SKILL.md | Markdown | 7d455c1669ecdfe69f4d22681b8c054ec65cbf4e07de5260e99bbe06bb3d6fb0 | 1 | 896 |
(Required)
**Assume there are problems. Your job is to find them.**
Your first render is almost never correct. Approach QA as a bug hunt, not a confirmation step. If you found zero issues on first inspection, you weren't looking hard enough.
### Content QA
```bash
python -m markitdown output.pptx
```
Check for mis... | jku-assignments | .agents/skills/pptx/SKILL.md | Markdown | f5e119bc57332b59dfccb8dd7a9321431891df81c889e9d7a105deafde61c20f | 2 | 744 |
"""Add a new slide to an unpacked PPTX directory.
Usage: python add_slide.py <unpacked_dir> <source>
The source can be:
- A slide file (e.g., slide2.xml) - duplicates the slide
- A layout file (e.g., slideLayout2.xml) - creates from layout
Examples:
python add_slide.py unpacked/ slide2.xml
# Duplicates s... | jku-assignments | .agents/skills/pptx/scripts/add_slide.py | Python | b1078ba593d40d40c5122aa3c15b22fd0cf85fb64932afe0e07d52d44a503a27 | 0 | 896 |
/ "slides"
rels_dir = slides_dir / "_rels"
source_slide = slides_dir / source
if not source_slide.exists():
print(f"Error: {source_slide} not found", file=sys.stderr)
sys.exit(1)
next_num = get_next_slide_number(slides_dir)
dest = f"slide{next_num}.xml"
dest_slide = slides_dir... | jku-assignments | .agents/skills/pptx/scripts/add_slide.py | Python | f4ac18a0f8537156dd1af6e689383e2d4550424c20240caf921c46b0dfbd94e6 | 1 | 896 |
(" slideLayout2.xml - create from a layout template", file=sys.stderr)
print("", file=sys.stderr)
print("To see available layouts: ls <unpacked_dir>/ppt/slideLayouts/", file=sys.stderr)
sys.exit(1)
unpacked_dir = Path(sys.argv[1])
source = sys.argv[2]
if not unpacked_dir.exists()... | jku-assignments | .agents/skills/pptx/scripts/add_slide.py | Python | 65afe007a91929f6b79e5f3bcdad96939477212b6aea2eee8d45002891b8dcf1 | 2 | 148 |
"""Remove unreferenced files from an unpacked PPTX directory.
Usage: python clean.py <unpacked_dir>
Example:
python clean.py unpacked/
This script removes:
- Orphaned slides (not in sldIdLst) and their relationships
- [trash] directory (unreferenced files)
- Orphaned .rels files for deleted resources
- Unreferen... | jku-assignments | .agents/skills/pptx/scripts/clean.py | Python | ff1dea6fc4fed1bfc63b1259e4875321a7d17184dc99f4cebd3d71e7deaf7585 | 0 | 896 |
:
pass
return referenced
def remove_orphaned_rels_files(unpacked_dir: Path) -> list[str]:
resource_dirs = ["charts", "diagrams", "drawings"]
removed = []
slide_referenced = get_slide_referenced_files(unpacked_dir)
for dir_name in resource_dirs:
rels_dir = unpacked_dir / "... | jku-assignments | .agents/skills/pptx/scripts/clean.py | Python | 5bbee2107e439014682b393caf5f422862487a8a10bb0473d254b1a4c39c389b | 1 | 896 |
(unpacked_dir)
referenced = get_referenced_files(unpacked_dir)
removed_files = remove_orphaned_files(unpacked_dir, referenced)
total_removed = removed_rels + removed_files
if not total_removed:
break
all_removed.extend(total_removed)
if all_removed:
upd... | jku-assignments | .agents/skills/pptx/scripts/clean.py | Python | 8ea119e6e61f5a939131927a016a4263c1fbcaf60999ca60b09d710c65488f41 | 2 | 202 |
"""Create thumbnail grids from PowerPoint presentation slides.
Creates a grid layout of slide thumbnails for quick visual analysis.
Labels each thumbnail with its XML filename (e.g., slide1.xml).
Hidden slides are shown with a placeholder pattern.
Usage:
python thumbnail.py input.pptx [output_prefix] [--cols N]
... | jku-assignments | .agents/skills/pptx/scripts/thumbnail.py | Python | 0c1f69fa97b658d947d08288811e060ec55eb3e42ad08dd4033e62eeab2ea871 | 0 | 896 |
],
temp_dir: Path,
) -> list[tuple[Path, str]]:
if visible_images:
with Image.open(visible_images[0]) as img:
placeholder_size = img.size
else:
placeholder_size = (1920, 1080)
slides = []
visible_idx = 0
for info in slide_info:
if info["hidden"]:
... | jku-assignments | .agents/skills/pptx/scripts/thumbnail.py | Python | ce66a48e0b850abba94eaddf0c1336ea0c7aea973e35473402ab3257bd811935 | 1 | 896 |
font_size)
except Exception:
font = ImageFont.load_default()
for i, (img_path, slide_name) in enumerate(slides):
row, col = i // cols, i % cols
x = col * width + (col + 1) * GRID_PADDING
y_base = (
row * (height + font_size + label_padding * 2) + (row + 1) * GRID_PAD... | jku-assignments | .agents/skills/pptx/scripts/thumbnail.py | Python | 2f44f9087cc56eb4e45d67f813df3baf02cf40ae5899f7bd3124bf10c4a50e9d | 2 | 282 |
---
name: xlsx
description: "Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new s... | jku-assignments | .agents/skills/xlsx/SKILL.md | Markdown | 69f63cf4b6047e2c72f686b4a5cc0492083715201a055d738baaffb7472b475a | 0 | 896 |
"Source: Company 10-K, FY2024, Page 45, Revenue Note, [SEC EDGAR URL]"
- "Source: Company 10-Q, Q2 2025, Exhibit 99.1, [SEC EDGAR URL]"
- "Source: Bloomberg Terminal, 8/15/2025, AAPL US Equity"
- "Source: FactSet, 8/20/2025, Consensus Estimates Screen"
# XLSX creation, editing, and analysis
## Overview
A user ... | jku-assignments | .agents/skills/xlsx/SKILL.md | Markdown | 2ab06cef82adbbf2b18d520113574e78bb03346b1ebb278fd94de03938f7120e | 1 | 896 |
import Workbook
from openpyxl.styles import Font, PatternFill, Alignment
wb = Workbook()
sheet = wb.active
# Add data
sheet['A1'] = 'Hello'
sheet['B1'] = 'World'
sheet.append(['Row', 'of', 'data'])
# Add formula
sheet['B2'] = '=SUM(A1:A10)'
# Formatting
sheet['A1'].font = Font(bold=True, color='FF0000')
sheet['A1']... | jku-assignments | .agents/skills/xlsx/SKILL.md | Markdown | a63c3b3cd98a97dd5cd0639f0a46a076fc9f1069c34d3e9fd4148067b9075d61 | 2 | 896 |
: 2,
"locations": ["Sheet1!B5", "Sheet1!C10"]
}
}
}
```
## Best Practices
### Library Selection
- **pandas**: Best for data analysis, bulk operations, and simple data export
- **openpyxl**: Best for complex formatting, formulas, and Excel-specific features
### Working with openpyxl
- Cell indices are 1-b... | jku-assignments | .agents/skills/xlsx/SKILL.md | Markdown | bc6838a281a786880916446afd916c821631904c73c3ce55c49f9f91c810dd49 | 3 | 366 |
"""
Excel Formula Recalculation Script
Recalculates all formulas in an Excel file using LibreOffice
"""
import json
import os
import platform
import subprocess
import sys
from pathlib import Path
from office.soffice import get_soffice_env
from openpyxl import load_workbook
MACRO_DIR_MACOS = "~/Library/Application S... | jku-assignments | .agents/skills/xlsx/scripts/recalc.py | Python | 4f659cdf1605bc6b24aed0ad3cb11b2d56a2bee873e0b3d6ec16871c5873cad9 | 0 | 896 |
== 0 else "errors_found",
"total_errors": total_errors,
"error_summary": {},
}
for err_type, locations in error_details.items():
if locations:
result["error_summary"][err_type] = {
"count": len(locations),
"loca... | jku-assignments | .agents/skills/xlsx/scripts/recalc.py | Python | 8e18483eb71416f29eaffeace00dd7acdfaaebd7e071f5e36d2aa8503267bd86 | 1 | 389 |
{
"name": "@jku-assignments/orchestrator",
"version": "0.0.0",
"private": true,
"type": "module",
"dependencies": {
"@jku-assignments/audit": "workspace:*",
"@jku-assignments/config": "workspace:*",
"@jku-assignments/moodle": "workspace:*",
"playwright": "^1.48.0"
}
}
| jku-assignments | apps/orchestrator/package.json | JSON | 5b470445c91ea94c04bc4ace5750e626fa529015736a8613884bf002a3159551 | 0 | 100 |
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "dist",
"rootDir": "src"
},
"include": ["src/**/*"],
"references": [
{ "path": "../../packages/config" },
{ "path": "../../packages/audit" },
{ "path": "../../packages/moodle" }
]
}
| jku-assignments | apps/orchestrator/tsconfig.json | JSON | a890003db85b930ed57d46cc262e56a8970b2decb21ac4525c42390800a02c9d | 0 | 122 |
import { type RunLogger, createRunLogger, newRunId } from '@jku-assignments/audit';
import { loadConfig } from '@jku-assignments/config';
import { isSessionActive, openProfileBrowser } from '@jku-assignments/moodle';
import type { BrowserContext } from 'playwright';
// Stub entry for `pnpm parse <quizUrl>`.
//
// S02 ... | jku-assignments | apps/orchestrator/src/cli/parse.ts | TypeScript | fda9d2d3bef497a90008123e409c067f5631d13f9d1baddd61e14690821600d9 | 0 | 678 |
import { type RunLogger, createRunLogger, newRunId } from '@jku-assignments/audit';
import { loadConfig } from '@jku-assignments/config';
import { isSessionActive, openProfileBrowser, runSSOLogin } from '@jku-assignments/moodle';
import type { BrowserContext } from 'playwright';
/**
* `pnpm sso` entry point.
*
* Ma... | jku-assignments | apps/orchestrator/src/cli/sso.ts | TypeScript | b299e54fad98ceba27bac425e0bb318b916ab0d62d5fcc1e770b147651a6ad66 | 0 | 726 |
import { spawn } from 'node:child_process';
import crypto from 'node:crypto';
import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { afterAll, describe, expect, it } from 'vitest';
const __filename = fileURLToPath(import.meta.url);
const __d... | jku-assignments | apps/orchestrator/tests/cli-stub.test.ts | TypeScript | 4fac7ebf6d316ccf09b12960d439ca522b6d4dd96015119fb0052189ca8350ac | 0 | 896 |
'jku-parse-profile');
const audit = makeTmpDir('jku-parse-audit');
const result = await runParse([], minimalConfigEnv(profile, audit));
expect(result.code).toBe(64);
expect(result.stderr).toContain('Usage: pnpm parse <quizUrl>');
expect(result.stdout).toBe('');
}, 30_000);
it.skipIf(browsersUna... | jku-assignments | apps/orchestrator/tests/cli-stub.test.ts | TypeScript | b071f9923ef4ef40c0767c72cead8e4d1bd8795c9ccbde06d82d276300c342a1 | 1 | 571 |
{
"name": "@jku-assignments/audit",
"version": "0.0.0",
"private": true,
"type": "module",
"exports": {
".": "./src/index.ts"
},
"types": "./src/index.ts",
"dependencies": {
"@jku-assignments/config": "workspace:*"
}
}
| jku-assignments | packages/audit/package.json | JSON | 34bff0095b3afeac2e0834c58df2b9f9f42106609a0a29d70dff85876fc2572d | 0 | 93 |
export { newRunId } from './run-id.js';
export { createRunLogger, type RunLogger, type CreateRunLoggerOptions } from './logger.js';
export { rotateRuns } from './rotate.js';
| jku-assignments | packages/audit/src/index.ts | TypeScript | 0d3f15bedde17460bd9312906005f1ceed42551c8db4943ef53a3d159a1cb605 | 0 | 47 |
import fs from 'node:fs';
import path from 'node:path';
import { type Config, redactConfig } from '@jku-assignments/config';
export interface CreateRunLoggerOptions {
/** Base directory containing all run dirs (e.g. `./runs`). */
baseDir: string;
/** Run id from `newRunId()`. The run dir is `${baseDir}/${runId}`... | jku-assignments | packages/audit/src/logger.ts | TypeScript | 5fafc776a00fc6c2c9b7a5e01c5b0bb18a46b2fa148e20638665d70befd38eec | 0 | 896 |
transcript'] = (line) => {
if (closed) throw new Error('RunLogger.transcript called after close()');
fs.appendFileSync(transcriptPath, `${line}\n`, 'utf8');
};
const close: RunLogger['close'] = () =>
new Promise<void>((resolve, reject) => {
if (closed) {
resolve();
return;
}... | jku-assignments | packages/audit/src/logger.ts | TypeScript | 0feb8bd0f7dccaddc39f8998bce7e4cc8b5ce902c20eadb97b2180123285a3b0 | 1 | 148 |
import fs from 'node:fs';
import path from 'node:path';
/**
* Delete oldest run subdirectories until at most `keep` remain.
*
* Run ids start with an ISO-8601 timestamp, so lexicographic sort by name
* descending is also chronological-newest-first — no `stat` calls needed.
* Non-directory entries are ignored. A `... | jku-assignments | packages/audit/src/rotate.ts | TypeScript | 7ccc11ef2a0251f5ccdce9948d79a63b89a2383e2f626f3bbbf049b6b8845d4e | 0 | 343 |
import crypto from 'node:crypto';
/**
* Generate a new run id of the form `${YYYY-MM-DDTHH-MM-SSZ}_${6charLowercaseAlphanum}`.
*
* The timestamp portion is filesystem-safe (colons replaced with hyphens) so the id
* can be used directly as a directory name on every supported platform. The suffix
* is six lowercase... | jku-assignments | packages/audit/src/run-id.ts | TypeScript | 17d5c20151bb43b603ea743bfa61fcda7879877fc30bc7d1068eddad418a7992 | 0 | 229 |
import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import { loadConfig } from '@jku-assignments/config';
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
import { createRunLogger, newRunId, rotateRuns } from '../src/index.ts';
const requiredEnv = (audit: string): Nod... | jku-assignments | packages/audit/tests/logger.test.ts | TypeScript | 979161661b991c37e8e2a25d991ece2f604ddd519531dbb9db15f054155376e0 | 0 | 896 |
requiredEnv(baseDir), JKU_PASSWORD: 'hunter2' });
const logger = createRunLogger({ baseDir, runId, configSnapshot: cfg });
await logger.close();
const snapPath = path.join(baseDir, runId, 'config.snapshot.json');
const snap = JSON.parse(await fs.promises.readFile(snapPath, 'utf8'));
expect(snap.LLM... | jku-assignments | packages/audit/tests/logger.test.ts | TypeScript | d58ddba5848caaec2bc0367a94610fdc6689a7657afaffdb7cdb0f539534eccb | 1 | 896 |
);
await rotateRuns(baseDir, 2);
const remaining = (await fs.promises.readdir(baseDir)).sort();
expect(remaining).toEqual(['2025-01-03T00-00-00Z_cccccc', '2025-01-04T00-00-00Z_dddddd']);
});
it('keep=0 deletes all run dirs', async () => {
await rotateRuns(baseDir, 0);
const remaining = await fs... | jku-assignments | packages/audit/tests/logger.test.ts | TypeScript | faf714548e2f7ca310cbee888533832348b471d84381b03cf70ccaaf7dfaffea | 2 | 243 |
{
"name": "@jku-assignments/config",
"version": "0.0.0",
"private": true,
"type": "module",
"exports": {
".": "./src/index.ts"
},
"types": "./src/index.ts",
"dependencies": {
"zod": "^3.23.0"
}
}
| jku-assignments | packages/config/package.json | JSON | 3fe472c0e36b4a6f5b05769bfaccc2d2d9f073e7d796cda54f117927ee4d97bc | 0 | 89 |
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "dist",
"rootDir": "src"
},
"include": ["src/**/*"]
}
| jku-assignments | packages/config/tsconfig.json | JSON | 6f18cbe407b1a3a84d294f9ebaebaca16976000e1d5d5926b8cbad1a96a4c200 | 0 | 62 |
import os from 'node:os';
import path from 'node:path';
import type { z } from 'zod';
import { type Config, ConfigSchema } from './schema.js';
export { ConfigSchema };
export type { Config };
export { redactConfig } from './redact.js';
/**
* Expand a leading `~` to the current user's home directory.
* Leaves any ot... | jku-assignments | packages/config/src/index.ts | TypeScript | 5e7fc71c9d38dc351a77c51d69fd86cfc511e5751815f475f781940287086b49 | 0 | 533 |
import type { Config } from './schema.js';
const SECRET_KEY_PATTERN = /KEY|TOKEN|SECRET|PASSWORD/i;
const REDACTED = '[redacted]';
/**
* Return a shallow copy of `config` with any field whose key matches
* `/KEY|TOKEN|SECRET|PASSWORD/i` replaced with the literal string
* `[redacted]`. Used for run-dir snapshots an... | jku-assignments | packages/config/src/redact.ts | TypeScript | d4a2cc86b960b6f491836c537292b227163fa32861d4a56e3fbb9ef5622c7ece | 0 | 180 |
import { z } from 'zod';
const required = (label: string) =>
z.string({ required_error: `${label} is required` }).min(1, `${label} must not be empty`);
const optional = () => z.string().optional();
const boolish = z
.string()
.optional()
.transform((v) => {
if (v === undefined || v === '') return undefin... | jku-assignments | packages/config/src/schema.ts | TypeScript | 53ed9355a659cfdc7a2e08a775e40ab5a9f121a0ddfbd906a26603f4145cb292 | 0 | 864 |
import os from 'node:os';
import path from 'node:path';
import { describe, expect, it } from 'vitest';
import { loadConfig, redactConfig } from '../src/index.ts';
const requiredEnv = (): NodeJS.ProcessEnv => ({
LLM_PROXY_URL: 'https://proxy.example.com',
LLM_API_KEY: 'sk-test-123',
LLM_MODEL_PRIMARY: 'claude-son... | jku-assignments | packages/config/tests/schema.test.ts | TypeScript | 6cb1091c5d73283cc01a76be45b962439dcc620ab67967de134c680e811f0bc1 | 0 | 896 |
abs/path');
expect(cfg.AUDIT_DIR).toBe('./rel');
});
});
describe('redactConfig', () => {
it('redacts keys matching KEY/TOKEN/SECRET/PASSWORD (case-insensitive)', () => {
const cfg = loadConfig({ ...requiredEnv(), JKU_PASSWORD: 'hunter2' });
const snap = redactConfig(cfg);
expect(snap.LLM_API_KEY).... | jku-assignments | packages/config/tests/schema.test.ts | TypeScript | 9fb01eb36ad6b907a7f8ba99f493aab1ef4ba4d055cc606dc2548a9846e90204 | 1 | 224 |
export {
type SubmitGuardTarget,
SubmitGuardViolation,
targetsSubmit,
} from './submit-guard.js';
export { type OpenProfileBrowserOptions, openProfileBrowser, resolveTilde } from './profile.js';
export { isSessionActive } from './session.js';
export { type RunSSOLoginOptions, runSSOLogin } from './sso.js';
| jku-assignments | packages/moodle/src/index.ts | TypeScript | bf75f877a74c6e3f6fa15da9b083cdcaed198c73ea0a38099c297719a91d03d0 | 0 | 68 |
import os from 'node:os';
import path from 'node:path';
import { type BrowserContext, chromium } from 'playwright';
export interface OpenProfileBrowserOptions {
/**
* Filesystem path to the persistent Chromium profile. Supports a leading `~`
* which gets expanded to the current user's home directory.
*/
p... | jku-assignments | packages/moodle/src/profile.ts | TypeScript | 1ffc2f4968723cf25b95618f9f904886ce929f8a6756ca9468b95904cfefd81a | 0 | 368 |
import type { BrowserContext } from 'playwright';
const SESSION_CHECK_TIMEOUT_MS = 30_000;
/**
* Probe whether the current persistent profile already has an active Moodle
* SSO session. Opens a fresh page, hits `moodleUrl`, waits for network idle,
* and reports `true` when the final URL stays on the Moodle host (i... | jku-assignments | packages/moodle/src/session.ts | TypeScript | 99aa06a57932c791248cd6cb707f07d764ed15376a2c479085eb2019719c6831 | 0 | 328 |
import type { BrowserContext } from 'playwright';
export interface RunSSOLoginOptions {
ctx: BrowserContext;
/** Base Moodle URL — `${moodleUrl}/login` is opened to bounce the user to the IDP. */
moodleUrl: string;
/** Hostname of the JKU IDP (e.g. `idp.jku.at`). Login is considered done once the URL no longer... | jku-assignments | packages/moodle/src/sso.ts | TypeScript | 0b7ecb0d8db06f72e38311397b939256ce888ee0e87d3e7455faf28c9d002176 | 0 | 613 |
/**
* Submit guard: pure predicate + violation error type.
*
* R002 proof — every Moodle interaction in S02-S04 routes click/submit
* targets through `targetsSubmit()` first. Any match throws
* `SubmitGuardViolation`, the orchestrator aborts the run, and the audit
* log records the offending input. The predicate ... | jku-assignments | packages/moodle/src/submit-guard.ts | TypeScript | 24529900767d819cf1256ed52e71e021130c64168087a518c2fc230134748f69 | 0 | 682 |
import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import { afterAll, describe, expect, it } from 'vitest';
import { openProfileBrowser, resolveTilde } from '../src/profile.js';
/**
* Decide whether to skip the live persistent-context smoke spec.
* We never download Playwright browsers... | jku-assignments | packages/moodle/tests/profile.test.ts | TypeScript | 588ed265a7eb98e544dea4beed1aad35e9c06f996c629237ea97ee9514a1297f | 0 | 813 |
import { describe, expect, it } from 'vitest';
import { SubmitGuardViolation, targetsSubmit } from '../src/submit-guard.js';
describe('targetsSubmit — denylist branches', () => {
describe('selector — id/name/class containing "submit"', () => {
it.each([
'[id=submitBtn]',
'[id*=submit]',
'[name=... | jku-assignments | packages/moodle/tests/submit-guard.test.ts | TypeScript | de875189b9b7beb7f25916fecf5737f38449b2635ba36395eca1728aaa350ccd | 0 | 896 |
href*="page=2"]',
'.que.essay textarea',
'#question-1 input[type="radio"]',
'input[type="text"]',
'div.btn.next-page',
// text — must not contain a bare "submit"
'Next page',
'Save without submitting changes', // "submit" is part of "submitting" → \bsubmit\b doesn't match
... | jku-assignments | packages/moodle/tests/submit-guard.test.ts | TypeScript | 8a78ce60f5d7c29b2888393bc422d78e660163d8277336ca058fe66a43b23fba | 1 | 612 |
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
*.egg-info/
dist/
build/
# Virtual environments
.venv/
venv/
ENV/
env/
# IDE
.vscode/
.idea/
*.swp
*.swo
*~
# Project specific
.cache/
reports/
*.mp4
*.wav
cookies.txt
config.yaml
# OS
.DS_Store
Thumbs.db
| jku-current-topics-report | lecture-reporter/.gitignore | Git Ignore | 41ba6bc5fc96fafcc1da20aded0b6b9337a900b7d75906c031f9a095b0a25392 | 0 | 85 |
"""Configuration handling for lecture-reporter."""
import os
from pathlib import Path
from dataclasses import dataclass, field
from typing import Optional
import yaml
@dataclass
class Config:
"""Application configuration."""
cookies_file: Path = field(default_factory=lambda: Path("./cookies.txt"))
outpu... | jku-current-topics-report | lecture-reporter/config.py | Python | 8ed094ae57c303cb85def75eeefa78095425b4a771b850e38703296a4f9059a4 | 0 | 462 |
"""Video download module for lecture-reporter."""
import sys
import time
from pathlib import Path
from dataclasses import dataclass
from typing import Optional, Callable
import httpx
@dataclass
class DownloadResult:
"""Result of a download operation."""
success: bool
file_path: Optional[Path]
file_... | jku-current-topics-report | lecture-reporter/downloader.py | Python | b2167922f0a9e63642832d43c62b97e8e44b8397b9d1b229bafd614d1c22441c | 0 | 896 |
bytes={start_byte}-"
with self._get_client() as client:
with client.stream("GET", url, headers=headers) as response:
if response.status_code == 416:
if partial_path.exists() and remote_size:
if partial_path.stat().st_size >= remote_size:
... | jku-current-topics-report | lecture-reporter/downloader.py | Python | 85978198e90c92ea0d3760572dd6ac018a2ea4a85f8a55a85e321fab2cc314ae | 1 | 555 |
"""Fetch lecture metadata from JKU Opencast API."""
import requests
from dataclasses import dataclass
from datetime import datetime
from pathlib import Path
from typing import Optional
from utils import get_cookies_for_requests, parse_iso_date, format_duration
@dataclass
class Lecture:
"""Represents a lecture re... | jku-current-topics-report | lecture-reporter/fetcher.py | Python | b738763ef518b42118d2e3bdc229414b0f598b4e57f49c992d7d0968522acc86 | 0 | 896 |
,
series_title=series_title,
duration_ms=duration_ms,
date=date,
video_url=self._extract_video_url(mp),
raw_data=episode,
)
def fetch_episode(self, video_id: str) -> Optional[Lecture]:
url = f"{self.base_url}/search/episode.json"
p... | jku-current-topics-report | lecture-reporter/fetcher.py | Python | fe77c5f0df4f259b2f91111ccfe4432ea2bccec64cbfed1921552661e19f68b2 | 1 | 449 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.