Git Product home page Git Product logo

pytoxcore's Introduction

⚠️ This project is abandoned due no any progress in libtoxcore for a year - unfortunately seems Tox project is dead :(


pytoxcore

Build Status Coverity status

Python binding for ToxCore.

Download / Install

Compile from sources

$ python setup.py build
$ python setup.py install

To compile with TokTok toxcore implementation:

$ CFLAGS="-DTOX_TOKTOK" python setup.py build

Usage

See Echo Bot Example.

Documentation

Most methods of ToxCore, ToxAV and ToxDNS classes well documented in original tox.h, toxav.h and toxdns.h.

Also you can get help from extension itself:

$ python
>>> from pytoxcore import ToxCore, ToxAV, ToxDNS
>>> help(ToxCore)

Additional non libtoxcore api methods and callbacks described below.

ToxCore

tox_keypair_new

Return new (public_key, secret_key) tuple. Used to create new tox account.

tox_keypair_new()
tox_public_key_restore

Return public key restored from secret key.

tox_public_key_restore(secret_key)
tox_nospam_new

Return new random nospam value as hex-string.

tox_nospam_new()
tox_address_new

Return ToxID from public key and nospam value.

tox_address_new(public_key, nospam)
tox_address_check

Check given ToxID and throws exception if address is invalid.

tox_address_check(address)
tox_sendfile

Send file identified by path to a friend like system sendfile. Return file_number on success like original tox_file_send. Call tox_sendfile_cb callback (see below).

tox_sendfile(friend_number, kind, path, filename, timeout)
tox_sendfile_cb

This event is triggered when tox_sendfile call finished.

tox_sendfile_cb(friend_number, file_number, path, filename, status)

status may be one of:

  • TOX_SENDFILE_COMPLETED - call finished successfully;
  • TOX_SENDFILE_TIMEOUT - send timeout occured;
  • TOX_SENDFILE_ERROR - filesystem, toxcore or other error.
tox_recvfile

Receive file from a friend and store it to path. Call tox_recvfile_cb callback (see below).

tox_recvfile(friend_number, file_number, file_size, path, filename, timeout)
tox_recvfile_cb

This event is triggered when tox_recvfile call finished.

tox_recvfile_cb(friend_number, file_number, path, filename, status)

status may be one of:

  • TOX_RECVFILE_COMPLETED - call finished successfully;
  • TOX_RECVFILE_TIMEOUT - receive timeout occured;
  • TOX_RECVFILE_ERROR - filesystem, toxcore or other error.

ToxAV

toxav_video_frame_format_set

Set video frame format for toxav_video_receive_frame_cb callback (see below).

toxav_video_frame_format_set(format)

Format may be one of:

  • TOXAV_VIDEO_FRAME_FORMAT_BGR - BGR frame format;
  • TOXAV_VIDEO_FRAME_FORMAT_RGB - RGB frame format;
  • TOXAV_VIDEO_FRAME_FORMAT_YUV420 - (default) YUV420 format.
toxav_video_send_frame

Original toxav_video_send_frame method splitted into three to send frame in BGR, RGB and YUV420 (default) formats.

toxav_video_send_bgr_frame(friend_number, width, height, bgr)
toxav_video_send_rgb_frame(friend_number, width, height, rgb)
toxav_video_send_yuv420_frame(friend_number, width, height, y, u, v)
toxav_video_receive_frame_cb

This event is triggered when a video frame received. First for RGB/BGR video frame format, second for YUV420 (default).

toxav_video_receive_frame_cb(friend_number, width, height, rgb)
toxav_video_receive_frame_cb(friend_number, width, height, y, u, v, ystride, ustride, vstride)

pytoxcore's People

Contributors

abbat avatar rysiekpl avatar zawertun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pytoxcore's Issues

Explicit license

The debian/copyright file states the license is GPL v.3, yet the project lacks proper a LICENSE or COPYING file.

Don't hard-code include/lib paths in setup.py

I don't know how python setup.py works, but it has a hard-coded path to /usr/tox/{include,lib} in it. This should probably be auto-detected or configurable. If it is in fact configurable, please add that to the installation instructions (also, write installation instructions).

Add test suite and measure coverage

This code seems to have no tests, only examples. It needs a test suite and build with C coverage (gcov) enabled. I suggest using coveralls.io to ensure that coverage becomes and remains high.

Add support for OS X

OS X doesn't have (or need) librt. It does support pkg-config. Perhaps you can use pkg-config to detect header locations and linker flags?

Impossible to set up savedata_type

ToxCore provides savedata_type settings at instance creation. For now looks like it is impossible to change it using pytoxcore (or I haven't found way to do that).

When try to build: fatal error: tox/tox.h

In file included from pytoxcore.h:23:0,
from pytoxav.h:23,
from pytox.c:20:
pytox.h:31:21: fatal error: tox/tox.h: Нет такого файла или каталога
compilation terminated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.