Skip to main content

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

Metadata

Release files for project-to-epub 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for project-to-epub 0.2.2
File Size Uploaded Provenance Actions
project_to_epub-0.2.2.tar.gz 24.2 kB With provenance Details for project_to_epub-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for project-to-epub 0.2.2
File Interpreter ABI Platform Actions
project_to_epub-0.2.2-py3-none-any.whl Python 3 none any Details for project_to_epub-0.2.2-py3-none-any.whl

Total release size: 44.7 kB

Release files / project_to_epub-0.2.2.tar.gz

Download URL project_to_epub-0.2.2.tar.gz
Size 24.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4810e7319add9b824d840a43fe72ec127ed19ef2f8bd11f83e8a3e3890c3c5fe
BLAKE2b-256 checksum
How to use checksums
f3a9c254a27e3ac313d502f799f04281499356b91ade584df8b2d7e0c1964258
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / project_to_epub-0.2.2-py3-none-any.whl

Download URL project_to_epub-0.2.2-py3-none-any.whl
Size 20.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
524a24b3c91c8927e8c8fb8c6c6e0a5e73213dcef4c3e63f2f9f29edfa6d6cae
BLAKE2b-256 checksum
How to use checksums
2a975b25aaeb21d9735253a4547c0d8ad3addad7861f6207df9d6ba298687676
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Security for project-to-epub 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for project_to_epub-0.2.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page