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(
    choices=[
        "https://example.com/image-red.jpg",
        "https://example.com/image-green.jpg",
        "https://example.com/image-blue.jpg"
    ],
    tournament="test-tournament")

# Or more using a prefix and suffix for choices

url = pp.create_choose_url(
    choices=["red", "green", "blue"],
    choices_prefix="https://example.com/image-",
    choices_suffix=".jpg",
    tournament="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.5.tar.gz (4.1 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.5-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: preferred_pictures-0.5.tar.gz
  • Upload date:
  • Size: 4.1 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.5.tar.gz
Algorithm Hash digest
SHA256 bbbbf821e3b84163f95a8f6b3924fb3574e1aaa6a3e11afcc17e62cfb6b09758
MD5 8cc34ea58face60a89e31a1c7c718bac
BLAKE2b-256 b2526e206e028169e194cc5caf3042a47e235d22e7e40aaf7a30fcb0b0c2a3b5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: preferred_pictures-0.5-py3-none-any.whl
  • Upload date:
  • Size: 5.2 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 d238bdc4ce91167a2c649afbd13b519bf67761fcbcd654cd6df802da0fae8b12
MD5 bde123addb5df402314eaf7392ad90fc
BLAKE2b-256 3d807b21ad16c1ebe3c210549d8cfb4a21eba523d1b39d3bbc0ab9d607b42160

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