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
.gitignorerules 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 [required]
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 Error out on large files instead of skipping
--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 high-contrast theme optimized for e-ink displays. - Output File: Defaults to
<project_name>.epubin the current directory. - File Size Handling: Files larger than 10MB are skipped by default.
- 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.13+
- 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file project_to_epub-0.1.5.tar.gz.
File metadata
- Download URL: project_to_epub-0.1.5.tar.gz
- Upload date:
- Size: 18.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ac7e796dd24a0e345648b11dbc60226a789670e7c754bff06076ec86b9f7b21
|
|
| MD5 |
1763562e6938aca321afcbfc481ab387
|
|
| BLAKE2b-256 |
ac84699edabf30679f8e7f028896265b845a56e703541342d6917a167236872e
|
File details
Details for the file project_to_epub-0.1.5-py3-none-any.whl.
File metadata
- Download URL: project_to_epub-0.1.5-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e9190f14838678f584879b05420d75a49ab5a70e611e33377d77c783142b7ce
|
|
| MD5 |
5fa9a7c0c4821bfd60a52e7bb770f49f
|
|
| BLAKE2b-256 |
9204370ae560a620acea5035d4d8ebc8df4d77e882638bed441f3278c0f1ca01
|