Skip to main content

Lumapps SDK for Python

Project description

LumApps SDK

https://circleci.com/gh/lumapps/lumapps-sdk.svg?style=svg License: MIT Black style

Please be aware the this sdk is still in beta version and is undergoing a fast paced evolution that may break change the behaviour of some helpers

Make sure of the version you are using (Git tags & releases)


LumApps SDK is a set of tools to manipulate the LumApps API.

This includes:

  • a client that support all the routes of the API (located in folder lumapps)

  • a set of helper classes to easily manipulate LumApps elements as Python Objects and classes (folder lumapps/helpers)

Quick start

Installation

$ pip install lumapps-sdk

Get your token

LumApps supports multiple ways of authentication. The fastest one to implement is the following:

Get your token by logging to your LumApps account. Go to https://sites.lumapps.com and authenticate. Once connected, open the javascript console of your browser and run:

var instance = window.location.pathname.split('/');
if (instance[1] == "a"){
    instance = instance[3]
}else{
    instance = instance[2]
}
fetch(window.location.origin+"/service/init?customerHost="+window.location.host+"&instanceSlug="+instance+"&slug=").then(data=>{return data.json()}).then(res => {console.log(res.token)})

This will generate your personal LumApps token that will be active for 60 minutes, and that we will use in the following steps

Authenticate

from lumapps.api import ApiClient
token = "MY TOKEN"
api = ApiClient(token=token)

Your first API call

Let’s display the full name of a registered user in lumapps

user_email = "YOUR EMAIL"
usr = api.get_call("user", "get", email=user_email)
print("Hello {}".format(usr.get("fullName", "")))

Documentation

The SDK documentation is available here.

Code convention

Docstring in PEP 484 type annotations format adapted to python 2.7 using comments.

How to get help, contribute, or provide feedback

Please refer to our contributing guidelines.

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

lumapps-sdk-0.1.16.tar.gz (14.1 kB view hashes)

Uploaded Source

Built Distribution

lumapps_sdk-0.1.16-py2.py3-none-any.whl (23.6 kB view hashes)

Uploaded Python 2 Python 3

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