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.8-cp313-cp313-win_amd64.whl (5.5 MB view details)

Uploaded CPython 3.13Windows x86-64

opendht-3.7.8-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.8-cp313-cp313-manylinux_2_34_aarch64.whl (5.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

opendht-3.7.8-cp312-cp312-manylinux_2_34_x86_64.whl (5.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

opendht-3.7.8-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.8-cp311-cp311-manylinux_2_34_aarch64.whl (5.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.11macOS 15.0+ ARM64

opendht-3.7.8-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.8-cp310-cp310-manylinux_2_34_aarch64.whl (5.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ ARM64

opendht-3.7.8-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.8-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: opendht-3.7.8-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.8-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 6f2a728731b22fe94839e9d0d7c7c79472edb4aaf538cb2e83ecec3faebb61f5
MD5 5b94cc9bdf3c4fcebe486f714be06db0
BLAKE2b-256 1d07d5702746ce78c66066b455020f1b32c7967e08994117bedb054c26c5271c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.8-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 676805ae937157301a95a38f55f6126621121c3c0e7e96bc298a226ffdc8bf39
MD5 34f36260d5ae4619f089ee0af97bbe0b
BLAKE2b-256 4bbb89a7e5187c0525deccb029823f28320362befbfd3a52745e7e6bc0af994b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.8-cp313-cp313-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 965de58b4abe95e98a3046c8005d954dce654061b51bbe0b83580ebd80b5fac4
MD5 ba5d2267290639cb7bd73b151d758880
BLAKE2b-256 1e4c6045ecc3820667a7233eb68aac2422ecc8e4ee7a4bfe05baafddf64e0066

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.8-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 1649748e68f7f4d79d2321ab214626ea03c123d6c958844112839ac90e7f68d1
MD5 9469d0cbc43c2aa24e60a0326ba5deee
BLAKE2b-256 2800071c523ff8f17dbfdc61f36505ef9f9f99083c210fdf8c181fceccfd4e37

See more details on using hashes here.

File details

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

File metadata

  • Download URL: opendht-3.7.8-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.8-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 2be13565ae1c2cdd5edd4fd1c74a607136cf645baaf428b6a0d2981008936c44
MD5 7500a97b43541b208549f3315f6caa0e
BLAKE2b-256 c8ef48f758d50afe3276c2a24aebdc5c85ceaaa90e82191c38165627707fce7a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.8-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 5441920bb0eabf53edbf75e61cbb868181184ad6a9434f9f5bed447500588f82
MD5 5097782f648003ebd8363e0e08c24f0f
BLAKE2b-256 7c8e43380d1f55fe2c11ed7f896dad344202c8ea08c6cc66ae6c4a8547c89dd7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.8-cp312-cp312-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 975d89a5d617f4f036adf3b0d1a258b279c0e2e6e6836f0d0fb9035c1814f953
MD5 52781efb35434c3cdb5b53abc7f5eb89
BLAKE2b-256 ae313a44521b63acf002f9e1a912f6b279cf09bfd4b3c7c20f5501d3f119209c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.8-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 48fbfbf59662154625388aaa28992fa66f233f496283a6de2b2ed85feab10a18
MD5 6b360ef25362c58e01de7856d34c228b
BLAKE2b-256 6caab118fb56fab6f64fc56961d86a0b7e581fe7733becb04254bcc689022047

See more details on using hashes here.

File details

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

File metadata

  • Download URL: opendht-3.7.8-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.8-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 19326ffb7997485bf222b32bd12c144bdd0be8a62fd5d7fe12b9d53c23d8fbf5
MD5 c03683e0d7967772d488ffedc7c93aed
BLAKE2b-256 2671c69c4e707b95507c44fe49b32756a9082faf8e7ceeffbf115216ac39fa84

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.8-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 252a92006d9e609c6d7bd33379baed7045afb735ff579add69a3cdf0435dc9e1
MD5 16080619b39628cfc76694128dd44f89
BLAKE2b-256 bd71bb5b5d21fe6f85d263d7b99bddd89da0056601e6f736aca68f4840b15689

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.8-cp311-cp311-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 5b76e33b4d866f3fdc68e90cef3d1ff6cad6d105bb388b502fbc17ad3966a976
MD5 4e4214068da861ffc86d8a930ac7d652
BLAKE2b-256 b3be81d77afe6c8fc987e11130d6d10fe62f8c4e84776e15063ad55f053394af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.8-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 1beeb86be625568b0ec8655f4da79ebfcfea120f2434987693ed3ae91c699d4b
MD5 f90dfe5b31bc3fb38a5ce11f5d8778fa
BLAKE2b-256 9049d5c78d44e9235328296857ccd72a9bc408411373df3839a805f8615a219a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.8-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d074c1ceac2ed13c5d82bbe5fa3fca11323f0a201685933b630c298581a7dcde
MD5 e3da678a285cb88cf485562bbb97a6c4
BLAKE2b-256 afb7bd4a1a9f5ad8548b92859fda42b9fe40c5fe3468ffae7f095101ab6c3a85

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.8-cp310-cp310-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 fc91be6f25a10e759073046f60c2e6a50e98a5cd3375751e5f70939ef037e3ac
MD5 5074606e0cb7f4a0b4ba4d80b5a52c68
BLAKE2b-256 ca06cd449e880425911fceb1ab940e6b59acd897015d8ac0bdb34f2965632d9f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.8-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 0b6104cb557ca408d288a176474b7ca49fec42ff256924d3667f066374ce1a04
MD5 9fd414dc9654687c5dfb22f2aabd5fff
BLAKE2b-256 6449f2c9d04c341fbfc1fef0e7711aac8fe14d4f8621b03e3e999f6b16888a21

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