Skip to main content

A simple Python wrapper for the Toontown Rewritten API

Project description

toontown.py

A simple Python API wrapper for the Toontown Rewritten API (https://github.com/ToontownRewritten/api-doc/)

Features

  • Asynchronous and synchronous
  • API complete

Installing

Python 3.8 or higher is required

# Linux/macOS
python3 -m pip install -U toontown.py

# Windows
py -3 -m pip install -U toontown.py

Examples

Synchronous

>>> import toontown
>>> 
>>> 
>>> toontown = toontown.SyncToontownClient()
>>> toontown.connect()
>>> 
>>> population = toontown.population()
>>> population.total  # Random output
1562
>>> for district, district_population in population.districts():
>>>     print(f'{district} population: {district_population}')
... 
>>> toontown.close()

Asynchronous / Context Manager

>>> import toontown
>>> 
>>> 
>>> async with toontown.AsyncToontownClient() as toontown:
>>>     await toontown.field_offices()

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

toontown.py-1.0.1.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

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

toontown.py-1.0.1-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file toontown.py-1.0.1.tar.gz.

File metadata

  • Download URL: toontown.py-1.0.1.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for toontown.py-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e9d9f566bab2f17c3f0a5683f4898b15f7d3a1d5c2e06a2a1a2b13901020d4fd
MD5 93750515d3b3ae4b1e4c972832781b9e
BLAKE2b-256 16eb3592767fe38af23830ee61ca770e934300bad72b1e5542a8f774001293e1

See more details on using hashes here.

File details

Details for the file toontown.py-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: toontown.py-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for toontown.py-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5ace24bff244ef04943a83e250877dc7b4d446f7a5b07571759ec2c4367342ad
MD5 e8acb8abf6b0780b6d4db10f094dc216
BLAKE2b-256 cf86e92e7c6ba5332dbd30c4c996ec941235e4dc8cb248b88d6ad541c786a87b

See more details on using hashes here.

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