{"id":42877460,"url":"https://github.com/c4software/pyopds-server","last_synced_at":"2026-01-30T14:23:59.717Z","repository":{"id":309533404,"uuid":"1036629717","full_name":"c4software/pyopds-server","owner":"c4software","description":"Minimalist and Simple OPDS Server for EPUB Library","archived":false,"fork":false,"pushed_at":"2026-01-01T22:53:45.000Z","size":1260,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-02T21:16:30.912Z","etag":null,"topics":["opds","python","python3","server"],"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/c4software.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-08-12T11:02:28.000Z","updated_at":"2026-01-01T22:53:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"53cbf54b-59a5-4092-852d-2ce0ea2e6ca0","html_url":"https://github.com/c4software/pyopds-server","commit_stats":null,"previous_names":["c4software/pyopds","c4software/pyopds-server"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/c4software/pyopds-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c4software%2Fpyopds-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c4software%2Fpyopds-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c4software%2Fpyopds-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c4software%2Fpyopds-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/c4software","download_url":"https://codeload.github.com/c4software/pyopds-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c4software%2Fpyopds-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28914093,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T12:13:43.263Z","status":"ssl_error","status_checked_at":"2026-01-30T12:13:22.389Z","response_time":66,"last_error":"SSL_read: 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":["opds","python","python3","server"],"created_at":"2026-01-30T14:23:58.906Z","updated_at":"2026-01-30T14:23:59.711Z","avatar_url":"https://github.com/c4software.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyOPDS Server - OPDS Server for EPUB Library\n\nThis project is a lightweight OPDS (Open Publication Distribution System) server written in Python 3, designed to expose a library of EPUB files stored in a local directory, compatible with clients like Calibre, KoReader, or any other OPDS-compliant reader. It uses only Python's standard libraries.\n\n![Logo](./preview/ereader.jpeg)\n\nIf you browse your OPDS feed in a web browser, it will display a simple HTML representation of the feed using XSLT transformation.\n\n![Home](./preview/preview.png)\n![Book list sample](./preview/preview2.png)\n![All books with pagination](./preview/preview3.png)\n\n## Features\n\n- **OPDS Catalog**: Exposes EPUB books via an OPDS feed accessible at the `/opds` endpoint.\n- **OpenSearch**: Integrated search functionality compliant with OpenSearch specification, allowing users to search books by title or author.\n- **Subdirectory Support**: Scans EPUB files in the configured directory and its subdirectories.\n- **Sorted by Most Recent**: Books are listed in the OPDS feed sorted by modification date, with the most recently modified files appearing first.\n- **Metadata Extraction**: Extracts title and author from EPUB files for rich display in the catalog.\n- **KoReader Sync API**: Optional JSON endpoints that store and replay reading progress shared by KoReader devices.\n- **Docker Deployment**: Includes a `Dockerfile` and `docker-compose.yml` for easy containerized deployment.\n- **Visual HTML Representation**: Provides a simple HTML view of the OPDS feed for easy browsing in web browsers (using XSLT transformation).\n\n## Prerequisites\n\n- **Python 3.12+** (if running without Docker).\n- **Docker** and **Docker Compose** (for containerized deployment).\n- A directory containing EPUB files (e.g., `books/`).\n\n## Installation\n\n### With Docker\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/your-username/your-repo.git\n   cd your-repo\n   ```\n\n2. Create a `books/` directory and place your EPUB files in it (e.g., `books/author1/book.epub`).\n3. Start the server with Docker Compose:\n\n   ```bash\n   docker-compose up --build\n   ```\n\n4. Access the OPDS catalog at: `http://localhost:8080/opds`.\n\n### Without Docker\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/your-username/your-repo.git\n   cd your-repo\n   ```\n\n2. Set the environment variable for the books directory:\n\n   ```bash\n   export LIBRARY_DIR=/path/to/your/books\n   ```\n\n3. Start the server:\n\n   ```bash\n   python server.py\n   ```\n\n4. Access the OPDS catalog at: `http://localhost:8080/opds`.\n\n## Configuration\n\nThe following environment variables can be set:\n\n- **LIBRARY_DIR**: Path to the directory containing EPUB files (default: `books`).\n- **KOREADER_SYNC_DB_PATH**: Path to the SQLite database file used by the KoReader sync helper (default: `koreader_sync.db`).\n\nFor Docker, modify these variables in the `docker-compose.yml` file:\n\n```yaml\nservices:\n  opds-server:\n    build: .\n    ports:\n      - \"8080:8080\"\n    volumes:\n      - ./books:/books\n      - ./config:/config\n    environment:\n      - LIBRARY_DIR=/books\n      - KOREADER_SYNC_DB_PATH=/config/koreader_sync.db\n    healthcheck:\n      test: [\"CMD\", \"curl\", \"-f\", \"http://localhost:8080/health\"]\n      interval: 30s\n      timeout: 10s\n      retries: 3\n      start_period: 5s\n```\n\n## Usage with an OPDS Client\n\n1. In an OPDS-compatible client (e.g., KoReader or Calibre):\n   - Add a new catalog with the URL: `http://\u003cyour-ip\u003e:8080/opds`.\n2. Browse the book list at the `/opds/books` endpoint.\n3. Download books via the links provided in the OPDS feed.\n\n## KoReader Sync API\n\nThe server exposes lightweight sync endpoints that allow KoReader clients to upload and download reading progress.\n\n### Endpoints\n\n- `PUT /koreader/sync/syncs/progress`: Accepts JSON payloads containing reading progress data from KoReader devices.\n- `GET /koreader/sync/syncs/progress/{book_id}`: Retrieves stored progress data for a specific book.\n\nData is stored in a local SQLite database (`KOREADER_SYNC_DB_PATH`) and deduplicated by the combination of user, device, and document identifier.\n\n## Security Consideration\n\nThis server is designed to be lightweight and does not include built-in authentication or HTTPS support. For production use, it is strongly recommended to place the server behind a reverse proxy (e.g., SWAG, Nginx, or Nginx Proxy Manager).\n\n## License\n\nThis project is licensed under the MIT License. See the `LICENSE` file for details (to be added if necessary).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc4software%2Fpyopds-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fc4software%2Fpyopds-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc4software%2Fpyopds-server/lists"}