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.2.tar.gz (10.9 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.2-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: toontown.py-1.0.2.tar.gz
  • Upload date:
  • Size: 10.9 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.2

File hashes

Hashes for toontown.py-1.0.2.tar.gz
Algorithm Hash digest
SHA256 1d277f94486fdb7dc4d5f264f45c1e82efa80e312a1993192a4240bf4918b300
MD5 ecdd80f18c48b88e9e95b2d1fc485e8e
BLAKE2b-256 fd9cf33a0b7e09f33f1b524a61c7bd5c3413c3eab351b83037a1afb6e2ba7f56

See more details on using hashes here.

File details

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

File metadata

  • Download URL: toontown.py-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 13.7 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.2

File hashes

Hashes for toontown.py-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 539b1f8c7788c960ea57a7879dedea8f2290d228113af3bbf4a5048a82927081
MD5 5822ba2b2a88b7001e440f91b946ce6a
BLAKE2b-256 4109363144d536ffc32b73d2b3d08365b853fc6305836d59b2ed9b33be1f28b6

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