{"id":15510585,"url":"https://github.com/kortirso/yandex_translator","last_synced_at":"2025-04-10T11:42:01.901Z","repository":{"id":57558044,"uuid":"116649077","full_name":"kortirso/yandex_translator","owner":"kortirso","description":"Elixir package for interaction with Yandex.Translate API","archived":false,"fork":false,"pushed_at":"2019-01-30T11:51:43.000Z","size":39,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T10:38:40.405Z","etag":null,"topics":["elixir","elixir-library","phoenix","text-translation","translation-api","yandex-translate"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kortirso.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-08T08:18:45.000Z","updated_at":"2019-02-02T11:36:48.000Z","dependencies_parsed_at":"2022-08-28T09:30:43.585Z","dependency_job_id":null,"html_url":"https://github.com/kortirso/yandex_translator","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kortirso%2Fyandex_translator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kortirso%2Fyandex_translator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kortirso%2Fyandex_translator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kortirso%2Fyandex_translator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kortirso","download_url":"https://codeload.github.com/kortirso/yandex_translator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248211330,"owners_count":21065722,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","elixir-library","phoenix","text-translation","translation-api","yandex-translate"],"created_at":"2024-10-02T09:49:41.231Z","updated_at":"2025-04-10T11:42:01.879Z","avatar_url":"https://github.com/kortirso.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# YandexTranslator\n\nA simple Elixir interface to Yandex Translate's translation API\n\n## Installation\n\nIf [available in Hex](https://hex.pm/docs/publish), the package can be installed\nby adding `yandex_translator` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:yandex_translator, \"~\u003e 0.9.6\"}\n  ]\nend\n```\n\n## Get access to API\n\n### Getting a Cloud Key and Folder ID (for cloud API)\n\nTo sign up go [here](https://cloud.yandex.com/docs/translate/concepts/auth)\n\n### Getting a Subscription Key (for old API)\n\nTo sign up go [here](https://translate.yandex.ru/developers/keys)\n\n## Configuration\n\nThe default behaviour is to configure using the application environment:\n\nIn config/config.exs, add:\n\n```elixir\n  # for configuring access to cloud api\n  config :yandex_translator, cloud_api_key: \"API_KEY\"\n  config :yandex_translator, cloud_folder_id: \"FOLDER_ID\"\n\n  # for configuring access to old api\n  config :yandex_translator, api_key: \"API_KEY\"\n```\n\n## Usage\n\n### Get IAM-token for cloud API access\n\nRequest for getting IAM-token for access to cloud API.\n\n```elixir\n  # without params\n  YandexTranslator.get_iam_token\n\n  # or with key\n  YandexTranslator.get_iam_token([key: \"API_KEY\"])\n```\n\n#### Options\n\n    key - API KEY, required or optional (if presented in configuration)\n\n### Supported languages\n\nRequest for getting list of supported languages is #langs.\nFor using cloud api options must contain iam_token param.\n\n```elixir\n  # cloud api request\n  YandexTranslator.langs([iam_token: \"\"])\n\n  # old api request\n  YandexTranslator.langs([])\n```\n\n#### Options for cloud api\n\n    iam_token - IAM-token, required\n    folder_id - folder ID of your account at Yandex.Cloud, required or optional (if presented in configuration)\n\n#### Options for old api\n\n    key - access key, required or optional (if presented in config)\n    format - one of the [xml|json], default - xml, optional\n    ui - language code for getting language translations, optional, example - \"en\"\n\n### Detection\n\nRequest for detecting language of text is #detect.\nFor using cloud api options must contain iam_token param.\n\n```elixir\n  # cloud api request\n  YandexTranslator.detect([iam_token: \"\", text: \"Hello\"])\n\n  # old api request\n  YandexTranslator.detect([text: \"Hello\"])\n```\n\n#### Options for cloud api\n\n    iam_token - IAM-token, required\n    folder_id - folder ID of your account at Yandex.Cloud, required or optional (if presented in configuration)\n    text - text for detection, required\n    hint - list of possible languages, optional, example - \"en,ru\"\n\n#### Options for old api\n\n    key - access key, required or optional (if presented in config)\n    format - one of the [xml|json], default - xml, optional\n    text - text, required\n    hint - list of possible languages, optional, example - \"en,ru\"\n\n### Translation\n\nRequest for translating text is #translate.\nFor using cloud api options must contain iam_token param.\n\n```elixir\n  # cloud api request\n  YandexTranslator.translate([iam_token: \"\", text: \"Hello\", target: \"ru\"])\n\n  # old api request\n  YandexTranslator.translate([text: \"Hello\", lang: \"en-ru\"])\n```\n#### Options for cloud api\n\n    iam_token - IAM-token, required\n    folder_id - folder ID of your account at Yandex.Cloud, required or optional (if presented in configuration)\n    text - text for detection, required\n    source - source language, ISO 639-1 format (like \"en\"), optional\n    target - target language, ISO 639-1 format (like \"ru\"), required\n    format - text format, one of the [plain|html], default - plain, optional\n\n#### Options for old api\n\n    key - access key, required or optional (if presented in config)\n    format - one of the [xml|json], default - xml, optional\n    text - text, required\n    lang - direction of translation, required, example - \"from-to\" or \"to\"\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/kortirso/yandex_translator.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n## Disclaimer\n\nUse this package at your own peril and risk.\n\n## Documentation\n\nDocumentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)\nand published on [HexDocs](https://hexdocs.pm). Once published, the docs can\nbe found at [https://hexdocs.pm/yandex_translator](https://hexdocs.pm/yandex_translator).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkortirso%2Fyandex_translator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkortirso%2Fyandex_translator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkortirso%2Fyandex_translator/lists"}