Generating books using OpenAI's GPT-3 API.
Project description
BookGPT (Beta)
This program uses the GPT-3 API to generate books based on your specified parameters.
Installation
To install this program, simply follow these steps:
- Clone this repository to your local machine by running the following command in your terminal:
git clone https://github.com/mikavehns/BookGPT.git
-
Navigate to the root directory of the repository using
cd BookGPT/src
-
Install the required dependencies by running the following command:
pip install -r requirements.txt
Prerequisites
In order to use this program, you must have a GPT-3 API key. The API Key must then be inserted into the config.json
file.
Usage
To use this program, simply run the following command in your terminal:
python run.py
You will then be prompted to enter the following information:
-
Chapter Amount: The amount of chapters you want the book to have.
-
Chapter Length: The amount of words you want each chapter to have.
-
Topic: The topic you want the book to be about.
-
Category: The type of book you want to generate. (Science, Biography, etc.)
The program will then generate a Title and Chapter Titles + Content. You will get a detailed structure of the book.
The generated books will then be saved in the books
folder and will be named after the title of the book.
Examples
Here are some examples:
- Generate book with 5 chapters and 300 words per chapter, with quotes as chapter title, with the topic "success":
- You can see all examples in the
examples/
directory.
Notes
-
The run.py file is just one example on how to use the book generator. You can also implement it into a website, discord bot, desktop app, etc.
-
The program may take some time to run, depending on the specified parameters and the performance of the GPT-3 API. Please be patient while the book is being generated.
-
The program may not always generate the wished amount of words for each chapter. This can happen, if there is not enough data available for the specified topic.
-
Currently, it is only possible to generate Non-Fiction books.
-
Since this is a really early version (v0.6.2), there are many missing features, that will be added by time
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
-
If you are interested in contributing to BookGPT, I welcome any suggestions or pull requests. Please feel free to open an issue or submit a pull request on the GitHub repository.
-
You can also submit your books, which I will then add to the
examples
folder. Just open a pull request with the book in theexamples
folder.
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file bookgpt-0.6.2.1.tar.gz
.
File metadata
- Download URL: bookgpt-0.6.2.1.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdebee1117c78616e27ef2ef021495d0e4f550c9b228bc66cd0fb9409b7442f0 |
|
MD5 | c87329d25f667f457c9f289d321e6abc |
|
BLAKE2b-256 | c599c51594c83844c6a39e2648ace0f2d165d257af848e133986799d6cf1a8e2 |
File details
Details for the file bookgpt-0.6.2.1-py3-none-any.whl
.
File metadata
- Download URL: bookgpt-0.6.2.1-py3-none-any.whl
- Upload date:
- Size: 17.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eca4af942371483afed7b62bac574d200928541b44cedce9cf4b3bafef124f3c |
|
MD5 | 48a2e988727c988324ddddb5c304af49 |
|
BLAKE2b-256 | 1f073c5c83bb587258d5624f162f5411c8cb28b891cc2a9e483cc04987d49b5d |