Skip to main content

BellTower

A super-simple Python library for interacting with Ringing Room.

This library is quite W.I.P., and its development is mostly driven by its potential use in Wheatley and other (as of yet unreleased) projects of mine. The library seems to be quite stable, but the API could change at any moment whilst I'm developing it.

If you have any queries, then please leave an issue. Pull requests are very welcome, but if you are making any large-scale changes then it may be worth suggesting them in an issue first.

Get Started

Quickstart and documentation are both here, and examples can be found in the examples folder.

Why use this simple library?

  • Simple libraries are just nicer to use!
  • No knowledge of Ringing Room internals is needed to do cool things with Ringing Room.
  • If the internals of Ringing Room change (which they have done), then fixing those breakages is as simple as changing to the newest version of BellTower.
  • This library doesn't have to be specific to Ringing Room (though Ringing Room is far and away the most popular online ringing platform, so for the time being it is the only supported platform).

Example: A simple chatbot

A chatbot which, whenever anyone says Hello in the chat, replies with Hello, <username>.

More examples can be found in the examples folder, with this example at examples/chatbot.py:

# Import the tower class, and 'time.sleep'
from time import sleep
from belltower import RingingRoomTower

# Create a new tower, and tell it to join tower ID 765432918
tower = RingingRoomTower(765432918)

# Register a function to be called when a chat message is posted
@tower.on_chat
def on_chat(user, message):
    print(f"{user} says '{message}'")
    # If the message is 'hello' in any capitalisation, send 'Hello <user>'.
    # The first argument is the name to put next to the chat message
    if message.lower() == "hello":
        tower.chat("RR ChatBot", f"Hello, {user}!")

# The 'with' block makes sure that 'tower' has a chance to gracefully shut
# down the connection if the program crashes
with tower:
    # Wait until the tower is loaded
    tower.wait_loaded()
    # Go into an infinite loop.  It doesn't matter what the main thread does,
    # but if it leaves the `with` block then the Tower's connection will
    # close and become unusable
    while True:
        sleep(1000)

Metadata

Release files for belltower 0.1.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 belltower 0.1.0
File Size Uploaded Provenance Actions
belltower-0.1.0.tar.gz 13.4 kB Without provenance Details for belltower-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for belltower 0.1.0
File Interpreter ABI Platform Actions
belltower-0.1.0-py3-none-any.whl Python 3 none any Details for belltower-0.1.0-py3-none-any.whl

Total release size: 27.7 kB

Release files / belltower-0.1.0.tar.gz

Download URL belltower-0.1.0.tar.gz
Size 13.4 kB
Tags Source
SHA-256 checksum
How to use checksums
00549aea13350b5c950827675eb364000e7641aa8b4c2b95e999e19c6c179846
BLAKE2b-256 checksum
How to use checksums
13f7863a045e2d1b9556364b645eb2b78729e6ec78e413f165af0beb86fb4f21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.5

Release files / belltower-0.1.0-py3-none-any.whl

Download URL belltower-0.1.0-py3-none-any.whl
Size 14.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
09be25ba39202836e8f3ef04fe26aec8b4f6f8c4335eeb0b14e30541b7a4e48e
BLAKE2b-256 checksum
How to use checksums
1a7dce76aff0b3506b60a843e413d4dd504b33bfae2ab315dfa48c241627dd48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.5

Security for belltower 0.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.

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