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.0.tar.gz (11.1 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.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: toontown.py-1.0.0.tar.gz
  • Upload date:
  • Size: 11.1 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.0.tar.gz
Algorithm Hash digest
SHA256 17e60735d88aa302efb809b4c72b13ea54d065dfb34b23d514d78eb16ea399a0
MD5 92abb9b9059db9a00924659698151cb7
BLAKE2b-256 23193e3d73e09e9a1c94e50189d623c88771dfb2ca1c376f2e34054afe7e0727

See more details on using hashes here.

File details

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

File metadata

  • Download URL: toontown.py-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 13.9 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 11a9e35f38ee27938411752e52488d397e8d1369444a7ac3ce70a2e7f079afb5
MD5 f471adb37b8f584755538069460f4aec
BLAKE2b-256 62d9f4faf74dc6fca40929de2e8056abbf29b73db2b63db4ca79efeaff18b13a

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