jwlib.pub

Note

Under construction, the API may be subject to change.

(very untested) Wrapper for the jw.org publications API

class jwlib.pub.Language(code: str, data: dict)[source]
__init__(code: str, data: dict)[source]
property code
property isocode: str

ISO 639 language code

Raises LookupError if undefined.

property name: str

Display name

property rtl: bool

Right to left

data: dict

Object data as returned by the server.

If you need access to information that has no getter method, you can get it here.

Note

Editing this directory is an untested feature.

class jwlib.pub.Marker(data: dict)[source]
property duration
property start
property verse: int | None
__init__(data: dict)
data: dict

Object data as returned by the server.

If you need access to information that has no getter method, you can get it here.

Note

Editing this directory is an untested feature.

class jwlib.pub.MarkerGroup(data: dict)[source]
property bible_book_chapter: int
property bible_book_number: int
property hash: str

TODO what type?

property first_marker: Marker

Marker of introduction

property markers: list[Marker]

Generate Markers for each verse

property type: str

May be ‘publication’ or ‘bible’ TODO what more?

property spoken_language: str
property written_language: str
__init__(data: dict)
data: dict

Object data as returned by the server.

If you need access to information that has no getter method, you can get it here.

Note

Editing this directory is an untested feature.

class jwlib.pub.File(language: str, filetype: str, data: dict)[source]
__init__(language: str, filetype: str, data: dict)[source]
Parameters:
  • language – JW language code

  • filetype – File type like MP3

property bible_book: int

Bible book, 0 = All, 1 = Genesis

property bit_rate: float

TODO what unit?

property checksum: str
property date: datetime | None

Modification date

property doc_id: str

May be used to load articles at jw.org TODO is this true?

property duration: int

Duration in seconds

property edition_code: str

TODO what?

property edition_descr: str

TODO what? Example: Regular

property frame_height: int
property frame_rate: int
property frame_width: int
property has_track: bool
property image: str | None
property label: str

TODO is this like video quality? Example: 0p

property markers: MarkerGroup | None

MarkerCollection - holds list of Markers plus some metadata

property mimetype: str
property pub_code: str
property pub_format: str

TODO what?

property pub_format_descr: str

TODO what? Example: Regular

property size: int

TODO what unit?

property specialty_code: str

Example: BR2 (braille)

property specialty_descr: str

Example: Braille Grade 2

property stream: str

TODO What is this? Example: https://jw.org

property subtitled: bool
property title: str
property track: int

Track number (ie chapter number of book when dealing with audio recordings)

property url: str

Download URL

data: dict

Object data as returned by the server.

If you need access to information that has no getter method, you can get it here.

Note

Editing this directory is an untested feature.

class jwlib.pub.Publication(data: dict)[source]
property bible_book: int | None

Number of bible book (0 is index page)

property code: str

Publication code

property date: str

TODO Formatted date of some kind

property format: list

TODO List of some kind of file formats

property image: str | None
property issue: str | None

Magazine issue code

property files: list[File]

List of File info objects for all languages and file types

property languages: list[Language]

List of Language info

property name: str
property parent_name: str

Display name of parent publication

property speciality: str

TODO Braille code etc?

property track: int | None

Track number (chapter of a book etc when dealing with sound recordings)

__init__(data: dict)
data: dict

Object data as returned by the server.

If you need access to information that has no getter method, you can get it here.

Note

Editing this directory is an untested feature.

jwlib.pub.get_publication(pub: str, lang: str, *, issue: int | None = None, bible_book: int | None = None, all_langs=False, filetype: str | None = None) Publication[source]