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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.11macOS 15.0+ ARM64

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

Uploaded CPython 3.10manylinux: glibc 2.34+ ARM64

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

File metadata

  • Download URL: opendht-3.7.7-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.7-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 1f78cd065edb7f19719166c3938d8ee747e953a80a343bd250b3567fad3e8b7d
MD5 3dddd9a670876d3cc7022a655659755f
BLAKE2b-256 19c85ac92d284f522d146477d677ef08b192908838ab719108c7ec2c35dd40d8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.7-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f857fafddccaa70fbf7d9ca2024af272d565f01c9d00ea001a13025b7561f383
MD5 e91bd50269063a963f5f26e7d587ccc1
BLAKE2b-256 67b44b38ad8b64ec6fc2e1f5e271240ee150c6315771115ac4dd20b72bcecc9c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.7-cp313-cp313-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 18749dca0866bc2a0c066c47e820c369b49546b8edeb936d34df6010b1b38512
MD5 78fdadea438294a0b9a3c6eeee558fb2
BLAKE2b-256 b1fb7e73e533389d14e924bd54150708a370b3b4958d132bf069045260dc1cbb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.7-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 21b2b3992222ad5e1047a9f89d8c55d96f63b318998c92f5847c557f40cdf776
MD5 57f5c90d7fbc5d67e7542b2090673fde
BLAKE2b-256 66b90836a108127f623307bd6edda76737cbd3e2d6737da9713565b8af54bbfd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: opendht-3.7.7-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.7-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e31b3cdc3f1feae34dde25096b62a0b191192e284772e4ef713f13996fa7eed0
MD5 ca59c8e2e96318c116dde230c72ea6b8
BLAKE2b-256 f7cbab73282f980412f0dcd07d0488975e42ffcea6909f787988a0b4eac34a7d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.7-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 2b347d9ea74692e8f787c1fc46cb21764e3818337ef87c105179b947e69a360d
MD5 8931322917130c8362998e54e394178d
BLAKE2b-256 57bd45216ba7931c8af91d3f864e99105bbcb07b63d8bc06edea69a9e5fc8743

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.7-cp312-cp312-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 10204f16c3d2330e2f2e6fc02e94fbc3bc173c1324655a8e6d05d66f4df3da46
MD5 c25b298f5071bcdc6870091ef49ab1d1
BLAKE2b-256 ff5dc8382ad8caccb6a49abb78c416d5b37f3c7907a9e62fc3cd3c69744fe86d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.7-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 1602cfcddd270ef38cb602273d6474a32ea1631b30c394e1230f4bcfcef1683a
MD5 4266a7fac343d3030759794947f75d6e
BLAKE2b-256 3df6090662e412eac5de8fd5145f38662d30910c3be8e4c10baba27727a0fc62

See more details on using hashes here.

File details

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

File metadata

  • Download URL: opendht-3.7.7-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.7-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0d526c1782e0f2176d88d2b5eff868a19b547080093f5826fa4e4f7732253596
MD5 6a34b6afd72c3ceb08947dda1679a376
BLAKE2b-256 a0e6fa7bc0d59fce8d6793ef1b40100f108fbd7d19cc4f7c6d8a42196dc99ef2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.7-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 6d98bf4362ddf75812b029b32835663fd6d944bffc309bc03271bcaeaa045476
MD5 cb3ffa24eb1502f88369571165ed792b
BLAKE2b-256 ddc879213a2371890638c0f84fcdee5c37c58f8cce2aff168f1c937138f3037b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.7-cp311-cp311-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 3301edf0d08c28661e477b05d245304ddfdfbaeac4616f29bd41265dc59ebc4e
MD5 9f9fc018a9eabc6ed8904ad27d8eb574
BLAKE2b-256 e9b36c685e3f7eaf69f675a5a9368680651052bb8592e94c8171c133f9e85e49

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.7-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 95a8335984d2c37463dbf5f39e63192c042f2d0b85a04cffbc8646f63499dcd9
MD5 2d1e3010adb5c90d789e94cb32696ad9
BLAKE2b-256 919a4ab50d9b27a5037b459e0d35968e6c34de1332cced09f7cc990b5d7bf05a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.7-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 bf588ee4d7c466165c2d2dc82bb1117ac0ab35cb05b3f2a4629f4b08efd58615
MD5 2aee39d49450628e4b0bb460fe2ac624
BLAKE2b-256 3c71e75e486e14265f5266362826ccf3ebdeb6a49f532327c3d1ee224f2afc09

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.7-cp310-cp310-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 c9e08c34009907f09e3917ae4c22f4e5d16627c352fe1af89a0e4a14aab5ac99
MD5 5658dd3f4d778ec84abe2dc0b1b60327
BLAKE2b-256 a002b70b94f89e9ab277b120cff106f66e12ca0c1224ad36fbcb4e0e538a627e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.7-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 4bee368c39de26a42e7882f50de2713cda6f79fd0b2fcde17fc0a50f180c2f4e
MD5 503de46c0595d494f09e6df5dedd33b1
BLAKE2b-256 278e4bcced1096aabc899dc53786cc556261476e505b9bed0442bfe0031bd6f9

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