Skip to content

Echie/phrase-python

 
 

Repository files navigation

phrase-api

Phrase is a translation management platform for software projects. You can collaborate on language file translation with your team or order translations through our platform. The API allows you to import locale files, download locale files, tag keys or interact in other ways with the localization data stored in Phrase for your account.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 2.0.0
  • Package version: 1.0.5
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://developers.phrase.com/api/

Requirements.

Python 2.7 and 3.4+

Installation & Usage

pip install

pip install phrase-api

Then import the package:

import phrase_api

pip install from Github repository

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/phrase/phrase-python.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/phrase/phrase-python.git)

Then import the package:

import phrase_api

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import phrase_api

Getting Started

Please follow the installation procedure and then run the following:

from __future__ import print_function
import time
import phrase_api
from phrase_api.rest import ApiException
from pprint import pprint

configuration = phrase_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'

# Defining host is optional and default to https://api.phrase.com/v2
configuration.host = "https://api.phrase.com/v2"
# Enter a context with an instance of the API client
with phrase_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = phrase_api.AccountsApi(api_client)
    id = 'id_example' # str | ID (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)

    try:
        # Get a single account
        api_response = api_instance.account_show(id, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling AccountsApi->account_show: %s\n" % e)
    

Documentation For Authorization

Basic

  • Type: HTTP basic authentication
import phrase-api

configuration = phrase-api.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

Token

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header
import phrase-api

configuration = phrase-api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'

Documentation for API Endpoints

All URIs are relative to https://api.phrase.com/v2

Class Method HTTP request Description
AccountsApi account_show GET /accounts/{id} Get a single account
AccountsApi accounts_list GET /accounts List accounts
AuthorizationsApi authorization_create POST /authorizations Create an authorization
AuthorizationsApi authorization_delete DELETE /authorizations/{id} Delete an authorization
AuthorizationsApi authorization_show GET /authorizations/{id} Get a single authorization
AuthorizationsApi authorization_update PATCH /authorizations/{id} Update an authorization
AuthorizationsApi authorizations_list GET /authorizations List authorizations
BitbucketSyncApi bitbucket_sync_export POST /bitbucket_syncs/{id}/export Export from Phrase to Bitbucket
BitbucketSyncApi bitbucket_sync_import POST /bitbucket_syncs/{id}/import Import to Phrase from Bitbucket
BitbucketSyncApi bitbucket_syncs_list GET /bitbucket_syncs List Bitbucket syncs
BlacklistedKeysApi blacklisted_key_create POST /projects/{project_id}/blacklisted_keys Create a blacklisted key
BlacklistedKeysApi blacklisted_key_delete DELETE /projects/{project_id}/blacklisted_keys/{id} Delete a blacklisted key
BlacklistedKeysApi blacklisted_key_show GET /projects/{project_id}/blacklisted_keys/{id} Get a single blacklisted key
BlacklistedKeysApi blacklisted_key_update PATCH /projects/{project_id}/blacklisted_keys/{id} Update a blacklisted key
BlacklistedKeysApi blacklisted_keys_list GET /projects/{project_id}/blacklisted_keys List blacklisted keys
BranchesApi branch_compare GET /projects/{project_id}/branches/{name}/compare Compare branches
BranchesApi branch_create POST /projects/{project_id}/branches Create a branch
BranchesApi branch_delete DELETE /projects/{project_id}/branches/{name} Delete a branch
BranchesApi branch_merge PATCH /projects/{project_id}/branches/{name}/merge Merge a branch
BranchesApi branch_show GET /projects/{project_id}/branches/{name} Get a single branch
BranchesApi branch_update PATCH /projects/{project_id}/branches/{name} Update a branch
BranchesApi branches_list GET /projects/{project_id}/branches List branches
CommentsApi comment_create POST /projects/{project_id}/keys/{key_id}/comments Create a comment
CommentsApi comment_delete DELETE /projects/{project_id}/keys/{key_id}/comments/{id} Delete a comment
CommentsApi comment_mark_check GET /projects/{project_id}/keys/{key_id}/comments/{id}/read Check if comment is read
CommentsApi comment_mark_read PATCH /projects/{project_id}/keys/{key_id}/comments/{id}/read Mark a comment as read
CommentsApi comment_mark_unread DELETE /projects/{project_id}/keys/{key_id}/comments/{id}/read Mark a comment as unread
CommentsApi comment_show GET /projects/{project_id}/keys/{key_id}/comments/{id} Get a single comment
CommentsApi comment_update PATCH /projects/{project_id}/keys/{key_id}/comments/{id} Update a comment
CommentsApi comments_list GET /projects/{project_id}/keys/{key_id}/comments List comments
DistributionsApi distribution_create POST /accounts/{account_id}/distributions Create a distribution
DistributionsApi distribution_delete DELETE /accounts/{account_id}/distributions/{id} Delete a distribution
DistributionsApi distribution_show GET /accounts/{account_id}/distributions/{id} Get a single distribution
DistributionsApi distribution_update PATCH /accounts/{account_id}/distributions/{id} Update a distribution
DistributionsApi distributions_list GET /accounts/{account_id}/distributions List distributions
DocumentsApi document_delete DELETE /projects/{project_id}/documents/{id} Delete document
DocumentsApi documents_list GET /projects/{project_id}/documents List documents
FormatsApi formats_list GET /formats List formats
GitHubSyncApi github_sync_export POST /github_syncs/export Export from Phrase to GitHub
GitHubSyncApi github_sync_import POST /github_syncs/import Import to Phrase from GitHub
GitLabSyncApi gitlab_sync_delete DELETE /gitlab_syncs/{id} Delete single Sync Setting
GitLabSyncApi gitlab_sync_export POST /gitlab_syncs/{gitlab_sync_id}/export Export from Phrase to GitLab
GitLabSyncApi gitlab_sync_history GET /gitlab_syncs/{gitlab_sync_id}/history History of single Sync Setting
GitLabSyncApi gitlab_sync_import POST /gitlab_syncs/{gitlab_sync_id}/import Import from GitLab to Phrase
GitLabSyncApi gitlab_sync_list GET /gitlab_syncs List GitLab syncs
GitLabSyncApi gitlab_sync_show GET /gitlab_syncs/{id} Get single Sync Setting
GitLabSyncApi gitlab_sync_update PUT /gitlab_syncs/{id} Update single Sync Setting
GlossariesApi glossaries_list GET /accounts/{account_id}/glossaries List glossaries
GlossariesApi glossary_create POST /accounts/{account_id}/glossaries Create a glossary
GlossariesApi glossary_delete DELETE /accounts/{account_id}/glossaries/{id} Delete a glossary
GlossariesApi glossary_show GET /accounts/{account_id}/glossaries/{id} Get a single glossary
GlossariesApi glossary_update PATCH /accounts/{account_id}/glossaries/{id} Update a glossary
GlossaryTermTranslationsApi glossary_term_translation_create POST /accounts/{account_id}/glossaries/{glossary_id}/terms/{term_id}/translations Create a glossary term translation
GlossaryTermTranslationsApi glossary_term_translation_delete DELETE /accounts/{account_id}/glossaries/{glossary_id}/terms/{term_id}/translations/{id} Delete a glossary term translation
GlossaryTermTranslationsApi glossary_term_translation_update PATCH /accounts/{account_id}/glossaries/{glossary_id}/terms/{term_id}/translations/{id} Update a glossary term translation
GlossaryTermsApi glossary_term_create POST /accounts/{account_id}/glossaries/{glossary_id}/terms Create a glossary term
GlossaryTermsApi glossary_term_delete DELETE /accounts/{account_id}/glossaries/{glossary_id}/terms/{id} Delete a glossary term
GlossaryTermsApi glossary_term_show GET /accounts/{account_id}/glossaries/{glossary_id}/terms/{id} Get a single glossary term
GlossaryTermsApi glossary_term_update PATCH /accounts/{account_id}/glossaries/{glossary_id}/terms/{id} Update a glossary term
GlossaryTermsApi glossary_terms_list GET /accounts/{account_id}/glossaries/{glossary_id}/terms List glossary terms
InvitationsApi invitation_create POST /accounts/{account_id}/invitations Create a new invitation
InvitationsApi invitation_delete DELETE /accounts/{account_id}/invitations/{id} Delete an invitation
InvitationsApi invitation_resend POST /accounts/{account_id}/invitations/{id}/resend Resend an invitation
InvitationsApi invitation_show GET /accounts/{account_id}/invitations/{id} Get a single invitation
InvitationsApi invitation_update PATCH /accounts/{account_id}/invitations/{id} Update an invitation
InvitationsApi invitation_update_settings PATCH /projects/{project_id}/invitations/{id} Update a member's invitation access
InvitationsApi invitations_list GET /accounts/{account_id}/invitations List invitations
JobLocalesApi job_locale_complete POST /projects/{project_id}/jobs/{job_id}/locales/{id}/complete Complete a job locale
JobLocalesApi job_locale_delete DELETE /projects/{project_id}/jobs/{job_id}/locales/{id} Delete a job locale
JobLocalesApi job_locale_reopen POST /projects/{project_id}/jobs/{job_id}/locales/{id}/reopen Reopen a job locale
JobLocalesApi job_locale_show GET /projects/{project_id}/jobs/{job_id}/locale/{id} Get a single job locale
JobLocalesApi job_locale_update PATCH /projects/{project_id}/jobs/{job_id}/locales/{id} Update a job locale
JobLocalesApi job_locales_create POST /projects/{project_id}/jobs/{job_id}/locales Create a job locale
JobLocalesApi job_locales_list GET /projects/{project_id}/jobs/{job_id}/locales List job locales
JobsApi job_complete POST /projects/{project_id}/jobs/{id}/complete Complete a job
JobsApi job_create POST /projects/{project_id}/jobs Create a job
JobsApi job_delete DELETE /projects/{project_id}/jobs/{id} Delete a job
JobsApi job_keys_create POST /projects/{project_id}/jobs/{id}/keys Add keys to job
JobsApi job_keys_delete DELETE /projects/{project_id}/jobs/{id}/keys Remove keys from job
JobsApi job_reopen POST /projects/{project_id}/jobs/{id}/reopen Reopen a job
JobsApi job_show GET /projects/{project_id}/jobs/{id} Get a single job
JobsApi job_start POST /projects/{project_id}/jobs/{id}/start Start a job
JobsApi job_update PATCH /projects/{project_id}/jobs/{id} Update a job
JobsApi jobs_by_account GET /accounts/{account_id}/jobs List account jobs
JobsApi jobs_list GET /projects/{project_id}/jobs List jobs
KeysApi key_create POST /projects/{project_id}/keys Create a key
KeysApi key_delete DELETE /projects/{project_id}/keys/{id} Delete a key
KeysApi key_show GET /projects/{project_id}/keys/{id} Get a single key
KeysApi key_update PATCH /projects/{project_id}/keys/{id} Update a key
KeysApi keys_delete_collection DELETE /projects/{project_id}/keys Delete collection of keys
KeysApi keys_list GET /projects/{project_id}/keys List keys
KeysApi keys_search POST /projects/{project_id}/keys/search Search keys
KeysApi keys_tag PATCH /projects/{project_id}/keys/tag Add tags to collection of keys
KeysApi keys_untag PATCH /projects/{project_id}/keys/untag Remove tags from collection of keys
LocalesApi locale_create POST /projects/{project_id}/locales Create a locale
LocalesApi locale_delete DELETE /projects/{project_id}/locales/{id} Delete a locale
LocalesApi locale_download GET /projects/{project_id}/locales/{id}/download Download a locale
LocalesApi locale_show GET /projects/{project_id}/locales/{id} Get a single locale
LocalesApi locale_update PATCH /projects/{project_id}/locales/{id} Update a locale
LocalesApi locales_list GET /projects/{project_id}/locales List locales
MembersApi member_delete DELETE /accounts/{account_id}/members/{id} Remove a user from the account
MembersApi member_show GET /accounts/{account_id}/members/{id} Get single member
MembersApi member_update PATCH /accounts/{account_id}/members/{id} Update a member
MembersApi member_update_settings PATCH /projects/{project_id}/members/{id} Update a member's project settings
MembersApi members_list GET /accounts/{account_id}/members List members
OrdersApi order_confirm PATCH /projects/{project_id}/orders/{id}/confirm Confirm an order
OrdersApi order_create POST /projects/{project_id}/orders Create a new order
OrdersApi order_delete DELETE /projects/{project_id}/orders/{id} Cancel an order
OrdersApi order_show GET /projects/{project_id}/orders/{id} Get a single order
OrdersApi orders_list GET /projects/{project_id}/orders List orders
ProjectsApi project_create POST /projects Create a project
ProjectsApi project_delete DELETE /projects/{id} Delete a project
ProjectsApi project_show GET /projects/{id} Get a single project
ProjectsApi project_update PATCH /projects/{id} Update a project
ProjectsApi projects_list GET /projects List projects
ReleasesApi release_create POST /accounts/{account_id}/distributions/{distribution_id}/releases Create a release
ReleasesApi release_delete DELETE /accounts/{account_id}/distributions/{distribution_id}/releases/{id} Delete a release
ReleasesApi release_publish POST /accounts/{account_id}/distributions/{distribution_id}/releases/{id}/publish Publish a release
ReleasesApi release_show GET /accounts/{account_id}/distributions/{distribution_id}/releases/{id} Get a single release
ReleasesApi release_update PATCH /accounts/{account_id}/distributions/{distribution_id}/releases/{id} Update a release
ReleasesApi releases_list GET /accounts/{account_id}/distributions/{distribution_id}/releases List releases
ScreenshotMarkersApi screenshot_marker_create POST /projects/{project_id}/screenshots/{screenshot_id}/markers Create a screenshot marker
ScreenshotMarkersApi screenshot_marker_delete DELETE /projects/{project_id}/screenshots/{screenshot_id}/markers Delete a screenshot marker
ScreenshotMarkersApi screenshot_marker_show GET /projects/{project_id}/screenshots/{screenshot_id}/markers/{id} Get a single screenshot marker
ScreenshotMarkersApi screenshot_marker_update PATCH /projects/{project_id}/screenshots/{screenshot_id}/markers Update a screenshot marker
ScreenshotMarkersApi screenshot_markers_list GET /projects/{project_id}/screenshots/{id}/markers List screenshot markers
ScreenshotsApi screenshot_create POST /projects/{project_id}/screenshots Create a screenshot
ScreenshotsApi screenshot_delete DELETE /projects/{project_id}/screenshots/{id} Delete a screenshot
ScreenshotsApi screenshot_show GET /projects/{project_id}/screenshots/{id} Get a single screenshot
ScreenshotsApi screenshot_update PATCH /projects/{project_id}/screenshots/{id} Update a screenshot
ScreenshotsApi screenshots_list GET /projects/{project_id}/screenshots List screenshots
SpacesApi space_create POST /accounts/{account_id}/spaces Create a Space
SpacesApi space_delete DELETE /accounts/{account_id}/spaces/{id} Delete Space
SpacesApi space_show GET /accounts/{account_id}/spaces/{id} Get Space
SpacesApi space_update PATCH /accounts/{account_id}/spaces/{id} Update Space
SpacesApi spaces_list GET /accounts/{account_id}/spaces List Spaces
SpacesApi spaces_projects_create POST /accounts/{account_id}/spaces/{space_id}/projects Add Project
SpacesApi spaces_projects_delete DELETE /accounts/{account_id}/spaces/{space_id}/projects/{id} Remove Project
SpacesApi spaces_projects_list GET /accounts/{account_id}/spaces/{space_id}/projects List Projects
StyleGuidesApi styleguide_create POST /projects/{project_id}/styleguides Create a style guide
StyleGuidesApi styleguide_delete DELETE /projects/{project_id}/styleguides/{id} Delete a style guide
StyleGuidesApi styleguide_show GET /projects/{project_id}/styleguides/{id} Get a single style guide
StyleGuidesApi styleguide_update PATCH /projects/{project_id}/styleguides/{id} Update a style guide
StyleGuidesApi styleguides_list GET /projects/{project_id}/styleguides List style guides
TagsApi tag_create POST /projects/{project_id}/tags Create a tag
TagsApi tag_delete DELETE /projects/{project_id}/tags/{name} Delete a tag
TagsApi tag_show GET /projects/{project_id}/tags/{name} Get a single tag
TagsApi tags_list GET /projects/{project_id}/tags List tags
TeamsApi team_create POST /accounts/{account_id}/teams Create a Team
TeamsApi team_delete DELETE /accounts/{account_id}/teams/{team_id} Delete Team
TeamsApi team_show GET /accounts/{account_id}/teams/{team_id} Get Team
TeamsApi team_update PATCH /accounts/{account_id}/teams/{team_id} Update Team
TeamsApi teams_list GET /accounts/{account_id}/teams List Teams
TeamsApi teams_projects_create POST /accounts/{account_id}/teams/{team_id}/projects Add Project
TeamsApi teams_projects_delete DELETE /accounts/{account_id}/teams/{team_id}/projects/{id} Remove Project
TeamsApi teams_spaces_create POST /accounts/{account_id}/teams/{team_id}/spaces Add Space
TeamsApi teams_spaces_delete DELETE /accounts/{account_id}/teams/{team_id}/spaces/{id} Remove Space
TeamsApi teams_users_create POST /accounts/{account_id}/teams/{team_id}/users Add User
TeamsApi teams_users_delete DELETE /accounts/{account_id}/teams/{team_id}/users/{id} Remove User
TranslationsApi translation_create POST /projects/{project_id}/translations Create a translation
TranslationsApi translation_exclude PATCH /projects/{project_id}/translations/{id}/exclude Exclude a translation from export
TranslationsApi translation_include PATCH /projects/{project_id}/translations/{id}/include Revoke exclusion of a translation in export
TranslationsApi translation_review PATCH /projects/{project_id}/translations/{id}/review Review a translation
TranslationsApi translation_show GET /projects/{project_id}/translations/{id} Get a single translation
TranslationsApi translation_unverify PATCH /projects/{project_id}/translations/{id}/unverify Mark a translation as unverified
TranslationsApi translation_update PATCH /projects/{project_id}/translations/{id} Update a translation
TranslationsApi translation_verify PATCH /projects/{project_id}/translations/{id}/verify Verify a translation
TranslationsApi translations_by_key GET /projects/{project_id}/keys/{key_id}/translations List translations by key
TranslationsApi translations_by_locale GET /projects/{project_id}/locales/{locale_id}/translations List translations by locale
TranslationsApi translations_exclude_collection PATCH /projects/{project_id}/translations/exclude Set exclude from export flag on translations selected by query
TranslationsApi translations_include_collection PATCH /projects/{project_id}/translations/include Remove exlude from import flag from translations selected by query
TranslationsApi translations_list GET /projects/{project_id}/translations List all translations
TranslationsApi translations_review_collection PATCH /projects/{project_id}/translations/review Review translations selected by query
TranslationsApi translations_search POST /projects/{project_id}/translations/search Search translations
TranslationsApi translations_unverify_collection PATCH /projects/{project_id}/translations/unverify Mark translations selected by query as unverified
TranslationsApi translations_verify_collection PATCH /projects/{project_id}/translations/verify Verify translations selected by query
UploadsApi upload_create POST /projects/{project_id}/uploads Upload a new file
UploadsApi upload_show GET /projects/{project_id}/uploads/{id} View upload details
UploadsApi uploads_list GET /projects/{project_id}/uploads List uploads
UsersApi show_user GET /user Show current User
VariablesApi variable_create POST /projects/{project_id}/variables Create a variable
VariablesApi variable_delete DELETE /projects/{project_id}/variables/{name} Delete a variable
VariablesApi variable_show GET /projects/{project_id}/variables/{name} Get a single variable
VariablesApi variable_update PATCH /projects/{project_id}/variables/{name} Update a variable
VariablesApi variables_list GET /projects/{project_id}/variables List variables
VersionsHistoryApi version_show GET /projects/{project_id}/translations/{translation_id}/versions/{id} Get a single version
VersionsHistoryApi versions_list GET /projects/{project_id}/translations/{translation_id}/versions List all versions
WebhooksApi webhook_create POST /projects/{project_id}/webhooks Create a webhook
WebhooksApi webhook_delete DELETE /projects/{project_id}/webhooks/{id} Delete a webhook
WebhooksApi webhook_show GET /projects/{project_id}/webhooks/{id} Get a single webhook
WebhooksApi webhook_test POST /projects/{project_id}/webhooks/{id}/test Test a webhook
WebhooksApi webhook_update PATCH /projects/{project_id}/webhooks/{id} Update a webhook
WebhooksApi webhooks_list GET /projects/{project_id}/webhooks List webhooks

Documentation For Models

Author

support@phrase.com

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.9%
  • Shell 0.1%