Skip to main content

RESTAPI Client for the ZANATA translation web-service

Project description

pyzanata

Alternative Zanata restapi client.

Usage

In order to get started two imports are needed:

from pyzanata import ZanataCredentials
from pyzanata import ZanataClient

First credentials needs to be set:

credentials = ZanataCredentials('http://zanata.example.com/rest/', 'johndoe', 'secret-token')

Then the client can be initialized:

client = ZanataClient(credentials)

Now Zanata infos can be fetched (or set) like so:

client.ProjectsResource.projects.GET()
client.ProjectResource.project.GET(projectSlug='myproject')

It has always the form client.RESOURCE.ENDPOINT.METHOD(data=None, **path_replacements).

RESOURCE

name of the resource according the the declaration (first level).

ENDPOINT

name of the endpoint according the the declaration (second level).

METHOD

one of the http-methods (depends on endpint, as configured in declaration)

data

payload passed to body of requests call.

params

payload passed to query string of requests call.

path_replacements

keyword arguments used to replace the dynamic path elements as configured in the declaration.

Consult the Zanata REST API Documentation for details. Deprecated APIs are not implemented.

See also the Declaration YAML File (GitHub). This file is read by the generic API runtime code and declares the API.

An application using this code can be found at collective.ttwpo Plone Addon.

Contribute

Support

If you are having issues, please let me know: jens@bluedynamics.com

License

Copyright (c) 2017, BlueDynamics Alliance, Austria, Germany, Switzerland All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  • Neither the name of the BlueDynamics Alliance nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY BlueDynamics Alliance AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BlueDynamics Alliance BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyzanata-1.0b1.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

pyzanata-1.0b1-py2-none-any.whl (8.9 kB view details)

Uploaded Python 2

File details

Details for the file pyzanata-1.0b1.tar.gz.

File metadata

  • Download URL: pyzanata-1.0b1.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyzanata-1.0b1.tar.gz
Algorithm Hash digest
SHA256 e3cdbe084d6358111c266e119ef10734daa9d2fea5ce058d1f4c60a1f3a8adb4
MD5 59265175d55063ddce23d2f50d5adb31
BLAKE2b-256 e0ad40d7363cc605c8b2103e24d98dbae88b9da0bae6aa6174f91a0c053d27cb

See more details on using hashes here.

File details

Details for the file pyzanata-1.0b1-py2-none-any.whl.

File metadata

File hashes

Hashes for pyzanata-1.0b1-py2-none-any.whl
Algorithm Hash digest
SHA256 cccfbbdf6e7e3807a3428758eb98f3295f0aa02c78951ef8d231a821a4921662
MD5 32ea8ee7d7f874dc7d4403f68d005dcc
BLAKE2b-256 2ad6a4cbd920a60fa0ca4b0bd909ad27c759255b523a0e90484d27559d01b14d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page