Skip to content

amanvirparhar/gempress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GemPress

GemPress Thumbnail

A Python script that uses Google’s Gemini-1.5-Flash model to fix basic typesetting and formatting issues in public domain eBooks from Project Gutenberg.

Learn more about GemPress by reading the accompanying blog post.

Setup

  1. Clone the repository, and cd into it:
    git clone https://github.com/amanvirparhar/gempress
    cd gempress
  2. Create a .env file in this directory with the following contents:
    GEMINI_API_KEY=your_api_key_here
  3. Install uv.

Usage

  1. Put the raw text file of the book you want to reformat in the same directory as main.py.
  2. Change the path to the text file in main.py to the name of the file you want to reformat.
  3. Run the script:
    uv run --with-requirements requirements.txt --python 3.13 main.py
  4. You should find an ePub file in the same directory as main.py with the same name as the input file (except with the .epub file extension).
  5. Feel free to play around with prompt.txt.

About

A script to fix basic typesetting & formatting issues in public domain eBooks.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages