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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.11macOS 15.0+ ARM64

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

Uploaded CPython 3.10manylinux: glibc 2.34+ ARM64

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

File metadata

  • Download URL: opendht-3.7.3-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.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 6a08aaad4dbd591f3989bd14546f6eee22866bdbf0e7eaaa98202bfdf8fa9f71
MD5 0f6a44488c2f6e5315d6518bef1315a8
BLAKE2b-256 cbac73a42cd4713422cb39e4f3e71ed27b1f9dc007a7829dd43a677109e96ed5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.3-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 112cce43f8884c8857a0b78f4f637ce66dcc59e4c89adbad49ae28328d0a4e8b
MD5 29a7426fb74703618b3a7f4d77fd29d7
BLAKE2b-256 52f4c61c827487dadd09ae59999d19b60b7ec21350037a35bf170bd3b397058e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.3-cp313-cp313-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 11fafc72a81cca522598ba1f29003fa84d288db97e27c2288a3e06e69c4073e1
MD5 1fbc4115aec97f930ef786a97c8289fc
BLAKE2b-256 b0a668744c99b7d12f86a86f45a8272f4b581256e0bc49c9511f4386abd152f4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.3-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 3685e2c1c95b319b3726e5cf41cb438eb5f5bb47e838d9f395eb70adc38244e9
MD5 261e61791cf4b76882fb56b4b544d79e
BLAKE2b-256 abd9c09bdc4c92404b57c72300dd8405662c30ebd7c898a745e62229ef636151

See more details on using hashes here.

File details

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

File metadata

  • Download URL: opendht-3.7.3-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.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 206e2921b14408c8d369d122ae59b8dbbc1fe55e0a450110c89b30cb7dd93cd9
MD5 b9ba76df61a06dd8aa8e68f15b8e3837
BLAKE2b-256 ba46d2a85c2b1b4f5caf38763ab6d655c932f895e5f4a4a9f3b36bb1eb0304a2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.3-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 a15522b2b2922a40c6888bc6a441416ec9c0565a581a667f51c2345c813cd0be
MD5 0032f6c13c491753b643c0402e61e1d5
BLAKE2b-256 2a29870fff3d7f4740b70a7a28934688b25cf5640a5cc242a32431d17634eb13

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.3-cp312-cp312-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 20372d410201db5ca247719bef16797012689e1354a2382e0ded7f0af8a3b3a3
MD5 f420a9ff21de4aaf192d6b796ccf7428
BLAKE2b-256 b772a2d43f25162890e990a41a3c7a251ff15e7d6216b03dfa8f5b827549c220

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.3-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 a51223d9a04d59fe05bbc6b213f7003dff018ecb0f0119bc25c0ed6f1e90c2c1
MD5 e51c95aae3e1482672e10a08378ea259
BLAKE2b-256 87bc514dedd67ac174eab7c9e4970b409b1d5443e0b2ac3b779954c08d9221bf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: opendht-3.7.3-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.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4c59d4a938ad629203f825d7138cc6d72d03c7c543688b7782fabc7f932731a0
MD5 06fa201d7f53c632a158c093c16fc65f
BLAKE2b-256 b98e534d5767942bc64ec34aff4c4a7756750e06f7b5c121d63497b22abd7937

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.3-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d23d27b34a180100c1b940449f2aa9e2cf8ce9c842fc4ef8065e731c78726e70
MD5 52f4d4d7b0160071fa947c0124197744
BLAKE2b-256 72bddf557fb21825580909ee85345df51b8804dadbaf29506be6869e07e6eb60

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.3-cp311-cp311-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 1988bbe0ae28881f1431b8385e4f0273b9fc6e7c3f5d0e76fa4bb917ec4f02ac
MD5 4fd8c043969011093d388b81b88a6b4a
BLAKE2b-256 5a46e8ac11c4984a4954dadd43a1f7896860486232749bd3319f92c3fdd58cb8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.3-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 1eac143ee1c9d83695de310a4140b8e55e80a24d16243d5d01e81ca0254070da
MD5 4c65b2ecf1d9fe8a1d2166397ba1ce42
BLAKE2b-256 f14bdd67c766d6834fb3c265075e753494ab39a56359e75a272770a3a68a69fa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.3-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d7cdae8cb450c7eabdd53777a0234782e37bfd0ee448ee7f7f9076ad1f4ed007
MD5 08cb3bb45c210749d91349b0f4580a3d
BLAKE2b-256 544024d90859d83537590b738d1f53f5ecd59fb414f1d936ce7640c4bfbdaf69

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.3-cp310-cp310-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 48696895cb2dda8daa88c424d0f3a87cf1b3078537b5722df7fdab948b141d98
MD5 23652a5d04f1887bd2b9010d4cf499db
BLAKE2b-256 7b661791fcd28d6c516c893621b41ea62a9b401602c179622634df63295b3ce8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-3.7.3-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 b0151c862aa720dd80260138d6036030b0c722be92acf8ee3dada548e0f39677
MD5 85491560f622f9bb3c54a2ad6609a383
BLAKE2b-256 c48bb51b8f5b6eb3f683dc29cb6a8224815bf164c3731c36d2839bc08ee5448c

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