Python bindings for the Delta Chat Core library using CFFI against the Rust-implemented libdeltachat
Project description
This package provides Python bindings to the deltachat-core library which implements IMAP/SMTP/MIME/OpenPGP 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 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 create a fresh Python virtual environment and activate it in your shell:
python -m venv env source env/bin/activate
Afterwards, invoking python or pip install only modifies files in your env directory and leaves your system installation alone.
For Linux we build wheels for all releases and push them to a python package index. To install the latest release:
pip install deltachat
To verify it worked:
python -c "import deltachat"
Running tests
Recommended way to run tests is using scripts/run-python-test.sh script provided in the core repository.
This script compiles the library in debug mode and runs the tests using tox. By default it 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.
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 are removed automatically as they expire. After setting the variable, either rerun scripts/run-python-test.sh or run offline and online tests with tox directly:
tox -e py
Each test run creates new accounts.
Developing the bindings
If you want to develop or debug the bindings, you can create a testing development environment using tox:
export DCC_RS_DEV="$PWD" export DCC_RS_TARGET=debug tox -c python --devenv env -e py . env/bin/activate
Inside this environment the bindings are installed in editable mode (as if installed with python -m pip install -e) together with the testing dependencies like pytest and its plugins.
You can then edit the source code in the development tree and quickly run pytest manually without waiting for tox to recreating the virtual environment each time.
Installing bindings from source
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.
First, build the core library:
cargo build --release -p deltachat_ffi --features jsonrpc
jsonrpc feature is required even if not used by the bindings because deltachat.h includes JSON-RPC functions unconditionally.
Create the virtual environment and activate it:
python -m venv env source env/bin/activate
Build and install the bindings:
export DCC_RS_DEV=”$PWD” export DCC_RS_TARGET=release python -m pip install ./python
DCC_RS_DEV environment variable specifies the location of the core development tree. If this variable is not set, libdeltachat library and deltachat.h header are expected to be installed system-wide.
When DCC_RS_DEV is set, DCC_RS_TARGET specifies the build profile name to look up the artifacts in the target directory. In this case setting it can be skipped because DCC_RS_TARGET=release is the default.
Building manylinux based wheels
Building portable manylinux wheels which come with libdeltachat.so can be done with Docker or Podman.
If you want to build your own wheels, build container image first:
$ cd deltachat-core-rust # cd to deltachat-core-rust working tree $ docker build -t deltachat/coredeps scripts/coredeps
This will use the scripts/coredeps/Dockerfile to build container image called deltachat/coredeps. You can afterwards find it with:
$ docker images
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for deltachat-1.120.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc984b5cac84c0643ad6073e82827a5765f041b1e00183b69ce42d267e948187 |
|
MD5 | 978a591b15d4615c5493b1221f71d6b6 |
|
BLAKE2b-256 | 451ccc15c7e664c8355cee96f23eb6d8e2669dda01941f60893ccb6488fb8f74 |
Hashes for deltachat-1.120.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a44bd07788c4ed31ff038a6d93f9da4fc454a407626f12d3795d40151976045 |
|
MD5 | e6a7ee58a36de470671e34e099bc2ef7 |
|
BLAKE2b-256 | c753cabb29f2ae79c1c62387c1185c41387047112859cb5089ba2e9f65dc75af |
Hashes for deltachat-1.120.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 100709eccabd84b6b6b586e6c95c5902a0c7bee13480c8a84b07d5908cca26a1 |
|
MD5 | 285f1b8a6f605517fda3a3fb8496ef9d |
|
BLAKE2b-256 | 0e8eecae0a76709a6b0eb59e54a1243585f08fdb76df747703e3c5f6d63c8087 |
Hashes for deltachat-1.120.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4d38cd7108153700bd77a422acd9bf670cb079651a02f25fb44d43b675dc301 |
|
MD5 | 0965ffb111df19b4a82ff4292b6c2b66 |
|
BLAKE2b-256 | d59d1e4d087c28d0e43a56a4f44e3b81e35db452dd604fb80704cfc493dacd4a |
Hashes for deltachat-1.120.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 770b7ce159b16be3e6c93083422e1af02a83e1eed15e3f75f8ef39e6198a1bd5 |
|
MD5 | a196bf1e9dda2ce756332443e4db7a32 |
|
BLAKE2b-256 | c27b109c9f62470fb44581be650ba32913e66dd70661d816bb8fb1dffdbbd1a2 |
Hashes for deltachat-1.120.0-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f99c8aff10c1f88e0f67d07c5ebfdcc52a64a3bfd3f525c517fbbbcefe23587 |
|
MD5 | 6a43a9bc44e6e8a373f60c17cf7d3573 |
|
BLAKE2b-256 | eadfdc7eac3035813f3bf3fbfec0b5618847de6fe12bbe6fd08cc842d7bd0f1c |
Hashes for deltachat-1.120.0-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93f9a02dc5868344c2104eece9f3540a9b597e3988ffb1aa8adad5ef78299233 |
|
MD5 | 615942a16064ab650fb4550106c5f48b |
|
BLAKE2b-256 | 7fc89d4a22c4b6a6d571bd6ededbbeda3819343d7b6504e1a6cb348a40fc53c6 |
Hashes for deltachat-1.120.0-cp311-cp311-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 837fc85093b648d0f0ac4e4f3df43a5e7e1584388ba6f971b9bf9471010f00e2 |
|
MD5 | fd8b63073277a8e3809c35459f27830c |
|
BLAKE2b-256 | b62f5fa1f24b40c921008a53a34c210e59d8524ad51946e0e2bba9f4bbbf2cce |
Hashes for deltachat-1.120.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73c71fb7bd37ff10ba8af7cf61d43478ca898f122b0242be7f3f6aefa3e41c42 |
|
MD5 | 5225af3acb77db9ba5adfacd3264917f |
|
BLAKE2b-256 | 71886f692d1b1acbf434999c381864e4094548b83327462d7cff837914ce89ef |
Hashes for deltachat-1.120.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1843cf36efc3a120c7cfd3e13d8466da43b27c046c12baaab35af4bd1e00d752 |
|
MD5 | 4f0a873399503985a636d5169ec0b837 |
|
BLAKE2b-256 | 5450a9bb2e82936a5c443ace935a93058fd2bfca3697ebb103a81b9ac2d19b61 |
Hashes for deltachat-1.120.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8cd882c4131593945aa0598d5811d11a0e67fc290dddebb1fa493ef0d7c7301 |
|
MD5 | 442c68135ff079bacbeb8e7a3a199e81 |
|
BLAKE2b-256 | e2edf0337830f9e7e3ad183cb8ec98aa24eb179785aac14096f7d15d029df80e |
Hashes for deltachat-1.120.0-cp310-cp310-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2babde104af9bc0e7a12d9435c88c526d6cb15c77323ff213508a9db46a0e197 |
|
MD5 | ad1dff3f68225222f836420736bc7e6c |
|
BLAKE2b-256 | 519d45c13dbcfacca915168427655a79f235b3108e10903161e157eff654ec13 |
Hashes for deltachat-1.120.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6a1abf79a18ac9c2634abf6e890e2f1628825ec8df114dd94739fe6236c9d3d |
|
MD5 | 14d365ebc078255fb8c600dd1daa67ff |
|
BLAKE2b-256 | d3dd0781007fe37e0e682f09a86820a7957cb89212251e73dbbe7353edadbcdd |
Hashes for deltachat-1.120.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bff302613e5e763106dab6d63666499373299c3c46799e1d78707b201150db7f |
|
MD5 | 748d3d344f00b35daa2d902d20eeb097 |
|
BLAKE2b-256 | bed6b82af16df62761e3408c317e0ffe36b67185a7506959edfdd0a7838fe167 |
Hashes for deltachat-1.120.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f7665cf8c0b8c71f3af7d4d6fa4eceefab5668607fbf748e26a40667513ff6b |
|
MD5 | b41f726846a30310e402fce7b74c9bb0 |
|
BLAKE2b-256 | b9089908518ced3dd5b4de53a70c2b277d9514a9762630ddcda041e182e24f0d |
Hashes for deltachat-1.120.0-cp39-cp39-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d929613754257c5aaa7292e27f5446555e065660424619573146bce664761527 |
|
MD5 | 7c90b3d0f806017127a61d084e52b175 |
|
BLAKE2b-256 | cc38c1ed95b43f1665bfc91ffffdb3b23ce378f04b7f99a89fcae8d439dbd9e6 |
Hashes for deltachat-1.120.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6002c276595943f381dc57dfde253b0fcf3d5265b68ab6001ca4e71c095b1a4b |
|
MD5 | aebb7c86f4c85388ae0ad1a9982394a9 |
|
BLAKE2b-256 | 66fc8e07968a93fc0fec0c42c96791e2748c8719e6c0b92be701b8f3fc569bc3 |
Hashes for deltachat-1.120.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64692aaa0ec81c106a07098e8175bfe476777e7773109a430c385470efc47123 |
|
MD5 | a141a5084bd2c2bded356b5ca8d3743d |
|
BLAKE2b-256 | df1657acb44ad18d73fdd8ecf548c10ca412d5e7a9b76da212f51fe00ab8b066 |
Hashes for deltachat-1.120.0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2adc72e38ca3eb9a8fef8807c93670dc21dba5f545733faf68ac6812ad9e8ec |
|
MD5 | 5b541b69b3905ef1a0cb958ba9edfb56 |
|
BLAKE2b-256 | 0459fb6f6c3accc20c0209666e26f91de2cb3a1533cb753ef6d0c926156a0c5d |
Hashes for deltachat-1.120.0-cp38-cp38-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1940e5adc039ce7de6ced7b334392da324460b90cc81606451474eabaa01e87c |
|
MD5 | c49068df3414c10bf335420be4e6e68b |
|
BLAKE2b-256 | 396b81a39e00135f5e6c74c00cccf655fba65bc771e4212a9afaf7fe7b5085dd |
Hashes for deltachat-1.120.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9a038fffad5e0f15f2d3bff6fd69b38b3fbaf34da65db52be6ce430eb308d9f |
|
MD5 | 3bae9b6f62473427eddee8b469272ffa |
|
BLAKE2b-256 | ee08ad426e7164fd0d61035859902b1bbb5f722cc82621a032c0e3bca6d059b4 |
Hashes for deltachat-1.120.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24e06b11a225d3b428a6863170ca39734a8a8162cd1b83b83cd00b6726ccea10 |
|
MD5 | eacd0f2a46e156eee937cefa3c9291eb |
|
BLAKE2b-256 | d195d503b6f38eda6519672aa90bb24265ecd893e44a6e2b597cae06d2c953d4 |
Hashes for deltachat-1.120.0-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 957236d644f4bdeec2b730da2d9c8a262444d7c9b6adaae26c105470f4645294 |
|
MD5 | 1739e9b04258e59a2f8d214bd67f57f3 |
|
BLAKE2b-256 | 680f228595cd3271de2ba67e8a7babc4182dfdcf48607cd2a6e9a11a3e0d5dde |
Hashes for deltachat-1.120.0-cp37-cp37m-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f67b219f66f8a2c4b3662fe5ffd82a5a0625b8048cfb0c341a4ba07d8d36e38c |
|
MD5 | 059842334ceb39b6fd6888fbbda166fa |
|
BLAKE2b-256 | d38e27965ac126dc1cba3057b0f7b848c5c092bebb172749ada6a5efe525799a |
Hashes for deltachat-1.120.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3f7a35a4b9d223ae32ebc7d5772488d61ed270f7a1a1d5dae5a8c66ed275c3f |
|
MD5 | 6710a866b76238172d3ae0208e77b84e |
|
BLAKE2b-256 | 1f5d1d16ecd6a20fdef47d2dafa32274fc39ef6ffa1830dc9ed1e721841a32be |
Hashes for deltachat-1.120.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a2b2661b9b1a56687d77f43a04c5e6b594edc7be5d4c1edd53336edafd7d607 |
|
MD5 | d6b0d0dd71b42035e8ab56764cfd88d3 |
|
BLAKE2b-256 | 6f36dedea0a9ca273aca56531497b185a59bc3283079a0268a469ca2e0861a47 |