Skip to main content

CLI and GUI toolkit for maintaining Shamela data directories

Project description

Shamela Kit

A CLI and native desktop GUI toolkit for maintaining local Shamela data directories.

en ara PyPI version GitHub release License Made with Python

Shamela Kit logo

Shamela Kit helps you manage custom books in your local Shamela installation without editing the official app code. It can inspect your data directory, import books from JSON/BOK/EPUB, export books to JSON, edit custom book metadata, attach online PDF links, remove custom books, and create explicit backups when you want them.

Disclaimer: This software is free and open source. It is intended for personal, educational, and archival workflows. Close Shamela before making write changes.

Development note: Shamela Kit was developed with AI-assisted coding. Changes are reviewed, tested, and maintained by the project author.

Screenshots

Import tab Custom Books tab
Backup tab Inspect tab

Features

  • Native desktop GUI in Arabic by default, with English available from the Language menu.
  • CLI for repeatable and scripted workflows.
  • Works with Shamela's current Windows, macOS, and Linux data layout.
  • Inspects a Shamela data directory and runs health checks for SQLite, Lucene, Java, and process safety.
  • Lists and manages custom books in the reserved 900000001+ ID range.
  • Imports one or more books from Shamela .bok, EPUB, or Shamela Kit JSON.
  • Exports installed books to a JSON format that can be edited, backed up, or re-imported.
  • Changes custom book category and author metadata.
  • Links custom books to online PDFs, including Shamela-style multi-file PDF mappings.
  • Optionally preserves sanitized EPUB formatting for headings, lists, emphasis, links, and tables.
  • Removes custom books from SQLite and Lucene, with optional orphan-author cleanup.
  • Creates and restores backups on demand. Backups are opt-in because fully downloaded Shamela libraries can be large.

Installation

Desktop app

Download the latest desktop build from GitHub Releases when packaged builds are available.

CLI package

For the CLI:

uv tool install shamela-kit

Requirements for Python installs:

  • Python 3.14+
  • Java 21 runtime for Lucene operations
  • Java 21 compiler the first time the bundled Lucene bridge is compiled

Shamela Kit first tries Shamela's bundled Java runtime. If that is not available, set JAVA_HOME, SHAMELA_MANUAL_JAVA, or install Java 21 with your system package manager or mise.

Quick Start

  1. Close Shamela.
  2. Open Shamela Kit.
  3. Confirm the data root points to your Shamela folder.
  4. Run Doctor before making changes.
  5. Import a book, edit metadata, link a PDF, or manage existing custom books.

Default Shamela roots:

  • macOS: ~/Library/Application Support/Shamela
  • Windows and Linux: the Shamela program folder when it contains database

You can also set custom paths with SHAMELA_DATA_ROOT, SHAMELA_RUNTIME_ROOT, --data-root, and --runtime-root.

CLI Examples

shamela-kit doctor
shamela-kit inspect
shamela-kit list
shamela-kit info 900000001

Import books:

shamela-kit import-bok ./book.bok --category-id 1
shamela-kit import-epub ./book.epub --category-id 1
shamela-kit import-epub ./book.epub --category-id 1 --preserve-formatting
shamela-kit add-json ./book.json
shamela-kit import-bok ./books/*.bok --category-id 1

Manage custom books:

shamela-kit set-category 900000001 2
shamela-kit set-author 900000001 "Author name"
shamela-kit export-json 900000001 -o book.json
shamela-kit remove-book 900000001 --backup

Attach PDF metadata:

shamela-kit set-pdf 900000001 https://archive.org/download/item/book.pdf
shamela-kit pdf-info 900000001
shamela-kit clear-pdf 900000001

Back up and restore explicitly:

shamela-kit backup --book-id 900000001
shamela-kit restore ./shamela-backup-YYYYMMDD-HHMMSS-ffffff --dry-run

Run shamela-kit --help for the full command list.

Safety Notes

  • Write commands refuse to run while Shamela appears to be open. Use --force only when you know the detected process is unrelated.
  • Backups are not automatic unless you pass --backup, because copying a complete Shamela library can be heavy.
  • Deleting a custom book removes Shamela Kit's SQLite/Lucene records. Cached local PDF files are not deleted.
  • Custom books should use IDs starting at 900000001.

Known Limitations

  • EPUB import can preserve sanitized semantic HTML, but it does not import EPUB CSS or embedded images.
  • Some BOK files do not contain a category that can be mapped automatically; pass --category-id.
  • PDF links store metadata used by Shamela. They do not download PDF files by themselves.

Documentation

More detailed documentation lives in docs:

Development

This project uses mise and uv.

mise install
mise run sync
mise run check

Useful tasks:

mise run cli -- doctor
mise run gui
mise run i18n
mise run build
mise run briefcase-build

The gui optional dependency is used for source/development environments and Briefcase packaging:

uv sync --extra gui

The project is intentionally independent from Shamela's bundled Python code. It writes the documented SQLite files directly and uses a small Java bridge for Lucene indexes because Shamela's current desktop data uses Lucene stores.

Acknowledgements

License

GPL-3.0-only. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shamela_kit-0.2.0.tar.gz (75.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shamela_kit-0.2.0-py3-none-any.whl (83.9 kB view details)

Uploaded Python 3

File details

Details for the file shamela_kit-0.2.0.tar.gz.

File metadata

  • Download URL: shamela_kit-0.2.0.tar.gz
  • Upload date:
  • Size: 75.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for shamela_kit-0.2.0.tar.gz
Algorithm Hash digest
SHA256 39298bc754334311da375f4dc24654c44093705a09a59114abc94dc845cad10f
MD5 99be24a79408a7ef674bf03a8bb4e924
BLAKE2b-256 cfd807ea0a3a8f8e476fd60211be1e560f3a30dd2dbf3f1efb5bf20148690303

See more details on using hashes here.

File details

Details for the file shamela_kit-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: shamela_kit-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 83.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for shamela_kit-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e25585d78cb1c4fe39cb5c23dd5b322658fe1cbb239c1d8b5412d8623d0f9a81
MD5 ad53792be881b846285f27c638bc576c
BLAKE2b-256 672558cd8ae44faa0ac62763944de26d107b978ac417be0206d1ac85a07d5240

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page