ExLibris Automator is a Python automation tool that parses academic citations and fills Esploro forms using a persistent Playwright worker. It is operated primarily through Discord commands and a local web control panel.
# 1) Create environment
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python -m playwright install chromium
pip install pre-commit
pre-commit install
# 2) Configure secrets and runtime settings
cp docs/ENV_EXAMPLE.md .env
# Then edit .env with required values
# 3) Run the full local stack (recommended)
./start_all.shOpen the web UI at http://localhost:8765.
Set these in .env (never hard-code credentials in source files):
OPENAI_API_KEYCITATION_PARSER=openaiESPLORO_USERNAMEESPLORO_PASSWORDDISCORD_BOT_TOKEN
Common optional variables:
OPENAI_MODEL(default:gpt-4o-mini)DEFAULT_RESEARCHERCITATION_CHANNEL_IDDISCORD_GUILD_IDBOT_CONFIG_PATHLOG_LEVEL
-
./start_all.shStarts both:- Discord bot (
discord_bot_batch_smart.py) - Flask control panel (
esp_gui_web.py)
- Discord bot (
-
./start_smart_batch.shRuns the Discord bot stack directly. -
run_esp_app.commandmacOS launcher for local interactive usage.
- Citations are added to a queue (Discord or web UI).
- Bot writes
citation_control_<channel>.json. - Worker (
automation/worker.py) picks up the control payload. - Worker parses citation + runs Playwright fill flow.
- Worker writes
citation_status_<channel>.jsonwith explicit state:processingcompletedfailed
- Bot/UI poll status and update queue + feedback.
-
discord_bot_batch_smart.pyCommand handling, queueing, worker orchestration, and bot-facing status. -
esp_gui_web.pyFlask UI/API for queue control, status display, and local operations. -
automation/worker.pyPersistent Playwright session that processes one citation at a time. -
automation/*_impl.pyAsset-type-specific parsing and Esploro field automation logic. -
openai_parser.pyOpenAI-based parsing and normalization helpers. -
utils/ipc_protocol.pyProtocol definitions for file-based IPC payloads.
- Queue display in the UI reflects current-run remaining citations.
- App branding is
ExLibris Automator. - For UI-only requests, keep backend behavior unchanged.
# parser checks
python test_citations.py
python test_parser_simple.py
# smoke checks
python -m unittest tests/test_status_and_standalone.py
python deployment/validate_env.py
# pre-commit checks (format/lint/secret scan)
pre-commit run --all-files
# benchmark suite
python tests/performance_tests.pydocs/INDEX.md— Documentation entry pointdocs/SMART_BATCH_GUIDE.md— Daily operator workflowdocs/COMMANDS_REFERENCE.md— Bot and UI command referencedocs/IPC_PROTOCOL.md— IPC payload contractsdocs/DISCORD_SETUP.md— Discord bot setupdocs/OPERATIONS_RUNBOOK.md— Startup, health checks, and recovery
- Do not commit
.envor any credential files. - Use environment variables for all secrets.
- If a secret is exposed, rotate it immediately.
For educational and research use at UMass Dartmouth.