{"id":28411436,"url":"https://github.com/m42e/dhv-pdf-to-anki","last_synced_at":"2026-04-28T00:32:28.792Z","repository":{"id":296751113,"uuid":"994374633","full_name":"m42e/dhv-pdf-to-anki","owner":"m42e","description":"Generate Anki Flashcards from learning materials by DHV on their online learning platform","archived":false,"fork":false,"pushed_at":"2026-03-22T07:12:55.000Z","size":65,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-22T22:21:35.613Z","etag":null,"topics":["anki","dhv","gleitschirm","paraglide"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/m42e.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-01T19:57:14.000Z","updated_at":"2026-03-22T07:12:58.000Z","dependencies_parsed_at":"2025-06-02T05:37:48.851Z","dependency_job_id":"deebcb2b-b84c-4ae8-9af9-40265754caa3","html_url":"https://github.com/m42e/dhv-pdf-to-anki","commit_stats":null,"previous_names":["m42e/dhv-pdf-to-anki"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/m42e/dhv-pdf-to-anki","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m42e%2Fdhv-pdf-to-anki","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m42e%2Fdhv-pdf-to-anki/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m42e%2Fdhv-pdf-to-anki/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m42e%2Fdhv-pdf-to-anki/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m42e","download_url":"https://codeload.github.com/m42e/dhv-pdf-to-anki/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m42e%2Fdhv-pdf-to-anki/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32361477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anki","dhv","gleitschirm","paraglide"],"created_at":"2025-06-02T16:00:33.710Z","updated_at":"2026-04-28T00:32:28.785Z","avatar_url":"https://github.com/m42e.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DHV PDF to Anki\n\nGenerate Anki flashcards from DHV (Deutscher Hängegleiterverband) online learning PDF downloads for paragliding training.\n\n## Overview\n\nThis tool extracts questions and images from DHV paragliding training PDFs and converts them into Anki flashcard decks. It's designed to help paragliding students study for their DHV license exams using spaced repetition learning.\n\n## Features\n\n- **PDF Question Extraction**: Automatically extracts multiple-choice questions from DHV learning material PDFs\n- **Image Processing**: Extracts and processes images referenced in questions\n- **AI Enhancement**: Optional integration with Mistral AI to generate additional practice questions (split up questions regarding the gear into separate ones)\n- **Anki Deck Generation**: Creates ready-to-import Anki deck files (.apkg format)\n- **Web Interface**: Upload PDFs in the browser, generate a deck in a temporary workspace, and download it through a time-limited link\n- **Structured Learning**: Organizes questions by sections and subsections from the original material\n\n## Prerequisites\n\n- Python 3.12 or higher\n- [Anki](https://apps.ankiweb.net/) desktop application for importing the generated decks\n\n## Just run it (with uv)\n\n```bash\nuv tool run --with git+https://github.com/m42e/dhv-pdf-to-anki.git dhv-pdf-to-anki \n```\n\n## Installation\n\n1. Clone this repository:\n\n```bash\ngit clone git@github.com:m42e/dhv-pdf-to-anki.git\ncd dhv_paraglied_to_anki\n```\n\nOr if you prefer https:\n\n```bash\ngit clone https://github.com/m42e/dhv-pdf-to-anki.git\ncd dhv_paraglied_to_anki\n```\n\n1. Install the package using uv (recommended)\n\n```bash\n# Using uv (recommended)\nuv sync\n```\n\nIf you want you could also use pip\n\n```bash\n# Or using pip\npip install -e .\n```\n\n## Setup\n\n### PDF Files\n\nPlace your DHV PDF files in the `pdf/` directory with the following names:\n\n- `Lernstoff.pdf` - The main learning material containing questions (the PDF including the answers)\n- `Bilder.pdf` - The image collection referenced by the questions\n\n### Optional: Mistral AI Integration\n\nFor AI-enhanced question generation, set your Mistral AI API key:\n\n```bash\nexport MISTRAL_API_KEY=\"your-api-key-here\"\n```\n\nIf no API key is provided, the tool will still work but skip the AI enhancement step.\n\n## Usage\n\n### Basic Usage\n\nRun the complete pipeline with default settings:\n\n```bash\ndhv-pdf-to-anki\n```\n\nThis will:\n\n1. Extract images from `pdf/Bilder.pdf` to `images/`\n2. Extract questions from `pdf/Lernstoff.pdf`\n3. Generate extended questions (if Mistral AI key is available)\n4. Create an Anki deck at `output/DHV_Lernmaterial_Fragen.apkg`\n\n### Web Interface\n\nStart the local Flask app:\n\n```bash\ndhv-pdf-to-anki-web\n```\n\nThe web server reads `HOST` and `PORT` from the environment. By default it runs on `127.0.0.1:5000`.\nGenerated job artifacts are stored under `ARTIFACTS_DIR/\u003cjob_id\u003e`. If `ARTIFACTS_DIR` is not set, the app falls back to a temporary system directory.\n\nThen open `http://127.0.0.1:5000` in your browser, upload:\n\n- `Lernstoff.pdf` as the questions PDF\n- `Bilder.pdf` as the images PDF\n\nThe application will:\n\n1. Copy uploads into an isolated temporary folder\n2. Run the same extraction and deck-generation pipeline as the CLI\n3. Provide a download link for the generated `.apkg`\n4. Remove access to that result after 60 minutes\n\n### Docker\n\nBuild the image:\n\n```bash\ndocker build -t dhv-pdf-to-anki .\n```\n\nRun the web app in a container:\n\n```bash\ndocker run --rm -p 5000:5000 \\\n  -v \"$PWD/artifacts:/artifacts\" \\\n  -e ARTIFACTS_DIR=/artifacts \\\n  dhv-pdf-to-anki\n```\n\nThen open `http://127.0.0.1:5000` in your browser.\n\nIf you want AI-enhanced question generation, pass the API key through:\n\n```bash\ndocker run --rm -p 5000:5000 \\\n  -v \"$PWD/artifacts:/artifacts\" \\\n  -e ARTIFACTS_DIR=/artifacts \\\n  -e MISTRAL_API_KEY=your-api-key-here \\\n  dhv-pdf-to-anki\n```\n\nRun it with Docker Compose on `127.0.0.1:34209`:\n\n```bash\ndocker compose up --build\n```\n\nThen open `http://127.0.0.1:34209` in your browser.\n\nIf you want AI-enhanced question generation with Compose, add the environment variable before starting:\n\n```bash\nMISTRAL_API_KEY=your-api-key-here docker compose up --build\n```\n\n### Command Line Options\n\n```bash\ndhv-pdf-to-anki [OPTIONS]\n```\n\n| Option | Description | Default |\n| ------ | ----------- | ------- |\n| `--pdf-path` | Path to directory containing PDF files | `pdf/` |\n| `--anki-deck-name` | Name of the generated Anki deck | `DHV Lernmaterial Fragen` |\n| `--output-dir` | Directory to save output files | `output/` |\n| `--image-pdf` | Name of the PDF file containing images | `Bilder.pdf` |\n| `--questions-pdf` | Name of the PDF file containing questions | `Lernstoff.pdf` |\n| `--image-dir` | Directory to save extracted images | `images/` |\n\nThe web UI uses its own temporary directories and does not require these CLI paths.\n\n### Example with Custom Options\n\n```bash\ndhv-pdf-to-anki \\\n  --pdf-path ./my-pdfs/ \\\n  --anki-deck-name \"My Custom DHV Deck\" \\\n  --output-dir ./my-output/ \\\n  --image-pdf MyImages.pdf \\\n  --questions-pdf MyQuestions.pdf\n```\n\n## Directory Structure\n\nAfter running the tool, your project will have this structure:\n\n```plain\ndhv_paraglied_to_anki/\n├── pdf/                          # Place your DHV PDF files here\n│   ├── Lernstoff.pdf             # Questions PDF\n│   └── Bilder.pdf                # Images PDF\n├── images/                       # Extracted images (auto-generated)\n│   ├── Abbildung_1.png\n│   ├── Abbildung_2.png\n│   └── ...\n├── output/                       # output (auto-generated)\n│   ├── DHV_Lernmaterial_Fragen.apkg  # Anki deck file\n│   ├── questions.json           # Extracted questions\n│   └── extended_questions.json  # AI-generated questions (optional)\n└── src/dhv_pdf_to_anki/         # Source code\n```\n\n## Importing to Anki\n\n1. Open [Anki](https://apps.ankiweb.net/) on your computer\n2. Go to **File** → **Import**\n3. Select the generated `.apkg` file from the `output/` directory\n4. Click **Import**\n\nYour DHV questions will now be available as a new deck in Anki!\n\n## Question Format\n\nEach flashcard includes:\n\n- **Front**: The question text and any referenced images\n- **Back**: Multiple choice answers with the correct answer highlighted\n- **Tags**: Section and subsection information for filtering\n\nThe answers for a card are shuffled based on the current date, so it will not always be in the same order, to be a bit more of a challenge.\n\n## Troubleshooting\n\n### Common Issues\n\n1. **PDF files not found**: Ensure your PDF files are in the correct directory with the exact filenames\n2. **Permission errors**: Make sure the output directory is writable\n3. **Images not displaying**: Verify that the image PDF contains the referenced figures\n\n### Debug Information\n\nThe tool provides detailed console output showing:\n\n- ✓ Successful operations\n- ⚠ Warnings for optional features\n- ❌ Errors that need attention\n\n## Links\n\n- [Anki Desktop](https://apps.ankiweb.net/) - Download the Anki application\n- [DHV (Deutscher Hängegleiterverband)](https://www.dhv.de/) - Official DHV website\n- [Mistral AI](https://mistral.ai/) - AI service for question enhancement\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Author\n\nMatthias Bilger [matthias@bilger.info](matthias@bilger.info)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm42e%2Fdhv-pdf-to-anki","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm42e%2Fdhv-pdf-to-anki","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm42e%2Fdhv-pdf-to-anki/lists"}