Markdown Converter
Agent skill for markdown-converter
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Sign in to like and favorite skills
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
CRITICAL: Database migrations are checked into git in the
migrations/ directory.
To create new migrations locally:
# Set up local environment python3 -m venv venv source venv/bin/activate pip install -r requirements.txt # Create migration export FLASK_APP=src/app.py export DATABASE_URL="sqlite:///local.db" # Use local SQLite for migration generation flask db migrate -m "Description of changes" # Review the generated migration file in migrations/versions/ # Commit to git git add migrations/versions/*.py git commit -m "Add migration: Description of changes"
This is the Linked Claims Extraction Service - a Flask web application with background processing that extracts verifiable claims from PDF documents and publishes them to the decentralized LinkedTrust network at live.linkedtrust.us.
The service now includes:
See
README_LOCAL_DEV.md for detailed setup instructions.
# One-time setup python3 -m venv venv source venv/bin/activate pip install -r requirements.txt cp .env.example .env # Edit with your API keys export FLASK_APP=src/app.py flask db upgrade # Run development server python src/app.py # Server runs on http://localhost:5050
# Start Redis (if you have it installed) redis-server # Start Celery worker (in separate terminal) source venv/bin/activate cd src celery -A celery_app.celery_app worker --loglevel=info
# Deploy with Ansible cd deploy ansible-playbook -i inventory/production.yml playbooks/deploy-with-background.yml --ask-vault-pass # Update existing deployment ansible-playbook -i inventory/production.yml playbooks/update-with-background.yml --ask-vault-pass
# Run tests with pytest pytest tests/ # Run specific test file pytest tests/test_document_manager.py
# Copy example environment file cp .env.example .env # Required environment variables: # - ANTHROPIC_API_KEY: Claude API key for extraction # - LINKEDTRUST_BASE_URL: API URL (default: https://live.linkedtrust.us) # - FLASK_SECRET_KEY: Session security key # - FLASK_PORT: Server port (default: 5050)
src/app.py: Main Flask application with routes, background processing, and LinkedTrust integrationsrc/pdf_parser/: PDF processing and document management modulessrc/claim_viz.py: Claim visualization utilitiessrc/templates/: Flask HTML templates/api/v4/claims# Pull latest changes git pull origin main # Restart service sudo systemctl restart ai-pdf-extractor.service # Check service status sudo systemctl status ai-pdf-extractor.service # View logs sudo journalctl -u ai-pdf-extractor.service -f
linked-claims-extractor Package: The ClaimExtractor is imported from the PyPI package
linked-claims-extractor. This is maintained in a separate repository and can be updated via pip.
File Upload Limits: Maximum file size is 80MB (configurable in app.py)
Supported Formats: Only PDF files are currently supported
Graph Queries: For examples of querying published claims, refer to the talent project
Security: Never store API keys or sensitive data in code. Always use environment variables.
src/templates/ for UI changesapp.py for new API endpoints if neededsrc/pdf_parser/pdf_processor.py for extraction logicsrc/pdf_parser/document_repl.py for interactive debuggingtests/fixtures/# Update specific package pip install --upgrade linked-claims-extractor # Freeze requirements pip freeze > requirements.txt