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 -m 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.1.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.1-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: smart-prospective-api-1.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 61c95f0602f972dac6af51fce3c5c14952bdae18879750c2949e3f42d175e801
MD5 2c018cdc5d9cf139e4a0600ae2397e55
BLAKE2b-256 9dcce5aa6c6c42ed4c13d0a76a6e68e226116bec802c3e5ba349cebdc8d4dc34

See more details on using hashes here.

File details

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

File metadata

  • Download URL: smart_prospective_api-1.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 25519982eb6015236488f70bea103192a4bdd8132e65f937953582f1d7c095c3
MD5 9aa6c15734826f71b22980c84e39e2b0
BLAKE2b-256 6cbb134968ae65e7277859b61de04e8cf886cfd62649ce318a47511f422d0179

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