Skip to main content
http://img.shields.io/travis/aitjcize/PyTox.svg http://img.shields.io/pypi/v/PyTox.svg http://img.shields.io/pypi/dm/PyTox.svg

PyTox

Python binding for Project Tox.

PyTox provides a Pythonic binding, i.e Object-oriented instead of C style, raise exception instead of returning error code. A simple example is as follows:

class EchoBot(Tox):
    def loop(self):
        while True:
            self.do()
            time.sleep(0.03)

    def on_friend_request(self, pk, message):
        print 'Friend request from %s: %s' % (pk, message)
        self.add_friend_norequest(pk)
        print 'Accepted.'

    def on_friend_message(self, friendId, message):
        name = self.get_name(friendId)
        print '%s: %s' % (name, message)
        print 'EchoBot: %s' % message
        self.send_message(friendId, message)

As you can see callbacks are mapped into class method instead of using it the the c ways. For more details please refer to examples/echo.py.

Getting started

To get started, a Makefile is provided to run PyTox inside a docker container:

  • make test: This will launch tests in a container.

  • make run: This will launch an interactive container with PyTox installed.

  • make echobot: This will launch the example echobot in a container.

Examples

  • echo.py: A working echo bot that wait for friend requests, and than start echoing anything that friend send.

Documentation

Full API documentation can be read here.

Todo

  • Complete API binding (use toos/apicomplete.py to check)

  • Unittest for ToxAV

Contributing

  1. Fork it

  2. Create your feature branch (git checkout -b my-new-feature)

  3. Commit your changes (git commit -am 'Add some feature')

  4. Push to the branch (git push origin my-new-feature)

  5. Create new Pull Request

Metadata

Release files for PyTox 0.0.23

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyTox 0.0.23
File Size Uploaded
PyTox-0.0.23.tar.gz 35.5 kB Details

Release files / PyTox-0.0.23.tar.gz

Download URL PyTox-0.0.23.tar.gz
Size 35.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7bec699aaa74766b0c591773d64df39e73ef912eddc5a1db530b322267833260
BLAKE2b-256 checksum
How to use checksums
0c9b426ed9cc12398055552a48b8afdd08d5ed070dbd76ac100385cfb42444fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.0.23 This release

1 release file

0.0.22

1 release file

0.0.21

1 release file

0.0.20

1 release file

0.0.17

1 release file

0.0.16

1 release file

0.0.15

1 release file

0.0.13

1 release file

0.0.12

1 release file

0.0.11

1 release file

0.0.10

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

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