Skip to main content

The official python SDK for Linode API v4

Project description

python-linode-api

The official python library for the Linode API in python.

This library is currently in beta.

https://travis-ci.org/linode/python-linode-api.svg?branch=master https://badge.fury.io/py/linode-api.svg

Installation

pip install linode-api

Building from Source

To build and install this package:

  • Clone this repository

  • ./setup.py install

This package uses the linode namespace. This could conflict with libraries intended for previous versions of the Linode API. Please be cautious when installing packages for both version of the API on the same machine.

Usage

Check out the Getting Started guide to start using this library, or read the docs for extensive documentation.

Examples

See the Install on a Linode example project for a simple use case demonstrating many of the features of this library.

Contributing

Tests

Tests live in the tests directory. To run tests, use setup.py:

python setup.py test

The test suite uses fixtures stored as JSON in test/fixtures. These files contain sanitized JSON responses from the API - the file name is the URL called to produce the response, replacing any slashes with underscores.

Test classes should extend test.base.ClientBaseCase. This provides them with self.client, a LinodeClient object that is set up to work with tests. Importantly, any GET request made by this object will be mocked to retrieve data from the test fixtures. This includes lazy-loaded objects using this client (and by extension related models).

When testing against requests other than GET requests, self.mock_post (and equivalent methods for other HTTP verbs) can be used in a with block to mock out the intended request type - include the URL whose response should be used returned from the fixtures. For example:

with self.mock_post('/linode/instances/123'):
  linode = self.client.linode.create_instance('g5-standard-1', 'us-east')
  self.assertEqual(linode.id, 123) # passes

Documentation

This library is documented with Sphinx. Docs live in the docs directory. The easiest way to build the docs is to run sphinx-autobuild in that folder.

Classes and functions inside the library should be annotated with sphinx-compliant docstrings which will be used to automatically generate documentation for the library. When contributing, be sure to update documentation or include new docstrings where applicable to keep the library’s documentation up to date and useful.

Missing or inaccurate documentation is a bug. If you notice that the documentation for this library is out of date or unclear, please open an issue to make us aware of the problem.

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

linode-api-4.1.9b1.tar.gz (45.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

linode_api-4.1.9b1-py2.py3-none-any.whl (69.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file linode-api-4.1.9b1.tar.gz.

File metadata

  • Download URL: linode-api-4.1.9b1.tar.gz
  • Upload date:
  • Size: 45.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for linode-api-4.1.9b1.tar.gz
Algorithm Hash digest
SHA256 fa0829798d2d169f72e5af00b9db67b61f2ab7e4165e11992863b3cc49343340
MD5 8ab9ccd5a55af982208eb9e55296a65a
BLAKE2b-256 9220130641a81ede247f8c56347b84a34e7d5fb858f950d3c2c7c23fc1b83fbb

See more details on using hashes here.

File details

Details for the file linode_api-4.1.9b1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for linode_api-4.1.9b1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4ba4109b7f2ab46ebf15cf4fcc5235d493bf5f37cfc92e1e9a0c9aeb4d8d1fa0
MD5 e463fac0c2642160e78c74515c138490
BLAKE2b-256 70caa0fc9a491e0339cadd1ac47a51e7d8ec53ebebdc8e406a66963d4af6786c

See more details on using hashes here.

Supported by

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