Skip to main content

Translate korean text

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.4.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: kr_translator-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 0dfc005f48f32bb82aac0f7191e976869987499b925c74bfc6c8de1ea0ec37a9
MD5 509a10426b23460fc42838d798e186d5
BLAKE2b-256 f6cae8f3fd6d2943848e4e43eebb217f57ac14d5012eb104b5b1b40476042ecb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kr_translator-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bc1719e285aea577cb1a7e764772bca8d81428c72d49a6a0523426939e74152d
MD5 46e05b90f074efe13e5a25000241deda
BLAKE2b-256 84ef0324eb27740077eba579165966b9f556e0de73971cc223e4426aa472e76b

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