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
Issue Tracker: https://github.com/bluedynamics/pyzanata/issues
Source Code: https://github.com/bluedynamics/pyzanata
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3cdbe084d6358111c266e119ef10734daa9d2fea5ce058d1f4c60a1f3a8adb4 |
|
MD5 | 59265175d55063ddce23d2f50d5adb31 |
|
BLAKE2b-256 | e0ad40d7363cc605c8b2103e24d98dbae88b9da0bae6aa6174f91a0c053d27cb |
File details
Details for the file pyzanata-1.0b1-py2-none-any.whl
.
File metadata
- Download URL: pyzanata-1.0b1-py2-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cccfbbdf6e7e3807a3428758eb98f3295f0aa02c78951ef8d231a821a4921662 |
|
MD5 | 32ea8ee7d7f874dc7d4403f68d005dcc |
|
BLAKE2b-256 | 2ad6a4cbd920a60fa0ca4b0bd909ad27c759255b523a0e90484d27559d01b14d |