jServicePy
API wrapper for jService (comes with a commmand-line game implementation!)
A wrapper for jService and a small command-line based version of Jeopardy using said wrapper with ANSI escape codes.
Examples
API
from jservicepy import jService
jeopardy = jService() # <- If you're running your own instance, put your base URL in here
clues = jeopardy.clues()
for clue in clues:
print(clue.question + ':', clue.answer, '| $' + str(clue.value))
CLI
python -m jservicepy -h
usage: jServicePy [-h] [-c NUMBER] [-r NUMBER] [-v]
Play Jeopardy in your terminal! Powered by @sottenad's jService
[https://github.com/sottenad/jService] (v1.0)
optional arguments:
-h, --help show this help message and exit
-c NUMBER, --categories NUMBER
Answer questions from a NUMBER of random categories.
-r NUMBER, --random NUMBER
Answer a NUMBER of random questions
-v, --version show program's version number and exit
Application Programming Interfacte Documentation
class jService
init
Initialize jService.
Args:
- baseURL (str, optional): Base URL to send requests to; use if you are making calls to your own instance of jService. Defaults to "https://jservice.io".
categories
Get a list of categories.
Args:
- count (int, optional): Amount of categories to return, limited to 100 at a time. Defaults to 1. offset (int, optional): Offsets the starting ID of categories returned. Useful in pagination. Defaults to 0.
Returns:
- list: A list of Category dataclasses.
category
Get a category.
Args:
- id (int): The ID of the category to return.
Returns:
- Category: A dataclass containing the cateory ID, title, number of clues, and list of clues for the category.
clues
Get a list of clues.
Args:
- value (int, optional): The value of the clue in dollars.
- category (int, optional): The id of the category you want to return.
- min_date (datetime, optional): Earliest date to show, based on original air date.
- max_date (datetime, optional): Latest date to show, based on original air date.
- offset (int, optional): Offsets the returned clues. Useful in pagination.
Returns:
- list: A list of Clue dataclasses.
random
Get random clues.
Args:
- count (int, optional): Amount of clues to return, limited to 100 at a time. Defaults to 1.
Returns:
- list: A list of Clue dataclasses.
Metadata
Release files for jservicepy 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| jServicePy-1.0.tar.gz | 5.6 kB | Without provenance | Details for jServicePy-1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| jServicePy-1.0-py3-none-any.whl | Python 3 | none | any | Details for jServicePy-1.0-py3-none-any.whl |
Total release size: 13.0 kB
Release files / jServicePy-1.0.tar.gz
| Download URL | jServicePy-1.0.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6ccbdc3f8dd1775c0eb98629e46b0e57d7dab6d068fb639c64e33da49d62638e
|
|
BLAKE2b-256 checksum How to use checksums |
5d700867cfe710af091c177150dda9ed888f4ba9f45d7b7470435da6e9bd79f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.0b2 CPython/3.7.3 Linux/5.4.40-04224-g891a6cce2d44
|
Release files / jServicePy-1.0-py3-none-any.whl
| Download URL | jServicePy-1.0-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6808a3708ba75b39e61e07788661d882e590cb55dfb226f5ecdcae77027f725c
|
|
BLAKE2b-256 checksum How to use checksums |
e573b146b1799f811103d0010371f7a99f3b76c65955f9804c8af85b6df0a763
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.0b2 CPython/3.7.3 Linux/5.4.40-04224-g891a6cce2d44
|
Security for jservicepy 1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.