Skip to main content

A client for the PreferredPictures API

Project description

PreferredPictures Python Client Library

The PreferredPictures Python library provides a convenient way to call the PreferredPictures API for applications written in Python.

View the documentation of this module

View the documentation about the PreferredPicture's API

Learn more about what PreferredPictures can do.

Installation

$ pip install preferred_pictures

Usage

The package needs to be configured with your account's identity and secret key, which is available in the PreferredPictures interface.

from preferred_pictures import Client

pp = Client("testidentity", "secret123456")
url = pp.create_choose_url(
    [
        "https://example.com/image-red.jpg",
        "https://example.com/image-green.jpg",
        "https://example.com/image-blue.jpg"
    ],
    "test-tournament")

# The URL returned will appear to be something like:
#
# https://api.preferred-pictures.com/choose-url?choices%5B%5D=red&choices%5B%5D=green&choices%5B%5D=blue&tournament=test-tournament&expiration=1597011644&uid=362511d6-997f-452b-afee-8e46331da04a&ttl=600&identity=testidentity&signature=7c6d305405b4518876543435ce5657ee820cad0601359fa173a854dc0dfd6ea1
#

License

This client uses the MIT license.

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

preferred_pictures-0.4.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

preferred_pictures-0.4-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file preferred_pictures-0.4.tar.gz.

File metadata

  • Download URL: preferred_pictures-0.4.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.5

File hashes

Hashes for preferred_pictures-0.4.tar.gz
Algorithm Hash digest
SHA256 519eef71e1e9fa744d04d6087fdbb9cd2cc41b9c736ea86962a086fa79283bcd
MD5 789f2ff8ca30147fe938f70a46757480
BLAKE2b-256 78de57d9ca3cc309192750658df5a6ed5b9ef5b12bf57522b5c9a5225bdd99bd

See more details on using hashes here.

File details

Details for the file preferred_pictures-0.4-py3-none-any.whl.

File metadata

  • Download URL: preferred_pictures-0.4-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.5

File hashes

Hashes for preferred_pictures-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2244e2114d1e20e66130c156e88e4357a695bce122b3bdb2dc512f5bfe1e67ad
MD5 5498bec273b95b45c7d3cd3a5e45d861
BLAKE2b-256 0f87305c62da72b548d920702d898bd107e34077873da4be345c95a6434718d4

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