Skip to main content

Python interface to Tox distributed communications

Project description

<figure> </figure>

dendrotox is a Python module designed to enable Python code to interact with the Tox distributed communications network, including for the purposes of scripts communicating with people or other scripts. It uses TokTok Toxcore and ratox for interfacing with the Tox network and megaparsex for parsing.

In particular, dendrotox interacts with the filesystem provided by the FIFO Tox client ratox. dendrotox also provides functionality to send and receive messages, to parse input, to send files, to request confirmations, to provide information such as IP address and weather information, and to run arbitrary commands, including functionality to launch reverse-SSH connections and to restart a script.


sudo apt-get install\
    autoconf        \
    autotools-dev   \
    automake        \
    build-essential \
    checkinstall    \
    check           \
    cmake           \
    git             \
    libtool         \
    libsodium-dev   \
cd ~
mkdir Tox
cd Tox

Install the Sodium crypto library.

git clone
cd libsodium
git checkout tags/1.0.3
make check
sudo checkinstall --install --pkgname libsodium --pkgversion 1.0.0 --nodoc
sudo ldconfig
cd ..

Install the libvpx codec.

git clone
cd libvpx
git checkout tags/v1.4.0
./configure --enable-shared --disable-static
make -j$(nproc)
sudo make install
cd ..

Install TokTok ToxCore.

git clone
cd c-toxcore
autoreconf --install --force
mkdir _build
cd _build
make -j$(nproc)
sudo make install
sudo ldconfig
cd ../..

Install ratox.

#git clone git://
git clone
cd ratox
make -j$(nproc)
sudo make install

Install dendrotox.

sudo pip install dentrodox

When ratox is launched for the first time, it creates a file .ratox.tox at the working directory to store Tox profile details. While running, the file id contains the Tox ID.


dendrotox is imported and launched in the following way:

import dendrotox


print("Tox ID: " + dendrotox.self_ID())

A message can be sent to a contact in the following way, where a contact is specified using a string containing their Tox ID:

    contact = Tox_ID,
    text    = "oohai"

A message can be sent to multiple contacts in the following way, where contacts are specified as a list of strings containing contacts’ Tox IDs.

    contacts = [Tox_ID_1, Tox_ID_2],
    text     = "sup"

A list of unseen messages received recently can be accessed in the following ways:

messages = dendrotox.received_messages()

message = dendrotox.last_received_message()


See example bot code for more advanced usage, including message parsing, confirmations and running commands.

The script is a command line script that can be used to send a message to contacts. It attempts to connect with any specified contacts before attempting to send a message to them. If no contacts are specified, it attempts to send a message to all known contacts. --text="alert"

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

dendrotox-2017.10.20.10.tar.gz (22.0 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page