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.118.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eaa050d644c2c27e1e5a143706a617de83da161c36e60479b88e82ec7956361d |
|
MD5 | d2ee3784c1d5fde5d3225ae4dc9795ec |
|
BLAKE2b-256 | 29a8396c91dda9e5fd83dabfd6b330fc25503d36e0586a0a67743f1265a7fcca |
Hashes for deltachat-1.118.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 521434c816d9b23374cfd11b75ed5a55cf3f558a078637007a09a97c9ccbfc86 |
|
MD5 | 6f886c22ab431f620b9cb5e4f72bd242 |
|
BLAKE2b-256 | 332915712264e4dc60109527308d08156ef7d5ccb23a584c08efb7c8188d38da |
Hashes for deltachat-1.118.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0fe143c639b3bf9349334bbd4f00f89cbb723cad9091e066e3e06a48fc7a110 |
|
MD5 | ab6b654d30e4d60fb0586cacaba41250 |
|
BLAKE2b-256 | d1ad6fb47b82679ad597859308265d9ced574f71fed98e4f78cdd9fb099a2031 |
Hashes for deltachat-1.118.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05155b473f2f4d998bb6c50be16ac65a2168a1fdfa1ae033c6171f9e97530a11 |
|
MD5 | 8642dee430df7a3adbd00274f11396c9 |
|
BLAKE2b-256 | d93cbf5dc03d603a452a4c410de3618eb6aba2a058975301b9ef0dd83e804842 |
Hashes for deltachat-1.118.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e8e8622821b72ea34b12ca7f8ae270d0eb481b31fdd05f10d64e89221cc911a |
|
MD5 | 9d274e81ed1508c4d95381d9243aaab0 |
|
BLAKE2b-256 | e8c1652a4c9dddd40452d75c86b86d4baa9a9ca0709ee879591a9a30ae9e2fde |
Hashes for deltachat-1.118.0-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e923820766ab34c4a1fffdf89b9ee3ff48c6ae406e00257bbd1a5680d09d932 |
|
MD5 | 095a34d829346b8ff1fe2a165b2143a2 |
|
BLAKE2b-256 | 3113938ac83b19b8232eba32ea760d0f84477e68acf4a5be4b14fcea6b825c96 |
Hashes for deltachat-1.118.0-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbfad81308f2cdd51bac0e6678a7dae799444a7ec035df9b5d798d58ccfaaf0d |
|
MD5 | e78dee9e8214dd6fff2c1d216d3e57b6 |
|
BLAKE2b-256 | bcf14f68893a25f46573742a7f4b997a098dd3ca3fada2c4877b073a46891042 |
Hashes for deltachat-1.118.0-cp311-cp311-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c647663b639aae4cdc95ee4062104fefd35dbb5267f1b56f8a18e9a011c54783 |
|
MD5 | 360896d01eff85765febc764abbba5ec |
|
BLAKE2b-256 | 408c8ac2573f632ba44870f90b2d0de58df98f9e84cc37e7de88dcf648d1a510 |
Hashes for deltachat-1.118.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e8451195fd1ec65ecf6a4a25067752abe837e5828169ea82aea6b52d852350f |
|
MD5 | 3c8be07f4bf96817d70d82c62e33ae86 |
|
BLAKE2b-256 | ae13486dbe56d5ae9b313d57685186231e88ddcfb2ef92bb11e0e9f06ac6b11a |
Hashes for deltachat-1.118.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e606b4a8f9198a4ed423f84280de1bd16270ac7fd2f6b8b449132d4e3873fe4 |
|
MD5 | 2045909ffc1a17dd71bdabd4be07a530 |
|
BLAKE2b-256 | b237e9d51d352276a45d72262ae3d68cc48a231d77b91b6615dff166e49c8948 |
Hashes for deltachat-1.118.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b9c1a10e9bfc365aa75c2c5bb304cc64cb75f6d875b14208ba13a74a2aa43ba |
|
MD5 | d9160ad27288add1a802a6d03c6b736d |
|
BLAKE2b-256 | 2ce58653805162b44dca372eaa4383f32ad860a894d10c2032922195381e67aa |
Hashes for deltachat-1.118.0-cp310-cp310-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f1a576c9551c875635d8cae4291c7f1f48f71cef98920bc2fcd98047aec8877 |
|
MD5 | 1cb6bb2c038e6db36f6cee0a42c7c032 |
|
BLAKE2b-256 | c27d34bef4b935153d454ecb72d0d4b272ed166a16420502eb873e6acb67f003 |
Hashes for deltachat-1.118.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb09f368283059d4d4be734179fd33abc49218a70c21fdabe02badaaa4b8d7e7 |
|
MD5 | 439ff3c701849202eceb78177a3ec176 |
|
BLAKE2b-256 | 5b34a255119e4803becbede7a69a4d7e1beab66f5fe6243fad066648c6817e93 |
Hashes for deltachat-1.118.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9dfa5a6348817bb8f475e46f117735b031f757e23fb9256705058c5998566fff |
|
MD5 | 4be3c15ec56b4d1a7942137a0ba46bf1 |
|
BLAKE2b-256 | f5e95cb84797fc8fc0ede783cef85aea1ce1a66ee0675597d3958229fc249b4a |
Hashes for deltachat-1.118.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb08a55f3f564a3f8a7ecd3c991f254585af1c7de87b22bd705ce88261eed565 |
|
MD5 | d25b3ca6f354f57216c30aca8083d675 |
|
BLAKE2b-256 | 13fa6db33b4c2905da2274020beb527c23d8d339fe076adc0349b5e18bc2a8fe |
Hashes for deltachat-1.118.0-cp39-cp39-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31b98e1788fc78916661fb70422c35d332f6815483d30eb40613de124f0ba99d |
|
MD5 | 9296d12737da18c3eaeda2d3085b69a9 |
|
BLAKE2b-256 | a20f893113449ad6483e3913f1547994dabd2481af94e0811842c7984bd7871e |
Hashes for deltachat-1.118.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e99c3cff51658571703f0b345c63bdaf96a8b490442fcc40891e9c961c0e0d13 |
|
MD5 | 2a0f48b263fcedbd943c34800e7b5328 |
|
BLAKE2b-256 | b70369888430708707777c0251e554a8183e5870863c9ea3501d05111ed489d4 |
Hashes for deltachat-1.118.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3ff805f351a6782a70fb993eb9845fd182f07d2aa1bdec9fd4abf391f95d88c |
|
MD5 | 1b12fcdc793db2c296591eff50135297 |
|
BLAKE2b-256 | bd169429e6149ffce8288a19994988afe50d43577f0612b6297518e2a537c65e |
Hashes for deltachat-1.118.0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ab68ccfa84fca51358b524faf5e8fe3c0479307d3d3c909b2ce20bf0ca6ed6f |
|
MD5 | 9c9579621220eb992491cf531e47d20c |
|
BLAKE2b-256 | bcb2848b835658271a9940087232cd9f49fb8a2e3dc3e37c41c23ae5b1bd194e |
Hashes for deltachat-1.118.0-cp38-cp38-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 230e2dc5841b4431471c0e83f170ac44580c864a600ab5b3f8e57439a3df49d1 |
|
MD5 | 263c69bd7756463211442c3cceb97977 |
|
BLAKE2b-256 | 79043fb1845c97679fbe0c0df039adc2899b1184a1638e1e799ea03ef04566cc |
Hashes for deltachat-1.118.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b963111e1be099e5beaacf73eec856e062c5d57cec3a0f8a7878a693969c938b |
|
MD5 | d7d768bf5c828da4a21ac40646d99a59 |
|
BLAKE2b-256 | c8b1d1c7715210ec3837c491a8ca53139497287bcb177df9605e7a1c0440f4ec |
Hashes for deltachat-1.118.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a0d30cde1d1c15470f74abd9fad41f58bca92ad81e047caeb4fe9b33981306b |
|
MD5 | eb90245ca62d4cca21d50c06df5b16ef |
|
BLAKE2b-256 | d9dfd8dd92c8579b27744e13ad1fcc9e7cb1237be274a2bb2ab6ee137e7db122 |
Hashes for deltachat-1.118.0-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8e8665863e68f53be9690faad9b090d531b9202a4f2f1b6fb807a15f63f7ee2 |
|
MD5 | 44d161ab7509a4fe18aa1a908cf7e231 |
|
BLAKE2b-256 | 2578f57a99e6df1406ab75e2af2db29c86943c5246567936665ac8d093ace408 |
Hashes for deltachat-1.118.0-cp37-cp37m-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9894db769555a7c7a46a04e4bfc254e1ca71d14a817113868a7067ca3e059793 |
|
MD5 | 460b337ea6d63c315c45ada270dbd494 |
|
BLAKE2b-256 | bb67c8174645b9674377a62490975b685827ed50d5a6c2cdea419af40f60cbb6 |
Hashes for deltachat-1.118.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01a99538beb4d44b907ffcc57364e9039428168a3140ff74f80982bb4372908f |
|
MD5 | fa567092d2323ea5d0fed1dd2d8825ca |
|
BLAKE2b-256 | 9413782f7e523c51f45c2050978cd566627b59242cee395dde7199276fc65340 |
Hashes for deltachat-1.118.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 920648deb1970f2fce771e002c00194eae8174a95ecfe037b25c8ffc25a8025f |
|
MD5 | 08b154c0d9656af0f1d9e38105b5c313 |
|
BLAKE2b-256 | 2daca10f12eba339a56f2a5e7283a7f4d1fb62a0388d8fcddc220fc0a35e02df |