Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/steveyiyo/TranslateMD
https://github.com/steveyiyo/TranslateMD
Last synced: 15 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/steveyiyo/TranslateMD
- Owner: steveyiyo
- Created: 2023-04-03T06:29:17.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-04-03T08:11:52.000Z (over 1 year ago)
- Last Synced: 2024-08-01T15:10:09.586Z (3 months ago)
- Language: Python
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Markdown Translator
This Python script translates Markdown files from one language to English using the OpenAI GPT-3.5 API.
## Prerequisites
To use this script, you will need:
- An OpenAI API key.
- Markdown files that you would like to translate.
- Python 3 installed on your system.## Installation
1. Clone this repository to your local machine.
`git clone [email protected]:steveyiyo/TranslateMD.git`
2. Install `pipenv` by running `pip install pipenv` in the terminal.
3. Navigate to the root directory of the project in the terminal.
4. Run `pipenv install` to install the required packages specified in the Pipfile.
5. Create a .env file in the root directory of the project and add your OpenAI API key, source path (where your Markdown files are located), and new path (where the translated files will be saved) as environment variables. For example:```
OPENAI_API_KEY=your_api_key_here
SOURCE_PATH=/path/to/source/folder
NEW_PATH=/path/to/new/folder
```## Usage
1. Run the script by executing `pipenv run python app.py` in the terminal.
2. The script will read all Markdown files in the source path, translate them to English, and save them to the new path.
3. The translated files will have the same name as the original files.Note: This README.md was generated by ChatGPT.