Skip to main content

OpenDHT: A lightweight Distributed Hash Table

Project description

OpenDHT

OpenDHT is a lightweight Distributed Hash Table implementation providing an easy to use distributed in-memory data store.

Key Features

  • Lightweight and scalable, designed for large networks and small devices
  • High resilience to network disruption
  • Public key cryptography layer providing optional data signature and encryption
  • IPv4 and IPv6 support
  • Python 3 bindings
  • REST API with optional HTTP client+server with push notification support

Every node in the network can read and write values to the store. Values are distributed over the network with redundancy.

Installation

Install on Linux, macOS and Windows with:

pip install opendht

Quick Example

Using the simple, blocking API:

import opendht as dht

node = dht.DhtRunner()
node.run()

# Join the DHT network through any running node,
# here using a known bootstrap node.
node.bootstrap("bootstrap.jami.net", "4222")

# blocking call (provide callback arguments to make the call non-blocking)
node.put(dht.InfoHash.get("unique_key"), dht.Value(b'some binary data'))

results = node.get(dht.InfoHash.get("unique_key"))
for value in results:
    print(value)

Or using asyncio:

import asyncio
import opendht.aio as dht

async def dht_async_demo(key_str: str):
    # Start a new node using an async context manager.
    # It is also possible to call run()/await shutdown() manually.
    async with dht.DhtRunner(
        bootstrap=(("bootstrap.jami.net", "4222"),)
    ) as node:
        # compute key hash
        key = dht.InfoHash.get(key_str)

        # put data, waiting for completion
        await node.put(key, dht.Value(b'tata data'))

        # get all values at key
        results = await node.getAll(key)
        for value in results:
            print(value)
        
        # same operation, but stream values as they come from the network
        with node.get(key) as results:
            async for value in results:
                print(value)

        # listen for change of values at key
        with node.listen(key) as values:
            async for value, expired in values:
                print(value)
                if value.data == b'tata data':
                    break

asyncio.run(dht_async_demo("unique_key"))

Documentation

For more information, examples and documentation, or to repport issues, visit: https://opendht.net

License

Copyright (c) 2014-2026 Savoir-faire Linux Inc.

OpenDHT is released under the MIT License. See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

opendht-3.7.2-cp313-cp313-win_amd64.whl (5.5 MB view details)

Uploaded CPython 3.13Windows x86-64

opendht-3.7.2-cp313-cp313-manylinux_2_34_x86_64.whl (5.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

opendht-3.7.2-cp313-cp313-manylinux_2_34_aarch64.whl (5.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ ARM64

opendht-3.7.2-cp313-cp313-macosx_15_0_arm64.whl (3.6 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

opendht-3.7.2-cp312-cp312-win_amd64.whl (5.5 MB view details)

Uploaded CPython 3.12Windows x86-64

opendht-3.7.2-cp312-cp312-manylinux_2_34_x86_64.whl (5.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

opendht-3.7.2-cp312-cp312-manylinux_2_34_aarch64.whl (5.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ ARM64

opendht-3.7.2-cp312-cp312-macosx_15_0_arm64.whl (3.6 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

opendht-3.7.2-cp311-cp311-win_amd64.whl (5.5 MB view details)

Uploaded CPython 3.11Windows x86-64

opendht-3.7.2-cp311-cp311-manylinux_2_34_x86_64.whl (5.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

opendht-3.7.2-cp311-cp311-manylinux_2_34_aarch64.whl (5.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ ARM64

opendht-3.7.2-cp311-cp311-macosx_15_0_arm64.whl (3.6 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

opendht-3.7.2-cp310-cp310-manylinux_2_34_x86_64.whl (5.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

opendht-3.7.2-cp310-cp310-manylinux_2_34_aarch64.whl (5.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ ARM64

opendht-3.7.2-cp39-cp39-manylinux_2_34_x86_64.whl (5.5 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

File details

Details for the file opendht-3.7.2-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: opendht-3.7.2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 5.5 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for opendht-3.7.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 cc5ed0244fc354f3f772397dd61fb9493c5e3163f816076f12b9aa7b17f76ac6
MD5 bf748904c4c8276c88677d85192267c2
BLAKE2b-256 029828d66bc24e6cd0ac4fc8333e4605913674ce128c0e7099aa488fab381a4d

See more details on using hashes here.

File details

Details for the file opendht-3.7.2-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for opendht-3.7.2-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 981512b3772810296d1e66d3c4f477019a629a18562feef9f04e4bd0e3be1273
MD5 81217fc4926c0a55ce732d1395de8006
BLAKE2b-256 e5cabb218c4be97b40769c326b2bc54652f97d514b75ceeea1bcb73dfeaead4e

See more details on using hashes here.

File details

Details for the file opendht-3.7.2-cp313-cp313-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for opendht-3.7.2-cp313-cp313-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 e0f072e0dc80f88470cc430ee3e486f1904e7643b895390814afc64820b0a79c
MD5 d90fdeae6475754c9e3401c293a5517d
BLAKE2b-256 872f74aca1002373bcd94879f428979054abcf359139ed2b7263f74d6ecbe7e3

See more details on using hashes here.

File details

Details for the file opendht-3.7.2-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for opendht-3.7.2-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 3104874c16f8de7eb889b53d998c64694edf499b6280faf431aa260d6f026d2f
MD5 6984bd896cba6ed22c4db575d692b8b3
BLAKE2b-256 8bbce63519d08cce43fc2b470b1e299d6cf495bb5f05015bde977790015c0b22

See more details on using hashes here.

File details

Details for the file opendht-3.7.2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: opendht-3.7.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 5.5 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for opendht-3.7.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 139df8f03d2ffeefbbde7d1b6480ebaf925fa7e9f006676a20279fb38f33f052
MD5 57fc7b24cde95d09ff28ac6bfe621a5a
BLAKE2b-256 e1ad7d71cb45b13371d00c82b540de183b36d97a26a55312d16369e5a8ed0c13

See more details on using hashes here.

File details

Details for the file opendht-3.7.2-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for opendht-3.7.2-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 3504a40409bab23d505f42e1c2517b25ac524f6e195d00ae4a9687440eb10683
MD5 22c1e3276b68cb84d9e2a8022016afba
BLAKE2b-256 5faf5179d9dfbcdea505816a287104689ca21b95f52040577118de2e263b2c76

See more details on using hashes here.

File details

Details for the file opendht-3.7.2-cp312-cp312-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for opendht-3.7.2-cp312-cp312-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 158274ecf7caf8159bd995bfc354017f402c99bdb424718188e904ed4cb89bb6
MD5 62d1d3a4d4c7e6465d9141e655c13386
BLAKE2b-256 9e43351ef6a3e18fc60ee606f91772ce289bef0f8bd27865254a3f8d72039117

See more details on using hashes here.

File details

Details for the file opendht-3.7.2-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for opendht-3.7.2-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 cca8d56a2f7fef67ca28449b2d2be27c79b1b5531510434d4561633ee1a9a03b
MD5 19851d3fa7ecf591fcd323a2f887f406
BLAKE2b-256 fd3e9445f9d39c45dfb94f5a314268f5971e4969df69b2dfa2a29595fd0cd5a6

See more details on using hashes here.

File details

Details for the file opendht-3.7.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: opendht-3.7.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 5.5 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for opendht-3.7.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d78c3c12e449d0221291f5e5e35af1349550aaf9b4ac66e6e4d8cca16fb004e0
MD5 ade2a81730deaae9e50e1ac5a00c3b62
BLAKE2b-256 c711a0a330c4c8e2021b75f0c6de4aebd4e4651444a77023418d4d8d14306529

See more details on using hashes here.

File details

Details for the file opendht-3.7.2-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for opendht-3.7.2-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 58fc9b856b7b6cffb8e62f4e1a0bc35cc313e030776ec6d76d42b43abdccff6e
MD5 0364b4ae21385cb713ea114914601491
BLAKE2b-256 0b04a08c1953f2294df4d6e5ba1a477942e51941fb11a6630ef2ae6c49c14e0d

See more details on using hashes here.

File details

Details for the file opendht-3.7.2-cp311-cp311-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for opendht-3.7.2-cp311-cp311-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 a74b00d31e0baee585a358e2e8cc6d21a5f184376a7d142fe91d6c72eb20ae72
MD5 c6fa977361a506bc4f98ee4677400a53
BLAKE2b-256 f51f4e81a1ccb29cee3c38613b8982e9a67ca4787b7eac46f0df674a1028feba

See more details on using hashes here.

File details

Details for the file opendht-3.7.2-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for opendht-3.7.2-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 1beb92f72a3295dc1456b5c754392d20547e3a4e1a759f421a9305f99ea3104c
MD5 25481cf07e0700bb973d3eb409b1ff48
BLAKE2b-256 6ea9b6534b1f5e5dc00df23a1f9937b6fc2f9e6e602df48ce9c03c6dfa8bd2eb

See more details on using hashes here.

File details

Details for the file opendht-3.7.2-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for opendht-3.7.2-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 6315b0d474d0edbab9346c691a54814db0c985123b1ec990a0a1f3866c43ac4d
MD5 d36a38f3120e6caef9fc6aa1117ec391
BLAKE2b-256 1f2ba7fd003dc783088170547570a463e4f8d58c68f4290165875c205a527fdc

See more details on using hashes here.

File details

Details for the file opendht-3.7.2-cp310-cp310-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for opendht-3.7.2-cp310-cp310-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 3c54f97522d11606a768a157f056877c7089a436efc8254d9d3b97a29cff78c5
MD5 6b8c47708a82e6b0723b5cc12ee4cde8
BLAKE2b-256 c8cd862e1c713faa93d6dd23770c726ae5b74c4d06bb22f7474251e4f8da4d69

See more details on using hashes here.

File details

Details for the file opendht-3.7.2-cp39-cp39-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for opendht-3.7.2-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 14901f7fdc52ff284876ef92bd2a38d319e78649638d7c6dd43c169c4b1700e0
MD5 fa8808f98497938c5bd867f3e7c1735b
BLAKE2b-256 6bdd6b4f672f5ac54ab990e523bebbf1bcbb8df7c0084212e1aa3c98dc1694b9

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