AnkiEngCraft is an Anki deck generator designed for Portuguese speakers learning English.
- Read English sentences from CSV or TXT files
- Translate English sentences to Portuguese using Google Translate
- Generate English audio using Azure Speech API
- Create Anki decks (.apkg) or CSV files with translated sentences and audio files
- Python 3.6+
- Azure Speech API key (you can sign up for a free trial)
- Clone the repository:
git clone git@github.com:willycamargo/csv-google-translate-python.git
cd csv-google-translate-python
- Install the required packages:
pip install -r requirements.txt
- Create a
.env
file using the provided.env.example
file and fill in theAZURE_SPEECH_KEY
andAZURE_REGION
with your Azure Speech API key and region, respectively:
cp .env.example .env
Prepare an input file with sentences in CSV or TXT format.
- CSV format: The CSV file should have a header with a
sentence
column, e.g.:
id,sentence
1,The cat is on the mat.
2,The sky is blue.
- TXT format: The TXT file should have one sentence per line, e.g.:
The cat is on the mat.
The sky is blue.
Run the script using the following command:
python main.py --input input/input_file_name --format output_format --output output_file_name
input_file_name
: The name of the input file (with extension) located in theinput
directory.output_format
: The desired output format (anki
for Anki deck orcsv
for CSV file).output_file_name
: The name of the output file (without extension).
For example, to create an Anki deck from the example.csv
input file, run:
python main.py --input input/example.csv --format anki --output my_deck
The generated Anki deck or CSV file will be saved in the output
directory.
This project is licensed under the MIT License.