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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.13macOS 15.0+ ARM64

opendht-3.7.0-cp312-cp312-win_amd64.whl (5.4 MB view details)

Uploaded CPython 3.12Windows x86-64

opendht-3.7.0-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.0-cp312-cp312-manylinux_2_34_aarch64.whl (5.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

opendht-3.7.0-cp311-cp311-win_amd64.whl (5.4 MB view details)

Uploaded CPython 3.11Windows x86-64

opendht-3.7.0-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.0-cp311-cp311-manylinux_2_34_aarch64.whl (5.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.11macOS 15.0+ ARM64

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

Uploaded CPython 3.10manylinux: glibc 2.34+ ARM64

opendht-3.7.0-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.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: opendht-3.7.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 5.4 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.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 580244aa920e92eb1a8b90431c8d163df35920d75741d5bcc35511a393ad9c0e
MD5 a8fe0e1b990d3dd96d6ae7a8087386a7
BLAKE2b-256 ac80ec2d224142cf56a938835e5d53f25cd4c66d45b22f4ea573e42ef1caa029

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 327d61c1820e82fbc8df42796221ebf5aeeb7a8d113dbc5cc45bbda209506695
MD5 0b58c10183ab9a93c89d5419f6c93dd3
BLAKE2b-256 050d183552cb930d74219fd8df9679a0bc0543197dd5cdbb584fddca8944d046

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.0-cp313-cp313-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 a3194d85725d3216953d4534dc92a7102b5f6c2fed242b48c6630408e736a505
MD5 c45cbc1fd3c0b34bf507a319c594c1df
BLAKE2b-256 7358b577a9b2c26acaac917bd4b4eaef5d0bd4f8e238e003a4c3cb123a68947a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.0-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 6ffca340e0b6d3eb7bd2d76a1509969c5651be98a14ad06708979ba0bf50205b
MD5 baf96da64f087d6cff53d6e8a145cab9
BLAKE2b-256 030996682fb370369adb681a4624ab8b02b51f6a81163757e7ecba4ae487dc9e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: opendht-3.7.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 5.4 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.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 4ff76f47276a82a72d952f90b9473a6892c4ad05c17c553c3f50285db812f03f
MD5 3fd090d4f64829e8b3cdd669fa3b96ed
BLAKE2b-256 f603ada214c67d1eff57f860a332e4136a06ed0d93b4f0bbc0c382d21df964fb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 95c56a68106fdbf2c295aa207386314f37069343ea7f4bd48804445fa745c27c
MD5 256a82beb0c2c5b5183340ad5b7c68ad
BLAKE2b-256 bf993f9b39012415be3cafc06042173cd90d7196a12a07c3466cf0ec2292a4b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.0-cp312-cp312-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 9901ce2977fa8fbc7451fce88650ae44ba4e5bbfbb565f05c0f6e7e1dcfc72dc
MD5 4d0fec4d299c15524639d8078d2098f8
BLAKE2b-256 19bcf04a3fbb19937cc6d59145b4d216efca5d68800a856a32a15db1f1873758

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.0-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 fb4a66bc3855b72593b592816afb218cc824a2eeb20d14973c3233ed7facfd8c
MD5 d57f81d9665c615e8f57571d75c85ee2
BLAKE2b-256 af243bfabcd1b569803c4de8f8f57472ed9dfdca70ac2f04b2871c5a3108e88c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: opendht-3.7.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 5.4 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.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ddd55f5366930c25d68fc4c65cba4ce39a67dd2b7d816380bbdd77d278caff02
MD5 6fbd6f5f2ec57aeb85b74a6178739213
BLAKE2b-256 68dd18238f22b10d754c0ee924a0f9271d4f2073c9f0182e12fef4d4c8e7c991

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 72b16b6d836283cd76b98f51e351d60b555d01a0f8469961d0e14e0e26495892
MD5 fb65e2b5140fd9df6573e8ad6d5c3229
BLAKE2b-256 34c584510543f53ade12ad979934644eb14700da29b0167b689f678adc158606

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.0-cp311-cp311-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 fa0f7f00065e258ac13bedcd0985a2f3959a99940f1b3c9f7af9e140d030ffda
MD5 22a49622a7f00033a75b6b6d91b02866
BLAKE2b-256 35b095efe0144fa26c6101b7df990d1a741058ceb6c97ad0e259ba2f3a364383

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.0-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 2e8a7cb770e48798c7cabb0f6509bfc1b29ff44b71dc60444786e71d2b1e8328
MD5 9bff2a4edcd1ff00bc36872b38e8da05
BLAKE2b-256 d338f155506d62472cc3359c03ca3beaceb13c6f209fd04c0756ab16b50e0cfa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 aa592c31f8548cfd1b35c37ce741ee6e5905f1d66e3f2c6da52d7ab4a1497ac6
MD5 2dedb122191110061ae193131d3f524c
BLAKE2b-256 20b7bf416544f0d676c10d316a5493fb32d84af9113ef6fee37dc789b5919cbc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.0-cp310-cp310-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 6e32ab916774079930400b883e78a5154e687caf36035b44d72fba85b692a664
MD5 ca71d05e0e1fe975a168b6eacf0dcf06
BLAKE2b-256 622b6b6916f75da0ea572be997e53ecb387502b0b1d483bb2c202f13a216b84c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.0-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 edcee20885e8499a4d844c83b179ef69dfa61042662186cd657e8d23bf55308e
MD5 c993bfd4b85e8cca1c356900fcdb1aab
BLAKE2b-256 aed405529fb3c67526671db7087f2afabd12a02003329fe2d27fbf1a5f2d5de9

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