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 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. Otherwise you need to compile the Delta Chat bindings yourself.

We recommend to first 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"

Running tests

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

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

This will run all “offline” tests and skip all functional end-to-end tests that require accounts on real e-mail servers.

running “live” tests with temporary accounts

If you want to run live functional tests you can set DCC_NEW_TMP_EMAIL to a URL that creates e-mail accounts. Most developers use https://testrun.org URLS created and managed by [mailadm](https://mailadm.readthedocs.io/en/latest/).

Please feel free to contact us through a github issue or by e-mail and we’ll send you a URL that you can then use for functional tests like this:

export DCC_NEW_TMP_EMAIL=<URL you got from us>

With this account-creation setting, pytest runs create ephemeral e-mail accounts on the http://testrun.org server. These accounts exists only for one hour and then are removed completely. One hour is enough to invoke pytest and run all offline and online tests:

pytest

# or if you have installed pytest-xdist for parallel test execution pytest -n6

Each test run creates new accounts.

Installing bindings from source (Updated: July 2020)

Install Rust and Cargo first. The easiest is probably to use rustup.

Bootstrap Rust and Cargo by using rustup:

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

Then clone the deltachat-core-rust repo:

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

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:

python install_python_bindings.py

The core compilation and bindings building might take a while, depending on the speed of 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.

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 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 scripts/docker_coredeps

This will use the 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.88.0.tar.gz (119.0 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.88.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.7 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

deltachat-1.88.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.7 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

deltachat-1.88.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.7 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

deltachat-1.88.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.7 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

deltachat-1.88.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.7 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

deltachat-1.88.0-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.7 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

deltachat-1.88.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

deltachat-1.88.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

deltachat-1.88.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.0 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

deltachat-1.88.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.9 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ ARM64

deltachat-1.88.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.0 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

deltachat-1.88.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.9 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ ARM64

deltachat-1.88.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.0 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

deltachat-1.88.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.9 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ ARM64

File details

Details for the file deltachat-1.88.0.tar.gz.

File metadata

  • Download URL: deltachat-1.88.0.tar.gz
  • Upload date:
  • Size: 119.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: devpi-server/6.6.0.dev1 (py3.8.11; linux)

File hashes

Hashes for deltachat-1.88.0.tar.gz
Algorithm Hash digest
SHA256 f1ca7eb79ad8694243872fe1c404fc7c5da8a0c342eb503e896417e57e9e20e6
MD5 7789fa5c1948e1860db0a9cea5b15e2a
BLAKE2b-256 10d84cf50fd312734580370af3b65a7ae6c1fd84d1b3b48ebd7a94a9c31b003b

See more details on using hashes here.

File details

Details for the file deltachat-1.88.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for deltachat-1.88.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4e00b6c90bfe0a8e54f6cfa8b3a0e14909c69715ab6ecb8eb4e99d3b249dd3ac
MD5 27df8a0050f42bef1aadb4e8d76a6da1
BLAKE2b-256 56a13059f767500a2f3828c841aa80adbbfb7bad0354056f25dbdf1d0bc3d441

See more details on using hashes here.

File details

Details for the file deltachat-1.88.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for deltachat-1.88.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 36af50bca28b21f4066e2c0f7d281d2986505d197dd08d1703d811073044f5f1
MD5 02e6e7562df0b30c11dd270adb6ca87f
BLAKE2b-256 fe1579f54a6a2108c00eb618e002328b5ab9e59e1de57047222a06492d90ed1d

See more details on using hashes here.

File details

Details for the file deltachat-1.88.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for deltachat-1.88.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f59d3536c9b0eb04d9766ffbde715b3d9c197628dcfce8d18eafbd11c5cd947a
MD5 6eacd16c24c2bc0b2277a5b1ba0f73b2
BLAKE2b-256 24fc90a1d82294256e611554fe441c876e0f8f7a24cbca742e49914ddd904088

See more details on using hashes here.

File details

Details for the file deltachat-1.88.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for deltachat-1.88.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 63b64b53b949ccc437b64060f62cd08cfd5efa12690cd9e38b7d51ebbdcd1228
MD5 66d08fd2cfbd67fb4694cd2a54f5fd19
BLAKE2b-256 f0cdc1ebe5b47dff878ac1af4f2b81a0a4e3ab1b34d11a6172f526d4019c43b3

See more details on using hashes here.

File details

Details for the file deltachat-1.88.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for deltachat-1.88.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 45903bb1b201993319d6bbde5e3ba6832d40558d505ebda010ca465613df6767
MD5 c40c5bd8074c9759eeb81f598c8181da
BLAKE2b-256 c9a7824c0223fb5a3200467dec1603bfe6c41104eb7c2f4061ce41ca46363220

See more details on using hashes here.

File details

Details for the file deltachat-1.88.0-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for deltachat-1.88.0-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b48feb3f25e07b74e1c6bdb62e6b02884b9b82e195966598b91eaa184e2294e3
MD5 288e6a19b94c89757ff1cff6b0dcbe0e
BLAKE2b-256 bae9ea91abe02f70519438e04c6db7516065ae018fd1c0e27573bfb964a42a74

See more details on using hashes here.

File details

Details for the file deltachat-1.88.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for deltachat-1.88.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2805edd01d53c37abe77319310bdfb0990c896ae74e2d814a03111de6cfeed64
MD5 8ba81eb1f8ac455557f2b174caee27bb
BLAKE2b-256 2a24ee1909c9357af727460e329f01f394967d6ed85f7203cfa1b3b41c6bc83b

See more details on using hashes here.

File details

Details for the file deltachat-1.88.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for deltachat-1.88.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9223331e25b7b682b3c9027bb634c5bfb1b3131779ae6feb147fb7a5f071ff0d
MD5 38879ac1d5f3349c4ffc4eafa8dfb943
BLAKE2b-256 09371cfd2c286a090c5d9b93c9bceb674f7325f544ef9647fd184525ecff3fc4

See more details on using hashes here.

File details

Details for the file deltachat-1.88.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for deltachat-1.88.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 881f1204559c3ac555c083bbacbf690cd67c9783423ac8d2d89eafc5d1b67486
MD5 8cbd8eaa5adc9fc1300163dae2d1cc21
BLAKE2b-256 b338976122145f8953ed02d12eb1087aef346e9b0a31a1f47f778683ce4ea68e

See more details on using hashes here.

File details

Details for the file deltachat-1.88.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for deltachat-1.88.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 adbd54e8566667bb9b26ca7e5dc928167da3b049d738888c59f28465c43e2399
MD5 14b95c41e20cb557f72da2fcb32b30ce
BLAKE2b-256 6d2df58e371631822e508647353a15a6edaec15dd78f8014b764c5b4f215b224

See more details on using hashes here.

File details

Details for the file deltachat-1.88.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for deltachat-1.88.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0db8ecfdd05b03f654b338372cf7557e25113259086c65ebfc1e313a233ee806
MD5 175a593994691f889222d7f7b4fc5e18
BLAKE2b-256 1eb54a1358ca65aa36fa1631215ccfe1deb5fae1c9261707e6b675779e046858

See more details on using hashes here.

File details

Details for the file deltachat-1.88.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for deltachat-1.88.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 23d13993087414dd670b7e086b7ce30c7f3923f2b521bfcd2d9030c90f119bbf
MD5 b196cf3965be2c6159b6780d866d3a1a
BLAKE2b-256 bf9f3d9bdaeb1d9b04f01498b43cec460c9b57fc4fb0d397ea0017c738239051

See more details on using hashes here.

File details

Details for the file deltachat-1.88.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for deltachat-1.88.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 67e1b11bc80cbc8fe2a9ca03f2e823d9844239f03d4e8250a95526539b6d6c4a
MD5 3c157c573f05858dc859c29b1e63464f
BLAKE2b-256 83f76edf3e2c2f9c10be515be16d6033ee807f4707db2f4bee6bb22b22d49fd2

See more details on using hashes here.

File details

Details for the file deltachat-1.88.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for deltachat-1.88.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5ed94f4a2fa7259ea0bd68f11abc494991b6b0bf5b5349ef3c6a056aebca4deb
MD5 6d17da919ffffeadfc507841bd312090
BLAKE2b-256 c2611d77d96908476f2f1659bb5eaffda6d804335ada35edcbc62bcb467881e6

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