Skip to content

scaleway/python-scaleway

Repository files navigation

Scaleway SDK

Python SDK to query Scaleway's APIs.

Stable release: Last release Python versions Software license

Development: Unit-tests status Coverage Status Code Quality

Installation

The package is available on pip. To install it in a virtualenv:

General principle

If you're looking to send a GET HTTP request against our APIs, like:

GET <api_url>/foo/bar

you only need to call the following pythonic code:

The magic here lies in scaleway.apis.*API instances, which all have a query method returning a slumber.API object. The latter handling all the excruciating details of the requests.

Documentation

Even if this SDK is designed to be developer-friendly and aim for self-service discovery, it is still recommended to read the official API documentation.

And because most of the provided helpers takes the form of pre-configured Slumber objects, a good read of Slumber documention is encouraged as well.

The list of available resources per API can be found [on the Scaleway API repository](https://github.com/scaleway/api.scaleway.com/blob/master/README.md#apis)

Examples

  • List your organizations:
  • List your organizations, but get a flask.Response object instead of a `dict`:
  • List your servers:
  • Get details of a server:
  • Check if your token has the permission servers:read for the service compute for the organization 9a096d36-6bf9-470f-91df-2398aa7361f7:

Development

Assuming you are in a virtualenv:

Test

To submit a patch, you'll need to test your code against python2.7 and python3.4. To run tests:

  • Coverage score should never be lower than before your patch.
  • PEP8 should never return an error.
  • Pylint score should never be lower than before your patch.

Alternatively, to run nosetests on both Python2.7 and Python3.4, you can run tox.

Alternative libraries / clients

We maintain a list of the current library/client implementations on the api.scaleway.com repository.

License

This software is licensed under a BSD 2-Clause License.