Skip to main content

The official python SDK for Linode API v4

Project description

linode_api4
===========

.. highlight:: python

The official python library for the `Linode API v4`_ in python.

**This library is currently in beta.**

.. _Linode API v4: https://developers.linode.com/v4/introduction

.. image:: https://travis-ci.org/linode/linode-api-python.svg?branch=master
:target: https://travis-ci.org/linode/linode-api-python

.. image:: https://badge.fury.io/py/linode-api.svg
:target: https://badge.fury.io/py/linode-api

Installation
------------
::

pip install linode_api4

Building from Source
--------------------

To build and install this package:

- Clone this repository
- ``./setup.py install``

Usage
-----

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

.. _Getting Started guide: http://linode_api4.readthedocs.io/en/latest/guides/getting_started.html
.. _the docs: http://linode_api4.readthedocs.io/en/latest/index.html

Examples
--------

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

.. _Install on a Linode: https://github.com/linode/linode_api4/tree/master/examples/install-on-linode

Contributing
============

Tests
-----

Tests live in the ``tests`` directory. When invoking tests, make sure you are
in the root directory of this project. To run the full suite across all
supported python versions, use tox_:

.. code-block:: shell

tox

Running tox also runs pylint and coverage reports.

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.instance_create('g6-standard-2', 'us-east')
self.assertEqual(linode.id, 123) # passes

.. _tox: http://tox.readthedocs.io

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.

.. _Sphinx: http://www.sphinx-doc.org/en/master/index.html
.. _open an issue: https://github.com/linode/linode_api4/issues/new


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

linode_api4-1.0.0.tar.gz (43.2 kB view details)

Uploaded Source

Built Distribution

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

linode_api4-1.0.0-py2.py3-none-any.whl (180.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file linode_api4-1.0.0.tar.gz.

File metadata

  • Download URL: linode_api4-1.0.0.tar.gz
  • Upload date:
  • Size: 43.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for linode_api4-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9aa3e8dc282c303e4b959128ec9637ceb60a33118d7a7be49fdfd6388a36c190
MD5 29bbf61f6db16771acaf7e4cdd0f39fb
BLAKE2b-256 42da7e900a181a43bbaa64fd3fad34d603033aee9f02df34b29c460248260f07

See more details on using hashes here.

File details

Details for the file linode_api4-1.0.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for linode_api4-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ca206c54b9aa8fdc90d6d753be97cfe416b43857f79ed187bfb2f4db4c9c15f0
MD5 49f828e83ade07f85619a56d08985c24
BLAKE2b-256 4f4302dfdd644ffa309ff35d8950e364d4f2bf7f742a5856c63e3019717a5a14

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