Skip to main content

Wrapper for jw.org APIs

Project description

Build Status Package Status Documentation Status

Python wrappers for a few jw.org APIs.

Installation

pip install jwlib

Usage

Browsing JW Broadcasting

import jwlib.media as jw

# Select Swedish
session = jw.Session(language='Z')

# Fetch the JW Broadcasting category
studio_category = session.get_category('VODStudio')

# Iterate through all its subcategories
# (this will make more API requests as needed)
for subcategory in studio_category.get_subcategories():

    # Print a category header
    print(f'\n{subcategory.name}\n-----------')

    # Print title and URL of all media items
    for media in subcategory.get_media():
        print(media.title)
        print(media.get_file().url)

See the media documentation for more details.

Searching at jw.org

import jwlib.search as jw

# Search for videos only
page = jw.search('Caleb', filter_type=jw.FILTER_VIDEO, language='S')
for result in page.results:
    print(result.title, result.url_jw)

# Print page number info
print(page.pagination_label)

# Continue on next page
if page.next:
    next_page = page.next.open()
    for result in next_page.results:
        print(result.title, result.url_jw)

See the search documentation for more details.

Downloading publications

Alpha version, may be subject to change.

Listing languages

Alpha version, may be subject to change.

Development

An example on how to setup the dev environment:

# Create a virtual Python environment
python -m venv venv
. venv/bin/activate

# Install dependencies
# -e keeps the installed jwlib in sync with your changes
# [dev] installs the dependencies for testing
# [dev,docs] if you also want to build documentation
pip install -e '.[dev]'

# Run the tests
make test

# Show more convenience functions
make help

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

jwlib-1.1.2.tar.gz (5.6 MB view details)

Uploaded Source

Built Distribution

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

jwlib-1.1.2-py3-none-any.whl (38.5 kB view details)

Uploaded Python 3

File details

Details for the file jwlib-1.1.2.tar.gz.

File metadata

  • Download URL: jwlib-1.1.2.tar.gz
  • Upload date:
  • Size: 5.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for jwlib-1.1.2.tar.gz
Algorithm Hash digest
SHA256 1587d64794676afd678bdafd35a16f83d7cb91a0200cf7ade9de0bee27863b5a
MD5 c6118875fd085f9f168d52f5e203b72e
BLAKE2b-256 ff30588cbde059610896c125e66601dd512faab248da05eabcd9b619cebf12a0

See more details on using hashes here.

Provenance

The following attestation bundles were made for jwlib-1.1.2.tar.gz:

Publisher: build.yml on allejok96/jwlib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jwlib-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: jwlib-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 38.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for jwlib-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 089a47cfe34bd0b8088b8e0e618cd0d4281bad67e8eace5f5d908a11bcf9a95b
MD5 f4e56326a9eea5af7fe4e492b82865a7
BLAKE2b-256 f52efd531f032ccb15f072408184679fb25ea33d55e6ac0c253fbb9f0b9f71df

See more details on using hashes here.

Provenance

The following attestation bundles were made for jwlib-1.1.2-py3-none-any.whl:

Publisher: build.yml on allejok96/jwlib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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