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

Uploaded CPython 3.13Windows x86-64

opendht-3.7.1-cp313-cp313-manylinux_2_34_x86_64.whl (5.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.11macOS 15.0+ ARM64

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

Uploaded CPython 3.10manylinux: glibc 2.34+ ARM64

opendht-3.7.1-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.1-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: opendht-3.7.1-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.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 5f19c59c136389a05a631a34b713583f3a7978002fa3cde64724d5b6d4fbd477
MD5 dec565b28c6cfdbe11651422195105f1
BLAKE2b-256 8bc003a17a6104a0700760e020b96faf0a8498c1d240fa21d3ea8db7a6ea7b94

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.1-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 8465c9a86dbaab30333b4bc4b511d28dccba4388057960ffa4a11f20a8e4d3ca
MD5 24b3b1174517a64aa49f0d961ac137f1
BLAKE2b-256 bb858f1bffc009f015e1cdc6152433c2ca732308e007af022c708bc12ec0e700

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.1-cp313-cp313-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 f005233789d96b7a3f85f2b7bf1a037467d8cf102ccf9e200aaf8caf343b9f01
MD5 60dc631c39ccd4626a4f065e020e748d
BLAKE2b-256 8c5e16d081e9fae361de0b2365ee807b7dbd9e7c04fe0b29ecc6e67f7bb81937

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.1-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 3a5ac01f2ef1ce295293a8ede759532528ef1ce7e35b04683b7c0f72c6d82703
MD5 ebab8d90ef2e842edb7531c922efaa0d
BLAKE2b-256 92a091811e2164d422736fb6c028af131d4307a813381fcc51abfd21f52449e6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: opendht-3.7.1-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.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 de2b77a7a14a2ee3291d5e6c094ed5e9f5244456f4172351d0ede626f1808f9f
MD5 51bb17613d3f2c54be8c78fb8dcfb94d
BLAKE2b-256 7bf3dccbc09619b1bbe267e96def1d67ba78557505e140353ac14454195ba6e9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 af0f0a71b69d26d255147a111312c30fc3b7e41707d84b0838b65ebedec2fb33
MD5 916ede81b7429df288c6d8778be7fd16
BLAKE2b-256 b045050ab9dbed373ae4bf6cdb58d0fa4bb3cbb567506798e31b15993f46d99e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.1-cp312-cp312-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 cb27518f89095f612b3d87038602eacd94a2aaa9ea8ce9027765c7ae302b753b
MD5 0168efd66edc5f97d0702932db50faa1
BLAKE2b-256 fa88a78dafa9788f9bfca542084dae0bf20400d3080a3ee406e0766366863f98

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.1-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 1c51657068dae3c41cafebf1557797c74f0dd2635a01825eb21b1da06d4af161
MD5 657ba9102b65cfc081e759bedd1a4481
BLAKE2b-256 4a4a3740b7081fdf419a79bbd3a6bc5712d41174c3f0dc7e2384fd050bbe571a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: opendht-3.7.1-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.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 bf4e5cd00dcde5bf9fdedb31e67f33d2b3ef5bacb38ed8e5c9c283877feb02ba
MD5 8695c1d55c60888767081e334644d6c5
BLAKE2b-256 72ed621ac2ee3acd82c5cd457e7b0c70326ae238aec00cc4d0d35cd3f5afba15

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 2893f3a173cf268ee1300e92026b876582244426b5b41b5e3dd415e8cc0f91e0
MD5 a48ed3aa35fea36f9ae1ed4cea24b689
BLAKE2b-256 f566cbdb3e2087ad0c17f02385e82ef7dfb5a97a54c5b62ba1baca5f4cc7bb36

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.1-cp311-cp311-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 a988210b93fb0b925ad24a8b116bc3be5a6fc4a7d57aa4c8b0250dda3ec8a2cf
MD5 ce1661044ab20d6377a1a0c69628c14c
BLAKE2b-256 54312390134206c3f52b6ce2aa9ccf948ccd6efca7ab39f8e184148f4d076a34

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.1-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 4ef207b44bc655acd533b11240c19f40be832405112ec0630b5c8e504395c09c
MD5 eb4ccce289e78492c015249106792de1
BLAKE2b-256 93cf12eb542b4bf1f90f3d9fb734c2ee151f7f718022db6940f13548af748571

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.1-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 8e306dc787850eaf6f97d8759a75e18b0b0a7fd7a73647a044b8f4e3c6d66737
MD5 28555973a7a5a458409b3ddf4f28ecc4
BLAKE2b-256 d9b616f466c4769ee1c6afcc415084041a20ed2f250638bee22c337ed2253a16

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.1-cp310-cp310-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 8cca45bb5731df1d25da0055dba00e5d6cb663b42a7f811f49ab14d3828fb5e1
MD5 8df7764aa5fda2ad156b5c4caa212364
BLAKE2b-256 2740a40e02cf6b25e0140ffe57f6784ae8a723a4c99da432f86dc74c76f0b730

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.1-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 6916c40f6da0d5adec6bd65d778cd71deae3ce9a7ab523a3ac9f6ffd78291d8b
MD5 e6e916b9cde229eaa404759438d5a1df
BLAKE2b-256 2a502ce7ee99decb681ff27dc8897f6da1a43353d746bc8ef01460e32ca8958d

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