Skip to main content

Python bindings for the Delta Chat Core library using CFFI against the Rust-implemented libdeltachat

Project description

This package provides bindings to the deltachat-core Rust -library which implements IMAP/SMTP/MIME/PGP e-mail standards and offers a low-level Chat/Contact/Message API to user interfaces and bots.

Installing bindings from source (Updated: 20-Jan-2020)

Install Rust and Cargo first. Deltachat needs a specific nightly version, the easiest is probably to first install Rust stable from rustup and then use this to install the correct nightly version.

Bootstrap Rust and Cargo by using rustup:

curl https://sh.rustup.rs -sSf | sh

Then GIT clone the deltachat-core-rust repo and get the actual rust- and cargo-toolchain needed by deltachat:

git clone https://github.com/deltachat/deltachat-core-rust
cd deltachat-core-rust
rustup show

To install the Delta Chat Python bindings make sure you have Python3 installed. E.g. on Debian-based systems apt install python3 python3-pip python3-venv should give you a usable python installation.

Ensure you are in the deltachat-core-rust/python directory, create the virtual environment and activate it in your shell:

cd python
python3 -m venv venv  # or: virtualenv venv
source venv/bin/activate

You should now be able to build the python bindings using the supplied script:

./install_python_bindings.py

The installation might take a while, depending on your machine. The bindings will be installed in release mode but with debug symbols. The release mode is currently necessary because some tests generate RSA keys which is prohibitively slow in non-release mode.

After successful binding installation you can install a few more Python packages before running the tests:

python -m pip install pytest pytest-timeout pytest-rerunfailures requests
pytest -v tests

running “live” tests with temporary accounts

If you want to run “liveconfig” functional tests you can set DCC_NEW_TMP_EMAIL to:

  • a particular https-url that you can ask for from the delta chat devs. This is implemented on the server side via the [mailadm](https://github.com/deltachat/mailadm) command line tool.

  • or the path of a file that contains two lines, each describing via “addr=… mail_pw=…” a test account login that will be used for the live tests.

With DCC_NEW_TMP_EMAIL set pytest invocations will use real e-mail accounts and run through all functional “liveconfig” tests.

Installing pre-built packages (Linux-only)

If you have a Linux system you may try to install the deltachat binary “wheel” packages without any “build-from-source” steps.

We suggest to Install virtualenv, then create a fresh Python virtual environment and activate it in your shell:

virtualenv venv  # or: python -m venv
source venv/bin/activate

Afterwards, invoking python or pip install only modifies files in your venv directory and leaves your system installation alone.

For Linux, we automatically build wheels for all github PR branches and push them to a python package index. To install the latest github master branch:

pip install --pre -i https://m.devpi.net/dc/master deltachat

To verify it worked:

python -c "import deltachat"

Code examples

You may look at examples.

Building manylinux based wheels

Building portable manylinux wheels which come with libdeltachat.so can be done with docker-tooling.

using docker pull / premade images

We publish a build environment under the deltachat/coredeps tag so that you can pull it from the hub.docker.com site’s “deltachat” organization:

$ docker pull deltachat/coredeps

This docker image can be used to run tests and build Python wheels for all interpreters:

$ docker run -e DCC_NEW_TMP_EMAIL \
   --rm -it -v \$(pwd):/mnt -w /mnt \
   deltachat/coredeps ci_scripts/run_all.sh

Optionally build your own docker image

If you want to build your own custom docker image you can do this:

$ cd deltachat-core # cd to deltachat-core checkout directory
$ docker build -t deltachat/coredeps ci_scripts/docker_coredeps

This will use the ci_scripts/docker_coredeps/Dockerfile to build up docker image called deltachat/coredeps. You can afterwards find it with:

$ docker images

Troubleshooting

On more recent systems running the docker image may crash. You can fix this by adding vsyscall=emulate to the Linux kernel boot arguments commandline. E.g. on Debian you’d add this to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub.

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

deltachat-1.40.0.zip (117.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

deltachat-1.40.0-cp38-cp38-manylinux2014_x86_64.whl (13.8 MB view details)

Uploaded CPython 3.8

deltachat-1.40.0-cp37-cp37m-manylinux2014_x86_64.whl (13.8 MB view details)

Uploaded CPython 3.7m

deltachat-1.40.0-cp36-cp36m-manylinux2014_x86_64.whl (13.8 MB view details)

Uploaded CPython 3.6m

deltachat-1.40.0-cp35-cp35m-manylinux2014_x86_64.whl (13.8 MB view details)

Uploaded CPython 3.5m

File details

Details for the file deltachat-1.40.0.zip.

File metadata

  • Download URL: deltachat-1.40.0.zip
  • Upload date:
  • Size: 117.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: devpi-server/5.5.0 (py3.7.3; linux)

File hashes

Hashes for deltachat-1.40.0.zip
Algorithm Hash digest
SHA256 51363f8cb848450be635edf2b5fb976711ed9ee5d94ead89eec23b8d94e218e2
MD5 179084d5a895f11f14c79e91c61aa080
BLAKE2b-256 85c40827dd999c6cca7f8255d817e6fa9f313c9d0dbc4b666053d6a673f77c38

See more details on using hashes here.

File details

Details for the file deltachat-1.40.0-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for deltachat-1.40.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d557f8f8a006c9f848126bc39e6a3e15c5baa289708a62e33f3462ac5f7a6052
MD5 6c32e31dbbcfec567d539bea521d3508
BLAKE2b-256 47702fb0b5633232a442e0d4e6ca464d5dfa87dcc07b7bdf0d22a8fa6a516aaa

See more details on using hashes here.

File details

Details for the file deltachat-1.40.0-cp37-cp37m-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for deltachat-1.40.0-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3b7827fe57d414faee40a7d45638641fdbe3032f464c64c0b6c64b1f1a27b122
MD5 53d3d708f8f5afb57118603df50f4fad
BLAKE2b-256 b5616ed87841a431f7c4a56b7ece221ae461e1c206208c2a6bd0c4a626e02302

See more details on using hashes here.

File details

Details for the file deltachat-1.40.0-cp36-cp36m-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for deltachat-1.40.0-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9d33d578c954cffe0f6058d287c1966089283e898d7b0e11377021d3bb96e3ce
MD5 c3527f57fd56b4048ed5c804b692551d
BLAKE2b-256 25c2a5108cae443aaed21dd8099f8b1dedcc4781937b9a2795307229005e7b56

See more details on using hashes here.

File details

Details for the file deltachat-1.40.0-cp35-cp35m-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for deltachat-1.40.0-cp35-cp35m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0489c2f8270e8618f364202431255b48ea244d1b5f688d043efd0df8c5791b6a
MD5 8abd679c4392cb3235696014e539e924
BLAKE2b-256 ba31ba3f1d5fdfbdbd2c0624d2d3c92631e2278876f6a54a2be1f144a53ca9ea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page