Skip to main content

Convert a software project directory into an EPUB file for offline code reading

Project description

Project-to-EPUB

Convert a software project directory into an EPUB file for offline code reading and browsing on e-readers and tablets.

Features

  • Preserves your project's directory structure in the EPUB table of contents
  • Applies syntax highlighting to recognized code files
  • Respects .gitignore rules to exclude unwanted files
  • Optimized for e-ink devices with high-contrast themes
  • Configurable via command-line options

Installation

pip install project-to-epub

Or install from source:

git clone https://github.com/PsychArch/project-to-epub.git
cd project-to-epub
pip install -e .

Usage

Basic usage:

project-to-epub /path/to/your/project

This will create an EPUB file named after your project directory in the current working directory.

Command-line options

Usage: project-to-epub [OPTIONS] [INPUT_DIRECTORY]

  Convert a software project directory into an EPUB file for offline code reading.

  This tool creates an EPUB that preserves your project structure in the table of
  contents, applies syntax highlighting to code files, and respects .gitignore rules.

Arguments:
  INPUT_DIRECTORY  Path to the project directory to convert. Defaults to the current directory.

Options:
  -o, --output PATH               Output EPUB file path
  --theme TEXT                    Syntax highlighting theme (e.g., default_eink, 
                                 monokai)
  --log-level TEXT                Log level (DEBUG, INFO, WARNING, ERROR)
                                 [default: INFO]
  --title TEXT                    Set EPUB title (defaults to project directory name)
  --author TEXT                   Set EPUB author
  --limit-mb FLOAT                Set large file threshold in MB
  --no-skip-large                 Include large files instead of skipping
  --hierarchical-toc              Use a hierarchical table of contents
  --version                       Show version and exit
  --help                          Show this message and exit.

Examples

Specify an output file:

project-to-epub /path/to/project -o ~/Documents/my-project.epub

Use a different syntax highlighting theme:

project-to-epub /path/to/project --theme monokai

Custom title and author:

project-to-epub /path/to/project --title "My Awesome Project" --author "Jane Developer"

Configuration

The tool uses sensible defaults but can be customized using command-line options:

  • Theme: Default is default_eink, a monochrome high-contrast theme optimized for black-white e-ink displays.
  • Output File: Defaults to <project_name>.epub in the current directory.
  • File Size Handling: Files larger than 10MB are skipped by default.
  • Table of Contents: Defaults to a flat TOC. Use --hierarchical-toc to group entries by directory.
  • Metadata: Title defaults to the project directory name. Author defaults to "Project-to-EPUB Tool".

All settings can be customized via command-line options as shown in the usage section.

Supported Code File Types

Project-to-EPUB supports all file types recognized by Pygments. This includes most popular programming languages like Python, JavaScript, Java, C/C++, Ruby, Go, Rust, and many more.

Requirements

  • Python 3.8.1+
  • Pygments
  • pathspec
  • PyYAML
  • typer
  • Markdown

License

MIT

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

project_to_epub-0.2.1.tar.gz (23.6 kB view details)

Uploaded Source

Built Distribution

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

project_to_epub-0.2.1-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file project_to_epub-0.2.1.tar.gz.

File metadata

  • Download URL: project_to_epub-0.2.1.tar.gz
  • Upload date:
  • Size: 23.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for project_to_epub-0.2.1.tar.gz
Algorithm Hash digest
SHA256 ad2a66aa5c1cce5fc7f90a804bb8a5d33b011dcbcca99b2f5b7231b15256940e
MD5 9236a7024e45e31626db286fece1a056
BLAKE2b-256 1ee87bb5c9713f0392b02ba8b0c97a116457180d33ec58563644dad6f1da2ead

See more details on using hashes here.

Provenance

The following attestation bundles were made for project_to_epub-0.2.1.tar.gz:

Publisher: python-publish.yml on PsychArch/project-to-epub

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file project_to_epub-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: project_to_epub-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 20.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for project_to_epub-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 56610694e9966c6f022e0888784d51a49f78132d52563b6d2a8dfe633afd2b99
MD5 c5356d240ffc0ce8366ace75b0422650
BLAKE2b-256 beb31b25551e0d4ff311c8d74a59e1da948cb1b3ec8a9b251eeb8c09e36860f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for project_to_epub-0.2.1-py3-none-any.whl:

Publisher: python-publish.yml on PsychArch/project-to-epub

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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