Skip to main content

A Python client library for accessing JW Platform API. Visit JW Player Developer site for more information about JW Platform API.

Installation

JW Platform API library can be installed using pip:

pip install jwplatform

Library has Requests package as dependency. It will be installed automatically when installing using pip.

Usage

Import jwplatform library:

from jwplatform.client import JWPlatformClient

Initialize jwplatform client instance. API keys can be created in the JW Platform dashboard on the API Credentials page. Copy the secret value to use here.

jwplatform_client = JWPlatformClient('API_SECRET')

Make an API request:

response = jwplatform_client.Media.get(site_id='SITE_ID', media_id='MEDIA_ID')

If API request is successful, response variable will contain dictionary with information related to the response and the actual video data in response.json_body:

>>> response.json_body
{"id": "Ny05CEfj",
 "type": "media",
 "created": "2019-09-25T15:29:11.042095+00:00",
 "last_modified": "2019-09-25T15:29:11.042095+00:00",
 "metadata": {
   "title": "Example video",
   "tags": ["new", "video"]
 }}

JW Platform API library will raise exception inherited from jwplatform.errors.APIError if anything goes wrong. For example, if there is no media with the specified media_id requesting it will raise jwplatform.errors.NotFoundError:

try:
    jwplatform_client.Media.get(site_id='SITE_ID', media_id='BAD_MEDIA_ID')
except jwplatform.errors.NotFoundError as err:
    print(err)

For the complete list of available exception see jwplatform/errors.py file.

Source Code

Source code for the JW Platform API library provided on GitHub.

License

JW Platform API library is distributed under the MIT license.

Changelog

2.1.0 (2021-01-12)

  • Added support for JWPlatform file upload using a multi-part mechanism.

2.0.1 (2021-01-11)

  • Fix a bug on generating the signature when array value is in the query string.

2.0.0 (2020-12-03)

  • Added support for JWPlatform API v2

  • All existing v1 API functionality has been moved to the jwplatform.v1 submodule (from jwplatform).

1.3.0 (2019-12-22)

  • remove Python 2 compatibility

1.2.2 (2018-04-10)

  • parameters are now included in the request body by default for POST requests

1.2.1 (2017-11-20)

  • improved default parameters handling when instantiating client

  • added exponential connection backoff

1.2.0 (2016-11-22)

  • allow additional Request package params in API requests

1.1.0 (2016-11-03)

  • added JWPlatformRateLimitExceededError exception

1.0.0 (2016-07-21)

  • Initial release.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jwplatform-2.1.1.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

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

jwplatform-2.1.1-py2.py3-none-any.whl (20.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file jwplatform-2.1.1.tar.gz.

File metadata

  • Download URL: jwplatform-2.1.1.tar.gz
  • Upload date:
  • Size: 22.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.0

File hashes

Hashes for jwplatform-2.1.1.tar.gz
Algorithm Hash digest
SHA256 81923de7d41721d5fa4c4798a8b5d791afd3b41e9dc0608de555e183730b977d
MD5 45eba93a0b22cae172c267c75fa0320c
BLAKE2b-256 fac107db04252ad8c1c43b9a345df2fa1bd391cb0df554f4f71020acc0a5e974

See more details on using hashes here.

File details

Details for the file jwplatform-2.1.1-py2.py3-none-any.whl.

File metadata

  • Download URL: jwplatform-2.1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 20.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.0

File hashes

Hashes for jwplatform-2.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4a356a9152c3406fc7d7068db13b090298930d3b92632082f4afa6411feb8801
MD5 e60cdd640b14a723cb68b6bb575f7dc7
BLAKE2b-256 eb6d2da0de4b1dfa6d0c5d6c04a35f779875236ade4f0a5abc777e58750c428c

See more details on using hashes here.

Release history Release notifications | RSS feed

2.2.2

2 files

2.2.1

2 files

2.1.3

2 files

2.1.2

2 files

This release

2.1.1 This release

2 files

2.0.1

2 files

2.0.0

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.0

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page