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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.11macOS 15.0+ ARM64

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

Uploaded CPython 3.10manylinux: glibc 2.34+ ARM64

opendht-3.7.6-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.6-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: opendht-3.7.6-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.6-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 6e3ac77038b5fcad027ac1927f883b75e782fa96e5c8d561646ed9ee16a2bbde
MD5 7dac3510d04aa54378e9282387649285
BLAKE2b-256 4e81ff32ea5c6d95f7210c9d3365870ab6760ee7f670e22e4bdc6dbf2948efe2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.6-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 cc0a6f4199d70920389f4109ef7c48fd2d58903f93b39802ca08066afb8b29e9
MD5 bf5f48367b3c818efdacf090f19a47b0
BLAKE2b-256 55aefe6c96b6040fb4bb6e7329f0e446f60bdf6962af1339c68e43722bae18bc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.6-cp313-cp313-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 8bda9d2157402fb5bacad8d61948dbba685b122f6a2830eacabdb17beb70de16
MD5 68069b0c7b35f9cf7c365e7854e017af
BLAKE2b-256 85b7dbbfcf0475e516b1e1a6f4a33fd396e99456223012e87ffa6e281bc5131f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.6-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 ef5b1239001244c1127ab30635357df565205b81921adfe15e59fb246afc8d64
MD5 869c4446ad3761a3f93e8a0b36ec27c1
BLAKE2b-256 6da35d30c6c03ad7331b89ce9354a7ee0d48931e5ed7d690210e5659e3e61384

See more details on using hashes here.

File details

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

File metadata

  • Download URL: opendht-3.7.6-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.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6dc2b12d092461c01e63b24a64f1725e3d1dc9df32b1a43264af3c448e1e2b4b
MD5 06674295b6be9624136c29ab1a1c5f2a
BLAKE2b-256 ad95b1b06021f304ca9f3f5c4d44118c03ff4d8690b9ad20e44b6f21fcb8b636

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.6-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 1472119942dbd22fe739d455e91e3e00951ab33e5ead230c9f3bbdfa66401be2
MD5 d13a30992ea1c24959a3faf9aef34b83
BLAKE2b-256 33c0e46ac4f4e1fc257aa7fe2d1f5989c6c3e9f198a3860f5367298166b8b6e6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.6-cp312-cp312-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 d9820072059eb294dd5016afdf2f7898d897e3587d96a8f132e56bcf4e0b1296
MD5 5512af72bf7fcf3b8c0945db605504fb
BLAKE2b-256 3364e7a4dcb107e9c5425d62ddd183f338cce46f29ffcf349bce8d1ab22dcfed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.6-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 a13c48cc786d45e8bd1a5614d965f3101c077f1da3e1e818d90ce3ce2adbf2f0
MD5 575f72477b6d1c28e400288e3a73808b
BLAKE2b-256 f25778e82b191a5850f04c1790caf6eab5bc243cbfe7a14c4faebeff3955ae62

See more details on using hashes here.

File details

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

File metadata

  • Download URL: opendht-3.7.6-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.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6be0dce2c240ebeebbe55ba0052a0a5ec7534132acdec17b659e6d24079a6ac2
MD5 663724228b6a35352c75de0091a2e8f7
BLAKE2b-256 1e1defce3cc67981afce10b2afb53f5611d40a11ecfecd2ac6a80e5d185aa279

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.6-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 53e7903b8db694fa3f01e1e673310ef6a33518af5006e6e3fea87d830f1ce87d
MD5 2d0b11002e0111a88bd395496a3f4370
BLAKE2b-256 73005382946c4dac8b4dd63a0206904bbb20ef4e469342aa5b0ca3ccdf6fd0e8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.6-cp311-cp311-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 ad28259bd7d53a1c8ac150c3e213bbdfa4efe0eee67afeaa6136ef4f51ac4e4f
MD5 848ab7827d8a2441838e4aecb320b826
BLAKE2b-256 47a3776c0ac5ca55dc8ea3bfe7ead934782cbd5b4eae12cd7a88c0ac769ecbdc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.6-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 44a4a411bfd300b1f07a36b679e42826bc45599ca457ee9c4b8b5fa5e3c46284
MD5 63cac93598033238fd492f3170652e36
BLAKE2b-256 5bc9cd8a1057dc5dd16fc28c8fc13ba51a4af91f4f073b95f3bd048c622ec378

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.6-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d8ac175703477691e0140402e010c689e737e317249370156662990e8608f819
MD5 0f772f6179f00317a3cb0aca9b5a459e
BLAKE2b-256 1ddb3a620fc6093d17c724b97171e19ac3ef6c6c110d73e8c39131bccba56713

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.6-cp310-cp310-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 9964be4668bfd720c5ffd86ef3131ce75ab978cab939805877b3a4b285cdbba8
MD5 811eb66446690e9ec03dcf1a8b76a0bc
BLAKE2b-256 95dd9ae3150578d0b4be1e261e4d3898f950c71fa362010c2509d7b5544066e6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.6-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 3cd0d6368f0021d7b5d35dfc03b28a294bd0c7d03a4a4d73b553aee2a3e5b21e
MD5 fc5733058e069a858737e852ec1eff19
BLAKE2b-256 22f09ac1456828164dabb499354d681b2058d4756b829aaa72cd51ef333a8c41

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