Skip to main content
## Installation

### Using pip

pip install ttapi

### Via source

Obtain the source by downloading from the web or cloning with git. In the
directory containing setup.py run:

python setup.py install

## Examples

### Chat bot

This bot respond to anybody who write "/hello" on the chat.

```py
from ttapi import Bot
bot = Bot(AUTH, USERID, ROOMID)

def speak(data):
name = data['name']
text = data['text']
if text == '/hello':
bot.speak('Hey! How are you %s ?' % name)

bot.on('speak', speak)

bot.start()
```

### Simple

```py
from ttapi import Bot
bot = Bot(AUTH, USERID, ROOMID)

# Define callbacks
def roomChanged(data): print 'The bot has changed room.', data
def speak(data): print 'Someone has spoken.', data
def updateVotes(data): print 'Someone has voted.', data
def registered(data): print 'Someone registered.', data

# Bind listeners
bot.on('roomChanged', roomChanged)
bot.on('speak', speak )
bot.on('update_votes', updateVotes)
bot.on('registered', registered )

# Start the bot
bot.start()
```

Metadata

Release files for ttapi 1.2.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 ttapi 1.2.0
File Size Uploaded Provenance Actions
ttapi-1.2.0.tar.gz 6.9 kB Without provenance Details for ttapi-1.2.0.tar.gz

Release files / ttapi-1.2.0.tar.gz

Download URL ttapi-1.2.0.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c7711b19d89815bd011108d7c3ec6c4c0ffd7bcc4f76867dc99cb74dcb734be2
BLAKE2b-256 checksum
How to use checksums
d114a95a0822ab266b84ba2e7364ac3470403724a5cddb4f07c1fa9981d2e80e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for ttapi 1.2.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