Magic for Python

Magic for Python

Reference for the Magic Admin SDK for Python: https://github.com/magiclabs/magic-admin-python

note

We will also be releasing magic-admin-django and magic-admin-flask to offer the direct magic-admin SDK integration for the Python Web frameworks.

#Overview

The Magic SDK for server-side Python makes it easy to leverage Decentralized ID Tokens to authenticate your users for your app. This guide will cover some important topics for getting started with server-side APIs and to make the most of Magic's features.

  • View the API documentation below to learn the methods you'll be using
  • Go to Examples for an introduction to common patterns and use-cases
note

Looking for a client-side API instead? Check out:

👉 Magic Client SDK for web

👉 Magic Client SDK for React Native

#Installation

Current SDK is built with Python3.6. Testing for Python3.6+ will be added soon. If you are interested in using the SDK with the earlier versions of Python (ex: 2.7+), please create a ticket in this repo and let us know :)

#PIP

01pip install magic-admin

#Conda

01conda install magic-admin

#Creating an SDK Instance

To instantiate:

Python
01from magic_admin import Magic
02
03# Pass your API secret key directly to the Magic.
04magic = Magic(api_secret_key='<YOUR_API_SECRET_KEY>')
05
06# Or add an environment variable, `MAGIC_API_SECRET_KEY`
07magic = Magic()

Did you find what you were looking for?

Did you find what you were looking for?