CLI to sync GUAP student lab tasks, manage local folders, and submit PDF reports.
Project description
🎓 guap-lab-auto
Unofficial CLI for GUAP students — sync lab tasks from pro.guap.ru, organize work on disk, convert DOCX → PDF, and submit reports after human review.
⚠️ Not affiliated with GUAP. The portal UI can change and break automation. Use at your own risk.
| 📦 PyPI | guap-lab-auto |
| ⌨️ Command | lab-auto |
| 🐍 Python | 3.11+ |
| 🌐 Portal | GUAP student tasks |
✨ Features
- 🔄 Sync tasks into
labs/<subject>/[STATUS] Title [id]/ - 📋 YAML state + Markdown summaries for humans and agents
- 🔐 Encrypted session (Fernet) — cookies never stored as plain JSON
- 📤 Submit PDFs via Playwright after you mark work
[REVIEW] - 📄 DOCX → PDF (LibreOffice, or Microsoft Word on Windows)
- 🗄️ Archive tasks that disappear from the website
- 🤖 OpenClaw & Hermes — AgentSkills skill
guap-lab-workflow(/guap-lab-workflow)
🤖 AI agents (OpenClaw & Hermes)
This repo ships an AgentSkills skill so agents run lab-auto instead of scraping GUAP directly.
| Agent | Install skill | Invoke |
|---|---|---|
| OpenClaw | skills/ in workspace or ./scripts/install-agent-skills.sh |
/guap-lab-workflow + terminal tools |
| Hermes | same script → ~/.hermes/skills/ |
/guap-lab-workflow or hermes -s guap-lab-workflow |
# Linux / macOS
./scripts/install-agent-skills.sh
# Windows
.\scripts\install-agent-skills.ps1
Config examples: examples/openclaw.json.example, examples/hermes-skills.example.yaml
Full guides: docs/integrations/ · AGENTS.md
🚀 Quick start
Install
pip install guap-lab-auto
playwright install chromium
With uv:
uv tool install guap-lab-auto
playwright install chromium
From Git (no PyPI):
pip install "guap-lab-auto @ git+https://github.com/your-org/lab_automation.git"
playwright install chromium
First run
lab-auto workspace set ~/guap-labs
lab-auto auth login
lab-auto sync
lab-auto status
📁 Workspace
Data lives in your workspace (not inside the package):
workspace/
├── labs/ # one folder per task
├── state/ # works.yaml, summary.md
├── session/ # encrypted browser session
└── logs/ # action logs
Resolution order: --root / LAB_AUTO_ROOT → saved default (lab-auto workspace set) → current directory.
| Platform | Saved config |
|---|---|
| Windows | %APPDATA%\lab-auto\config.yaml |
| Linux / macOS | ~/.config/lab-auto/config.yaml |
⌨️ Commands
| Area | Command |
|---|---|
| 🔑 Auth | lab-auto auth login · check · migrate-session · import-cookie · logout |
| 📂 Workspace | lab-auto workspace set|show|unset <path> |
| 🔄 Sync | lab-auto sync · sync --archive |
| 📊 Status | lab-auto status · status --all |
| ✅ Workflow | lab-auto review <id> · convert <id> --docx f.docx · submit <id> --file f.pdf |
| 🗄️ Archive | lab-auto archive <id> · unarchive <id> |
Use lab-auto --help and lab-auto <command> --help for details.
🏷️ Folder statuses
| Prefix | Meaning |
|---|---|
[REFACTOR] |
Not accepted on the website |
[REVIEW] |
Ready for your review (local) |
[SENT] |
Submitted, awaiting teacher |
[SENTFAILED] |
Upload failed (retry or sync) |
[DONE] |
Accepted |
[UNKNOWN] |
Unrecognized website status |
IDs: CLI / works.yaml use task-178541; folders look like [SENT] Lab title [178541].
🔐 Session security
- Cookies stored in
session/storage_state.json(encrypted). - Key:
%APPDATA%\lab-auto\session.key(Windows) or~/.config/lab-auto/session.key(Unix). - Upgrade legacy files:
lab-auto auth migrate-session - Password is not saved (browser login only).
🧪 Development
git clone https://github.com/your-org/lab_automation.git
cd lab_automation
python -m venv .venv
source .venv/bin/activate # Windows: .\.venv\Scripts\Activate.ps1
pip install -e ".[dev]"
playwright install chromium
pytest
Optional live test (real GUAP session):
export LAB_AUTO_ROOT=~/guap-labs
pytest -m live
Test fixtures (local only)
Tests use synthetic HTML in tests/conftest.py (safe to commit). To capture real pages locally (gitignored):
python scripts/capture_guap_fixtures.py --task-url "https://pro.guap.ru/inside/student/tasks/<id>"
Never commit tests/fixtures/task_list.html or task_detail.html. See tests/fixtures/README.md.
🤖 AI agents: see AGENTS.md.
📦 Publishing to PyPI
Maintainers only.
- Create accounts on PyPI and TestPyPI.
- Ensure the name
guap-lab-autois still available. - Update
[project.urls]inpyproject.tomlwith your real GitHub URL. - Build and upload:
pip install build twine
python -m build
twine upload dist/*
Dry run on TestPyPI:
twine upload --repository testpypi dist/*
pip install --index-url https://test.pypi.org/simple/ guap-lab-auto
With uv:
uv build
uv publish
Bump version in pyproject.toml for each release.
📜 License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
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 guap_lab_auto-0.1.0.tar.gz.
File metadata
- Download URL: guap_lab_auto-0.1.0.tar.gz
- Upload date:
- Size: 72.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4623fabcc8d671128e9a4a5832146f734672a8072c1f40b3afb4b105e3e0d87
|
|
| MD5 |
839691d7907fee370b197a2ed93f4dfc
|
|
| BLAKE2b-256 |
61ea08e6e2d7aaa2cddc9ba9f96cefcc8edf2f6812a2d0cc60b429fa4f522df5
|
File details
Details for the file guap_lab_auto-0.1.0-py3-none-any.whl.
File metadata
- Download URL: guap_lab_auto-0.1.0-py3-none-any.whl
- Upload date:
- Size: 33.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d51564cbc974a5e7974b20b9b61b74165aa77247360e327cd36b4d3a986f84e4
|
|
| MD5 |
160f2dcce9ef592104e8d08d37e7a004
|
|
| BLAKE2b-256 |
8cd832e079400b83bf57e5224e141747f4af74430ebfafc5a84834014cbfd862
|