Name | fromto JSON |
Version |
1.0.0
JSON |
| download |
home_page | None |
Summary | Package for performing translation operations between Karakalpak and other 204 languages through the from-to.uz site |
upload_time | 2024-03-25 15:15:10 |
maintainer | None |
docs_url | None |
author | Turdıbek Jumabaev |
requires_python | None |
license | None |
keywords |
karakalpak
fromto
translator
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# FromTo Translator
FromTo Translator is a Python library that provides the ability to perform translation operations between the Karakalpak language and 204 other languages using the APIs of the from-to.uz site.
## Usage
```python
from fromto import Translator
translator = Translator()
# Example usage: Translate from Uzbek to Karakalpak
translation = translator.translate(text="salom")
print(translation.text()) # Salom
print(translation.result()) # Sálem
print(translation.from_lang()) # uzn_Latn
print(translation.to_lang()) # kaa
```
## Translator Class
#### `Translator()`
Initialize a `Translator` object with the base URL of the translation API.
#### `translate(text: str, from_lang: str = "uzn_Latn", to_lang: str = "kaa") -> TranslateResult`
Translate text from one language to another using the translation API.
- `text` (str): The text to be translated.
- `from_lang` (str, optional): The code representing the original language of the text. Defaults to "uzn_Latn".
- `to_lang` (str, optional): The code representing the target language for translation. Defaults to "kaa".
Returns:
`TranslateResult`: An object representing the translation result.
Raises:
`TranslateFail`: If there is an issue with the translation request.
## Example
```python
from fromto import Translator, TranslateFail
translator = Translator()
try:
translation = translator.translate("Hello", from_lang="no_lang", to_lang="no_lang")
print(translation.result)
except TranslateFail as e:
print(f"Translation failed: {e}")
```
## Languages
| Language | Code |
|----------------|----------|
| English | eng_Latn |
| Russian | rus_Cyrl |
| Uzbek | uzn_Latn |
| Karakalpak | kaa |
| Acehnese | ace_Latn |
| Mesopotamian Arabic | acm_Arab |
| Ta’izzi-Adeni Arabic | acq_Arab |
| Tunisian Arabic | aeb_Arab |
| Afrikaans | afr_Latn |
| South Levantine Arabic | ajp_Arab |
| Akan | aka_Latn |
| Amharic | amh_Ethi |
| North Levantine Arabic | apc_Arab |
| Modern Standard Arabic | arb_Arab |
| Modern Standard Arabic (Romanized) | arb_Latn |
| Najdi Arabic | ars_Arab |
| Moroccan Arabic | ary_Arab |
| Egyptian Arabic | arz_Arab |
| Assamese | asm_Beng |
| Asturian | ast_Latn |
| Awadhi | awa_Deva |
| Central Aymara | ayr_Latn |
| South Azerbaijani | azb_Arab |
| North Azerbaijani | azj_Latn |
| Bashkir | bak_Cyrl |
| Bambara | bam_Latn |
| Balinese | ban_Latn |
| Belarusian | bel_Cyrl |
| Bemba | bem_Latn |
| Bengali | ben_Beng |
| Bhojpuri | bho_Deva |
| Banjar | bjn_Latn |
| Standard Tibetan | bod_Tibt |
| Bosnian | bos_Latn |
| Buginese | bug_Latn |
| Bulgarian | bul_Cyrl |
| Catalan | cat_Latn |
| Cebuano | ceb_Latn |
| Czech | ces_Latn |
| Chokwe | cjk_Latn |
| Central Kurdish | ckb_Arab |
| Crimean Tatar | crh_Latn |
| Welsh | cym_Latn |
| Danish | dan_Latn |
| German | deu_Latn |
| Southwestern Dinka | dik_Latn |
| Dyula | dyu_Latn |
| Dzongkha | dzo_Tibt |
| Greek | ell_Grek |
| Esperanto | epo_Latn |
| Estonian | est_Latn |
| Basque | eus_Latn |
| Ewe | ewe_Latn |
| Faroese | fao_Latn |
| Fijian | fij_Latn |
| Finnish | fin_Latn |
| Fon | fon_Latn |
| French | fra_Latn |
| Friulian | fur_Latn |
| Nigerian Fulfulde | fuv_Latn |
| Scottish Gaelic | gla_Latn |
| Irish | gle_Latn |
| Galician | glg_Latn |
| Guarani | grn_Latn |
| Gujarati | guj_Gujr |
| Haitian Creole | hat_Latn |
| Hausa | hau_Latn |
| Hebrew | heb_Hebr |
| Hindi | hin_Deva |
| Chhattisgarhi | hne_Deva |
| Croatian | hrv_Latn |
| Hungarian | hun_Latn |
| Armenian | hye_Armn |
| Igbo | ibo_Latn |
| Ilocano | ilo_Latn |
| Indonesian | ind_Latn |
| Icelandic | isl_Latn |
| Italian | ita_Latn |
| Javanese | jav_Latn |
| Japanese | jpn_Jpan |
| Kabyle | kab_Latn |
| Jingpho | kac_Latn |
| Kamba | kam_Latn |
| Kannada | kan_Knda |
| Georgian | kat_Geor |
| Central Kanuri | knc_Latn |
| Kazakh | kaz_Cyrl |
| Kabiyè | kbp_Latn |
| Kabuverdianu | kea_Latn |
| Khmer | khm_Khmr |
| Kikuyu | kik_Latn |
| Kinyarwanda | kin_Latn |
| Kyrgyz | kir_Cyrl |
| Kimbundu | kmb_Latn |
| Northern Kurdish | kmr_Latn |
| Kikongo | kon_Latn |
| Korean | kor_Hang |
| Lao | lao_Laoo |
| Ligurian | lij_Latn |
| Limburgish | lim_Latn |
| Lingala | lin_Latn |
| Lithuanian | lit_Latn |
| Lombard | lmo_Latn |
| Latgalian | ltg_Latn |
| Luxembourgish | ltz_Latn |
| Luba-Kasai | lua_Latn |
| Ganda | lug_Latn |
| Luo | luo_Latn |
| Mizo | lus_Latn |
| Standard Latvian | lvs_Latn |
| Magahi | mag_Deva |
| Maithili | mai_Deva |
| Malayalam | mal_Mlym |
| Marathi | mar_Deva |
| Minangkabau | min_Latn |
| Macedonian | mkd_Cyrl |
| Plateau Malagasy | plt_Latn |
| Maltese | mlt_Latn |
| Meitei | mni_Beng |
| Halh Mongolian | khk_Cyrl |
| Mossi | mos_Latn |
| Maori | mri_Latn |
| Burmese | mya_Mymr |
| Dutch | nld_Latn |
| Norwegian Nynorsk | nno_Latn |
| Norwegian Bokmål | nob_Latn |
| Nepali | npi_Deva |
| Northern Sotho | nso_Latn |
| Nuer | nus_Latn |
| Nyanja | nya_Latn |
| Occitan | oci_Latn |
| West Central Oromo | gaz_Latn |
| Odia | ory_Orya |
| Pangasinan | pag_Latn |
| Eastern Panjabi | pan_Guru |
| Papiamento | pap_Latn |
| Western Persian | pes_Arab |
| Polish | pol_Latn |
| Portuguese | por_Latn |
| Dari | prs_Arab |
| Southern Pashto | pbt_Arab |
| Ayacucho Quechua | quy_Latn |
| Romanian | ron_Lat
## License
This library is licensed under the MIT License.
Raw data
{
"_id": null,
"home_page": null,
"name": "fromto",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "karakalpak, fromto, translator",
"author": "Turd\u0131bek Jumabaev",
"author_email": "<turdibekjumabaev05@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/1d/22/c722424a77f318d7965b50b99e96792bbc649b508df863c60f0d95099d1b/fromto-1.0.0.tar.gz",
"platform": null,
"description": "\n# FromTo Translator\n\nFromTo Translator is a Python library that provides the ability to perform translation operations between the Karakalpak language and 204 other languages using the APIs of the from-to.uz site.\n\n## Usage\n\n```python\nfrom fromto import Translator\n\ntranslator = Translator()\n\n# Example usage: Translate from Uzbek to Karakalpak\ntranslation = translator.translate(text=\"salom\")\n\nprint(translation.text()) # Salom\nprint(translation.result()) # S\u00e1lem\nprint(translation.from_lang()) # uzn_Latn\nprint(translation.to_lang()) # kaa\n```\n\n## Translator Class\n\n#### `Translator()`\n\nInitialize a `Translator` object with the base URL of the translation API.\n\n#### `translate(text: str, from_lang: str = \"uzn_Latn\", to_lang: str = \"kaa\") -> TranslateResult`\n\nTranslate text from one language to another using the translation API.\n\n- `text` (str): The text to be translated.\n- `from_lang` (str, optional): The code representing the original language of the text. Defaults to \"uzn_Latn\".\n- `to_lang` (str, optional): The code representing the target language for translation. Defaults to \"kaa\".\n\nReturns:\n`TranslateResult`: An object representing the translation result.\n\nRaises:\n`TranslateFail`: If there is an issue with the translation request.\n\n## Example\n\n```python\nfrom fromto import Translator, TranslateFail\n\ntranslator = Translator()\n\ntry:\n translation = translator.translate(\"Hello\", from_lang=\"no_lang\", to_lang=\"no_lang\")\n print(translation.result)\nexcept TranslateFail as e:\n print(f\"Translation failed: {e}\")\n```\n\n## Languages\n| Language | Code |\n|----------------|----------|\n| English | eng_Latn |\n| Russian | rus_Cyrl |\n| Uzbek | uzn_Latn |\n| Karakalpak | kaa |\n| Acehnese | ace_Latn |\n| Mesopotamian Arabic | acm_Arab |\n| Ta\u2019izzi-Adeni Arabic | acq_Arab |\n| Tunisian Arabic | aeb_Arab |\n| Afrikaans | afr_Latn |\n| South Levantine Arabic | ajp_Arab |\n| Akan | aka_Latn |\n| Amharic | amh_Ethi |\n| North Levantine Arabic | apc_Arab |\n| Modern Standard Arabic | arb_Arab |\n| Modern Standard Arabic (Romanized) | arb_Latn |\n| Najdi Arabic | ars_Arab |\n| Moroccan Arabic | ary_Arab |\n| Egyptian Arabic | arz_Arab |\n| Assamese | asm_Beng |\n| Asturian | ast_Latn |\n| Awadhi | awa_Deva |\n| Central Aymara | ayr_Latn |\n| South Azerbaijani | azb_Arab |\n| North Azerbaijani | azj_Latn |\n| Bashkir | bak_Cyrl |\n| Bambara | bam_Latn |\n| Balinese | ban_Latn |\n| Belarusian | bel_Cyrl |\n| Bemba | bem_Latn |\n| Bengali | ben_Beng |\n| Bhojpuri | bho_Deva |\n| Banjar | bjn_Latn |\n| Standard Tibetan | bod_Tibt |\n| Bosnian | bos_Latn |\n| Buginese | bug_Latn |\n| Bulgarian | bul_Cyrl |\n| Catalan | cat_Latn |\n| Cebuano | ceb_Latn |\n| Czech | ces_Latn |\n| Chokwe | cjk_Latn |\n| Central Kurdish | ckb_Arab |\n| Crimean Tatar | crh_Latn |\n| Welsh | cym_Latn |\n| Danish | dan_Latn |\n| German | deu_Latn |\n| Southwestern Dinka | dik_Latn |\n| Dyula | dyu_Latn |\n| Dzongkha | dzo_Tibt |\n| Greek | ell_Grek |\n| Esperanto | epo_Latn |\n| Estonian | est_Latn |\n| Basque | eus_Latn |\n| Ewe | ewe_Latn |\n| Faroese | fao_Latn |\n| Fijian | fij_Latn |\n| Finnish | fin_Latn |\n| Fon | fon_Latn |\n| French | fra_Latn |\n| Friulian | fur_Latn |\n| Nigerian Fulfulde | fuv_Latn |\n| Scottish Gaelic | gla_Latn |\n| Irish | gle_Latn |\n| Galician | glg_Latn |\n| Guarani | grn_Latn |\n| Gujarati | guj_Gujr |\n| Haitian Creole | hat_Latn |\n| Hausa | hau_Latn |\n| Hebrew | heb_Hebr |\n| Hindi | hin_Deva |\n| Chhattisgarhi | hne_Deva |\n| Croatian | hrv_Latn |\n| Hungarian | hun_Latn |\n| Armenian | hye_Armn |\n| Igbo | ibo_Latn |\n| Ilocano | ilo_Latn |\n| Indonesian | ind_Latn |\n| Icelandic | isl_Latn |\n| Italian | ita_Latn |\n| Javanese | jav_Latn |\n| Japanese | jpn_Jpan |\n| Kabyle | kab_Latn |\n| Jingpho | kac_Latn |\n| Kamba | kam_Latn |\n| Kannada | kan_Knda |\n| Georgian | kat_Geor |\n| Central Kanuri | knc_Latn |\n| Kazakh | kaz_Cyrl |\n| Kabiy\u00e8 | kbp_Latn |\n| Kabuverdianu | kea_Latn |\n| Khmer | khm_Khmr |\n| Kikuyu | kik_Latn |\n| Kinyarwanda | kin_Latn |\n| Kyrgyz | kir_Cyrl |\n| Kimbundu | kmb_Latn |\n| Northern Kurdish | kmr_Latn |\n| Kikongo | kon_Latn |\n| Korean | kor_Hang |\n| Lao | lao_Laoo |\n| Ligurian | lij_Latn |\n| Limburgish | lim_Latn |\n| Lingala | lin_Latn |\n| Lithuanian | lit_Latn |\n| Lombard | lmo_Latn |\n| Latgalian | ltg_Latn |\n| Luxembourgish | ltz_Latn |\n| Luba-Kasai | lua_Latn |\n| Ganda | lug_Latn |\n| Luo | luo_Latn |\n| Mizo | lus_Latn |\n| Standard Latvian | lvs_Latn |\n| Magahi | mag_Deva |\n| Maithili | mai_Deva |\n| Malayalam | mal_Mlym |\n| Marathi | mar_Deva |\n| Minangkabau | min_Latn |\n| Macedonian | mkd_Cyrl |\n| Plateau Malagasy | plt_Latn |\n| Maltese | mlt_Latn |\n| Meitei | mni_Beng |\n| Halh Mongolian | khk_Cyrl |\n| Mossi | mos_Latn |\n| Maori | mri_Latn |\n| Burmese | mya_Mymr |\n| Dutch | nld_Latn |\n| Norwegian Nynorsk | nno_Latn |\n| Norwegian Bokm\u00e5l | nob_Latn |\n| Nepali | npi_Deva |\n| Northern Sotho | nso_Latn |\n| Nuer | nus_Latn |\n| Nyanja | nya_Latn |\n| Occitan | oci_Latn |\n| West Central Oromo | gaz_Latn |\n| Odia | ory_Orya |\n| Pangasinan | pag_Latn |\n| Eastern Panjabi | pan_Guru |\n| Papiamento | pap_Latn |\n| Western Persian | pes_Arab |\n| Polish | pol_Latn |\n| Portuguese | por_Latn |\n| Dari | prs_Arab |\n| Southern Pashto | pbt_Arab |\n| Ayacucho Quechua | quy_Latn |\n| Romanian | ron_Lat\n\n## License\n\nThis library is licensed under the MIT License.\n",
"bugtrack_url": null,
"license": null,
"summary": "Package for performing translation operations between Karakalpak and other 204 languages through the from-to.uz site",
"version": "1.0.0",
"project_urls": null,
"split_keywords": [
"karakalpak",
" fromto",
" translator"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7bcf2a4a9a31a00e5b8276b9cc0507b1b2088d116e7278026d6edc3decd2700c",
"md5": "2e1f89fef173ae441945923e353cc3a1",
"sha256": "b54b16ebdbc9a94a904212c2b1d25b0f38e0d6abb70e05d6572bc45aa8f4fdc0"
},
"downloads": -1,
"filename": "fromto-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2e1f89fef173ae441945923e353cc3a1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 6467,
"upload_time": "2024-03-25T15:15:08",
"upload_time_iso_8601": "2024-03-25T15:15:08.630407Z",
"url": "https://files.pythonhosted.org/packages/7b/cf/2a4a9a31a00e5b8276b9cc0507b1b2088d116e7278026d6edc3decd2700c/fromto-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1d22c722424a77f318d7965b50b99e96792bbc649b508df863c60f0d95099d1b",
"md5": "6ea980350909f62ed5c6321f743afc50",
"sha256": "93809c657b7397e8d8d18d8809619f6979629b58b0e30185d0099d3ab97c0db8"
},
"downloads": -1,
"filename": "fromto-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "6ea980350909f62ed5c6321f743afc50",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 6142,
"upload_time": "2024-03-25T15:15:10",
"upload_time_iso_8601": "2024-03-25T15:15:10.919497Z",
"url": "https://files.pythonhosted.org/packages/1d/22/c722424a77f318d7965b50b99e96792bbc649b508df863c60f0d95099d1b/fromto-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-25 15:15:10",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "fromto"
}