An open API service indexing awesome lists of open source software.

https://github.com/johncmanuel/writebook

Python script that automates the creation of .docx files from a given template file, specifically one tailored for book manuscripts.
https://github.com/johncmanuel/writebook

Last synced: over 1 year ago
JSON representation

Python script that automates the creation of .docx files from a given template file, specifically one tailored for book manuscripts.

Awesome Lists containing this project

README

          

[![forthebadge made-with-python](http://ForTheBadge.com/images/badges/made-with-python.svg)](https://www.python.org/)
[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/)

# writeBook

Automatically copies and pastes a .docx file from a template document that contains all the industry standards for book manuscripts. This eliminates the hassle of setting up the document and working environment before writing a book.

This is only tested for the Windows OS.

## Command

```
book
```

## Preparations

Download templates here: https://kdp.amazon.com/en_US/help/topic/G201834230, create a 'Templates' folder, open the downloaded file and choose a language of your choice. Then, copy and paste all the .docx files into 'Templates'. I choose to do it this way rather than committing the template files themselves because I'm not sure if I'm legally allowed to republish Amazon KDP's content.

Alternatively, you can create your own .docx template with your own preferences and styles.

### Set up working environment

```
py -m venv
cd
git clone https://github.com/johncmanuel/writeBook.git
pip install requirements.txt
```

Run venv

```
cd Scripts && activate.bat && cd ..
```

### Environment Variables

In your local machine, add working environment to 'Path'.

In the working directory, create an .env file and add the following variables:

```
# .env

BOOK_DIR=
TEMPLATES_DIR=
PATH_TO_WORD=
```

\*However, `PATH_TO_WORD` can be used for any other writing software.