Skip to main content

xkcd-python

PYPI weekly Downloads PYPI monthly Downloads

xkcd-python is an API wrapper for xkcd.com written in python.

Installation

Use the package manager pip to install xkcd-python.

pip install -U xkcd-python

Usage

Normal usage

from xkcd_python import Client

#creates the client
client = Client()

# returns the comic by id
client.get(1)

# returns a random comic
client.random()

# returns the latest comic
client.latest_comic()

Async usage

from xkcd_python import Client
import asyncio

client = Client()

async def main():
    tasks = (client.get(x) for x in range(1, 20))
    return await asyncio.gather(*tasks)

asyncio.run(main)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Metadata

Release files for xkcd-python 3.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xkcd-python 3.3.0
File Size Uploaded
xkcd_python-3.3.0.tar.gz 3.2 kB Details

Release files / xkcd_python-3.3.0.tar.gz

Download URL xkcd_python-3.3.0.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
90ef175f9d670ca0f082bb7c9755781fed0344b588a0d4d5d1b9d7825b628bcb
BLAKE2b-256 checksum
How to use checksums
e0962b9588c94b175c0d48868d7e980a04b520aba3e83893e302f797c3fda6cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.0

Release history Release notifications | RSS feed

This release

3.3.0 This release

1 release file

3.2.0

1 release file

3.1.1

1 release file

3.1.0

1 release file

3.0.0

1 release file

2.9.0

2 release files

2.8.0

2 release files

2.7.0

2 release files

2.6.0

2 release files

2.5.0

2 release files

2.1.0

2 release files

2.0.5

2 release files

2.0.0

2 release 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