{"id":22546612,"url":"https://github.com/prx/amara","last_synced_at":"2025-04-10T00:52:42.213Z","repository":{"id":62553228,"uuid":"12061558","full_name":"PRX/amara","owner":"PRX","description":"Ruby Gem to access the Amara API","archived":false,"fork":false,"pushed_at":"2019-04-24T12:54:13.000Z","size":42,"stargazers_count":2,"open_issues_count":2,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-10T00:52:36.489Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PRX.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-12T17:10:34.000Z","updated_at":"2018-11-07T18:33:19.000Z","dependencies_parsed_at":"2022-11-03T04:15:38.125Z","dependency_job_id":null,"html_url":"https://github.com/PRX/amara","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PRX%2Famara","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PRX%2Famara/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PRX%2Famara/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PRX%2Famara/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PRX","download_url":"https://codeload.github.com/PRX/amara/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137995,"owners_count":21053775,"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":[],"created_at":"2024-12-07T15:08:21.990Z","updated_at":"2025-04-10T00:52:42.195Z","avatar_url":"https://github.com/PRX.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Amara\n\n[![Build Status](https://travis-ci.org/PRX/amara.svg?branch=master)](https://travis-ci.org/PRX/amara)\n\nRuby gem to access the Amara API.\n\nhttp://www.amara.org/\n\nhttp://amara.readthedocs.org/en/latest/api.html\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'amara'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install amara\n\n## Usage\n\nYou need a user account and API key to use the API.\nSome capabilities (e.g. creating a team) are only enabled for enterprise customers.\n\nYou can use the API on these top level and nested entities (see the client.rb for top level) that match the APi docs:\n\n```ruby\namara = Amara::Client.new\n\namara.videos\namara.videos.languages\namara.videos.languages.subtitles\namara.videos.urls\n\namara.users\n\namara.teams\namara.teams.applications\namara.teams.members\namara.teams.projects\namara.teams.safe_members\namara.teams.tasks\n\namara.activity\n\namara.languages\n\namara.message\n```\n\nFor each type of entity, you get the following methods: `list`, `get`, `create`, `update`, and `delete`.\n\nAll these method calls return an `Amara::Response` instance.\n\nEntities may be nested, and params passed in for each nesting.\nparams to an entity can be a Hash of options, or a string, in which case it is treated like the id of that entity type.\n\nHere is an example of how to get the English subtitles for a video with a certain id.\nIt shows the use of nested entities, string id params for each entity, and the get method called with no query params:\n```ruby\namara = Amara::Client.new(api_username: 'amara_api_username', api_key: 'amara_api_key')\n\n# get the English subtitles for a video\namara.videos('yourVideoId').languages('en').subtitles.get\n\n```\n\nHere are some more examples of listing and creating a video:\n```ruby\n# get a list of videos\namara = Amara::Client.new(api_username: 'amara_api_username', api_key: 'amara_api_key')\nresponse = amara.videos\nvideos = response.objects.list\n\n# amara responses for a 'list' are paged, get the next page like this:\nmore_videos = response.next_page\n\n\n# create a video\nresponse = amara.videos.create({\n  team:      'my-team-name',\n  title:     'title',\n  video_url: 'https://archive.org/download/example/example.ogg',\n  primary_audio_language_code: 'en'\n})\nvideo = response.object\n```\n\nYou can do these same operations for Teams and other entities.\nThe gem defines lists of `Amara::POLICIES` and `Amara::TEAM_POLICIES` you can use in your requests:\n```ruby\n# create a team\nnew_team = amara.teams.create(\n  slug:              'prx-test-1',\n  name:              'prx test 1',\n  is_visible:        false,\n  membership_policy: Amara::TEAM_POLICIES[:invite]\n)\n\n```\n\nIn the event of an error from the Amara service, the error will be wrapped in one of the following exception clases.\n```ruby\nraise Amara::NotFoundError # 404 error\nraise Amara::ClientError # All other 400 errors\nraise Amara::ServerError # 500 errors\nraise Amara::UnknownError # All other errors\n```\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprx%2Famara","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprx%2Famara","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprx%2Famara/lists"}