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.2.1.tar.gz (8.3 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.2.1-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: smart-prospective-api-1.2.1.tar.gz
  • Upload date:
  • Size: 8.3 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.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.2

File hashes

Hashes for smart-prospective-api-1.2.1.tar.gz
Algorithm Hash digest
SHA256 268467353cdc1ce9ce634a17dd7438b06dfc32a25d9a607b4c08529454ff9ffc
MD5 869d8e8111873becf0a5e0925ec196df
BLAKE2b-256 136a1118e416cf38d3a98bf0a7c9a3e32689163f65a36495d096e374e8d0dd0e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: smart_prospective_api-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 9.2 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.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.2

File hashes

Hashes for smart_prospective_api-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d5f654c9dcbb4ca724a32ded9b3ac77921d0c9319c23a3b901ef33f5b600ad67
MD5 6743d0ffee184bfa4744f3572a8ea164
BLAKE2b-256 d24c2fbc1b125921b9575a9c9789f2aeb3e572e0713bee1df0a99e99f2ee6940

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