Skip to main content

No project description provided

Project description

KR Translator

Translate a korean txt file.

Installation

You can install the package using pip:

pip install kr-translation

Usage

Getting OPENAI API KEY

  1. Go to https://platform.openai.com/api-keys, follow instruction over there.

  2. Save the API KEY somewhere save.

Basic Translation

from kr_translator.caller import TextTranslator

translator = TextTranslator(
  api_key="your_api_key_here", 
  source_file_location="/path/to/file.txt"
)
output = translator.translate()

print(output)

Save Translation to a file

from kr_translator.caller import TextTranslator

translator = TextTranslator(
  api_key="your_api_key_here", 
  source_file_location="/path/to/file.txt"
)
translator.save_translation("output_file.txt")

Passing character information to improve translation

from kr_translator.caller import TextTranslator

translator = TextTranslator(
  api_key="your_api_key_here", 
  source_file_location="/path/to/file.txt"
)

character_info = """
Seo Dalmi, a girl.
Nam Dosan, a boy.
Han Jipyeong, a boy, team leader at SH venture capital.
"""

translator.save_translation(
    destination_file_location="output_file.txt",
    characters=character_info
)

Passing additional information to improve translation

from kr_translator.caller import TextTranslator

translator = TextTranslator(
  api_key="your_api_key_here", 
  source_file_location="/path/to/file.txt"
)

additonal_info = """
The story revolve around startups and venture capital, therefore there is gonna be company name
that might have direct english translation, in which DO NOT translate them into english but keep
the Korean name.
"""

translator.save_translation(
    destination_file_location="output_file.txt",
    additional_info=additonal_info
)

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kr_translator-0.1.2.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

kr_translator-0.1.2-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file kr_translator-0.1.2.tar.gz.

File metadata

  • Download URL: kr_translator-0.1.2.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.6

File hashes

Hashes for kr_translator-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d143d86297da1042bf3737e9c2e1674081f6b213eccc830fdc0318f5e2bb9d3e
MD5 e015bf804348f8937f2fbf0735503976
BLAKE2b-256 b62b375834e7181f84fa6c07f6a89101c17b37a744173abf5f0841bf5d032c91

See more details on using hashes here.

File details

Details for the file kr_translator-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for kr_translator-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2b530c96a3ba159c316e4f04cec68d659ba798fee46ebbf61c4cfbccaa07f5d3
MD5 53f1d454a686a472b6e2cc41d3bfdb51
BLAKE2b-256 32c02364c730e3b50ae83e4b74b0e2b3bc6a02b376a7309e8931d1e08c779db3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page