pypapago 
Unofficial python wrapper for papago translate service.
Install
pip install -U pypapago
Usage
Basic usage (English to Korean)
from pypapago import Translator
translator = Translator()
result = translator.translate('I am GROOT')
print(result) # 나는 그루트다
Set Source/Target Language
from pypapago import Translator
translator = Translator()
result = translator.translate(
'카카오는 파파고를 좋아해',
source='ko',
target='en',
)
print(result) # Kakao likes papago.
Supported Language Codes
| Code | Desc |
|---|---|
| ko | Korean |
| en | English |
| ja | Japanese |
| zh-CN | Chinese |
| zh-TW | Chinese traditional |
| es | Spanish |
| fr | French |
| vi | Vietnamese |
| th | Thai |
| id | Indonesia |
Bulk Translation
Parallel bulk translation with Multiprocessing.
from pypapago import Translator
translator = Translator()
result = translator.bulk_translate(['apple', 'banana'])
print(result) # ['사과', '바나나']
You can also set how many workers to run manually.
(The more workers make your code faster but requires more system resources.)
Default to CPU Cores (HyperThreading = x2)
- ex) Run with 2cores
from pypapago import Translator
translator = Translator()
result = translator.bulk_translate(
['apple', 'banana'],
workers=2
)
print(result) # ['사과', '바나나']
Verbose output
If you need raw result from papago API, you can set verbose to True.
from pypapago import Translator
translator = Translator()
result = translator.translate('I am GROOT', verbose=True)
print(result) # RAW JSON Result
#{'delay': 400,
# 'delaySmt': 400,
# 'dict': {'items': [{'entry': '<b>I</b>',
# ...
# 'translatedText': '나는 그루트다'}
#}
Detail results may change.
Metadata
Release files for pypapago 0.1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pypapago-0.1.1.1-py3-none-any.whl | Python 3 | none | any | Details for pypapago-0.1.1.1-py3-none-any.whl |
Release files / pypapago-0.1.1.1-py3-none-any.whl
| Download URL | pypapago-0.1.1.1-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b9ebf9fbfac27564206214f0d97c35e650b448511a7281952879d285c2e168c1
|
|
BLAKE2b-256 checksum How to use checksums |
bef149e134c97e03ad5b1161b8000624d85c3199c2d20f6f48a183a0767e6c2c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.6.6
|
Security for pypapago 0.1.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.