Giter VIP home page Giter VIP logo

deepl_translator's Introduction

deepl_translator

deepl_translator is a simple command-line tool that uses the DeepL API (free version) to translate text between English and Japanese. This tool takes text from standard input and outputs the translation to standard output.

Features

  • Supports translation from English to Japanese and vice versa
  • Easy to use from the command line
  • Simple API key configuration through a .env file

Prerequisites

  • Python 3.x
  • pip (Python's package manager)

Installation

Use the following command to install deepl_translator:

pip install git+https://yourrepository.com/deepl_translator.git

Note: Replace the above URL with the URL of the Git repository hosting this package.

API Key Configuration

Before using deepl_translator, you need to obtain a free API key from DeepL API and configure it in a .env file as follows:

  1. Create a free account on DeepL API and obtain an API key here.
  2. Create a .env file in the root directory of the project.
  3. Add the following content to the .env file, replacing YOUR_API_KEY with your actual API key:
DEEPL_API_KEY=YOUR_API_KEY

Usage

Use deepl_translator from the command line to translate a text file:

cat input.txt | deepl -t [target_language] > output.txt

Here, [target_language] specifies the target language for translation. The options are as follows:

  • j or japanese: Translate to Japanese
  • e or english: Translate to English

For example, to translate an English text file to Japanese:

cat input.txt | deepl -t j > output.txt

License

This project is published under the MIT License.

Contributions

If you would like to contribute, please send a pull request or report an issue. We appreciate all contributions!

deepl_translator's People

Contributors

yostos avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.