Skip to main content

The Official Python client for Smart Prospective API

Project description

Smart Prospective API

This python library is made to connect to Smart Prospective API, in order to manage your account, users, medias, publish content, bills...

Installation

python3 pip install smart-prospective-api

Compatibility

Python >=3.6

Custom Config

SMART_PROSPECTIVE_SERVER: If you set this environment variable you can specify the target server (More info):

import os
os.environ["SMART_PROSPECTIVE_SERVER"] = "https://custom-server.com"

Usage

from smart-prospective-api import SPApi, APIError

try:
    # Setup the API credencial (do not perform any request at this moment)
    # Note: The public key starts by "pub_" & The secret key starts by "sec_"
    sp_api = SPApi("your_api_public_key", "your_api_secret_key")

    sp_api.get_medias()  # Get all the medias linked to this account

    sp_api.logout()  # Logout the account, more safe to use it, to avoid potential attacks
except APIError as e:
    print(f"Failure using the Smart Prospective API: {e}")

# Other Method (less common)
token = sp_api.login()  # This call is optionnal, because it's automatic on every call if needed if the token is not set
sp_api.token = token  # Manually set the token (so it won't perform any login() once you call any method)

Contact

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

smart-prospective-api-1.0.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

smart_prospective_api-1.0.0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file smart-prospective-api-1.0.0.tar.gz.

File metadata

  • Download URL: smart-prospective-api-1.0.0.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.2

File hashes

Hashes for smart-prospective-api-1.0.0.tar.gz
Algorithm Hash digest
SHA256 314f1bf37bdebe0e901cd1a0f959e866d5f5779cad81ad175d928ce832c442ef
MD5 71c0aea5f67c9f3a78668bc070ee12b2
BLAKE2b-256 7e5671562d8b6c8af277cb0d1b0343f62597afc542250630e98a43428aaf4551

See more details on using hashes here.

File details

Details for the file smart_prospective_api-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: smart_prospective_api-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.2

File hashes

Hashes for smart_prospective_api-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d0bc324eda1886cee356b281c396aa7d7f6bf152fcb023148663a2223b4be03c
MD5 e008e0e6bc02ee033667c356dae4cac5
BLAKE2b-256 1b2a985b7a921c334c41f3e3557495a9ca73d897606b09ac98f5b8f15b95c541

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