Skip to main content

a python client library for easy leaseweb api access

Project description

[![Actions Status](https://github.com/nrocco/lswapi/workflows/Python%20package/badge.svg)](https://github.com/nrocco/lswapi/actions)

Python module to talk to LeaseWeb’s API.

For more information refer to the documentation available at [http://developer.leaseweb.com]

Installation

Install the module using pip

pip install lswapi

Usage

The lswapi.get_leaseweb_api function creates an instance of the LeaseWeb Api object with the X-Lsw-Auth key. You can provide the api key as an argument to get_leaseweb_api

$ python >>> import lswapi >>> client = lswapi.get_leaseweb_api(api_key=”xxxx-xxx-xxxxxx”) >>> response = client.get(“/bareMetals/v2/servers”) >>> servers = response.json()

or as an environment variable LSW_API_KEY

$ LSW_API_KEY=xxxx-xxxx-xxxxx python >>> import lswapi >>> client = lswapi.get_leaseweb_api() >>> response = client.get(“/bareMetals/v2/servers”) >>> servers = response.json()

Contribute

  1. Fork it

  2. Create your feature branch (git checkout -b my-new-feature)

  3. Commit your changes (git commit -am ‘Add some feature’)

  4. Make sure that tests pass (make test)

  5. Push to the branch (git push origin my-new-feature)

  6. Create new Pull Request

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

lswapi-0.4.3.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

lswapi-0.4.3-py2.py3-none-any.whl (8.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file lswapi-0.4.3.tar.gz.

File metadata

  • Download URL: lswapi-0.4.3.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.0

File hashes

Hashes for lswapi-0.4.3.tar.gz
Algorithm Hash digest
SHA256 6ad226ae14dc87ab2c0fc5f252e3972d1be16a39909c983681a58e47ece1d78f
MD5 ab6cfe789d3dcb258b988f05c5de43e8
BLAKE2b-256 16d95514c381dd1f7975863d6150beefa1b5a3452ae5ff0ca7a51ca2d692072d

See more details on using hashes here.

File details

Details for the file lswapi-0.4.3-py2.py3-none-any.whl.

File metadata

  • Download URL: lswapi-0.4.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.0

File hashes

Hashes for lswapi-0.4.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a4556e9fb60e459f22f8ba40d090071b14d4cf7bb9b8a703b6ecb9a4bebe6973
MD5 575a6088d1f85f681d24e49010486dda
BLAKE2b-256 988d14b5915e1fe08494832aa12c2bfef031c5dbcac069b73d460b284ed1c3c6

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