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.1.0.tar.gz (8.0 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.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: smart-prospective-api-1.1.0.tar.gz
  • Upload date:
  • Size: 8.0 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.1.0.tar.gz
Algorithm Hash digest
SHA256 8bdbb5ff834ff5563a8259b88e08cc20ca6b061b79a1d1c2d7e407617d8d30fb
MD5 04950a7b0ac3e992913c13d3fe7e0bf1
BLAKE2b-256 9d8656abcffae7c05dfe77b2cbe21ae651e0c112517c90b2bc42613654351ed3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: smart_prospective_api-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 575d52243773f0eda4f2180bbb807b5013015ecd2bcf06440da8902bafd54307
MD5 4f10fa4c586ffd89b110caab186ca3a8
BLAKE2b-256 a1bacfcaa6861562303596149765cb8bd8fecd70e10bac6ecbc7f8b80bcad45e

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