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

Uploaded CPython 3.14Windows x86-64

opendht-4.0.0-cp314-cp314-manylinux_2_34_x86_64.whl (5.5 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

opendht-4.0.0-cp314-cp314-manylinux_2_34_aarch64.whl (5.2 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ ARM64

opendht-4.0.0-cp314-cp314-macosx_15_0_arm64.whl (3.6 MB view details)

Uploaded CPython 3.14macOS 15.0+ ARM64

opendht-4.0.0-cp313-cp313-win_amd64.whl (5.5 MB view details)

Uploaded CPython 3.13Windows x86-64

opendht-4.0.0-cp313-cp313-manylinux_2_34_x86_64.whl (5.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

opendht-4.0.0-cp312-cp312-manylinux_2_34_x86_64.whl (5.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

opendht-4.0.0-cp312-cp312-manylinux_2_34_aarch64.whl (5.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

opendht-4.0.0-cp311-cp311-manylinux_2_34_x86_64.whl (5.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

opendht-4.0.0-cp311-cp311-manylinux_2_34_aarch64.whl (5.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.11macOS 15.0+ ARM64

opendht-4.0.0-cp310-cp310-manylinux_2_34_x86_64.whl (5.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

opendht-4.0.0-cp310-cp310-manylinux_2_34_aarch64.whl (5.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ ARM64

opendht-4.0.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-4.0.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: opendht-4.0.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 5.5 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for opendht-4.0.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 806b16c2020f810de3050a3beb6d171065741263d3027b92eca00e11a9c6e623
MD5 bc08df8d351caf9607e3a633cf6d9c37
BLAKE2b-256 4c0ad62c2cb24d2e2422521d98e3cb5ac1fe9a209e552ca5b66a261ddc254e0a

See more details on using hashes here.

File details

Details for the file opendht-4.0.0-cp314-cp314-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for opendht-4.0.0-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 68f737dd09653b5791083c3a8fe06aa579ac3c409e18cecc14b8e62295884631
MD5 12dcdddde168a6aa3c4b14559c5ada64
BLAKE2b-256 1a9c6102e7917173ac2388a7846e283fe2dda6e85cb7937957c2139ea5efae9d

See more details on using hashes here.

File details

Details for the file opendht-4.0.0-cp314-cp314-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for opendht-4.0.0-cp314-cp314-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 f393b79fdf4b40d50dc2f749c6d9077f1ab69bc1290a6899804023f66583ac63
MD5 bfb14411d01cc8749facc536e561de89
BLAKE2b-256 7a70c2ff08ce93d3c0e1edc32e42ba5469991fe506972d33ab38240f7d92c29b

See more details on using hashes here.

File details

Details for the file opendht-4.0.0-cp314-cp314-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for opendht-4.0.0-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 646efb93dcb6e84bc5967399f477f080eaf36cb91dbe9348617ea101ea569872
MD5 207cfa598a33fe0ae1fbad14a63ec8b4
BLAKE2b-256 812b8097f456f5081ee31a3b5d295c6bac6e9f27a19bfe56d45ef53132e7a791

See more details on using hashes here.

File details

Details for the file opendht-4.0.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: opendht-4.0.0-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.12

File hashes

Hashes for opendht-4.0.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 aaa655ceb578974a5b3194e766fe2cface88cae4122d81138a5f9796f57960e5
MD5 3ef405daf7cd834b57bfd7b8c9036b34
BLAKE2b-256 e594e23abf6b218667d69f3d35c9b34709096e2eda307358ef1b5f86ca666e3b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-4.0.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 b8e6201a374c470ba0563f6860a8b7d71b1b25ed69f6f447721daaf4f5e11437
MD5 7aefa9b0a7a1e52933349e916e3498fb
BLAKE2b-256 752d96303e46f52f117f445693104c293851a8125250271138ca0f2e023ed899

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-4.0.0-cp313-cp313-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 31c5d38a33fa7c6de85008a151d288913bbbe8cfc46e2955141b8eabca5628de
MD5 26d2e42bed9661d483aa92b3fb631766
BLAKE2b-256 3191de3bea52d6b8b7314d495531d6ca68f9a09a3c5110bdb2b0bd361a1211eb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-4.0.0-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 fffb2c46b93612b107412b19196fea92d0d7b8707acb2f8ca93f6318103c524e
MD5 4311a9dd0da7e350c24b1452922eb8b8
BLAKE2b-256 781b5b4771d691d88b099a9d064b9aebf37be5b10f10b182db7484ea26852113

See more details on using hashes here.

File details

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

File metadata

  • Download URL: opendht-4.0.0-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.12

File hashes

Hashes for opendht-4.0.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 269f905c930a638d64304eda88de1caabcc7fedfbf4d88ec3a464858742f5689
MD5 e8363e09414cb3e11ca03016775fb136
BLAKE2b-256 dbdbf0ccb7635d5e76975b2ffed26888059274fc34ee2fef4fa5c1be5899fc0a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-4.0.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 cb7ca6f3937034f638ce4026e567e77403ef8a2b63f6c05a2776a1e6b54028d4
MD5 7acc89050c0d47a44162845ff9868156
BLAKE2b-256 df1d69f5083e52f16d965f45ca6550cd7f939534cb17eed17c5c90a858e138fe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-4.0.0-cp312-cp312-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 09a19ff68faef1054401fc009b98b59a32c66b0ce6530e1f599e78275c6b97e2
MD5 2fa48c27b629fb12ae1dcf419e3850a1
BLAKE2b-256 93b34158dc33f238bf9c539e761def2f7c12110bc9d9f204b5e738545c5f1881

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-4.0.0-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 5409fff3abffc3dc2668557076e286b0645562f9f9cb802c7160ceb530bf848d
MD5 ac43451461e80d23646fa6bf96446f09
BLAKE2b-256 2235c7b10613e679e0a455c594a39e83e5022d24e9b6b7bb5ef8c52ced743987

See more details on using hashes here.

File details

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

File metadata

  • Download URL: opendht-4.0.0-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.12

File hashes

Hashes for opendht-4.0.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a26999c25f2ce8f123e2efc1be512d8bc7b5623e59ce2bbac832bace10015c31
MD5 06101e2c2c994aeb355f8b4a96354f51
BLAKE2b-256 a0a5ec83fc82b36ce96c91e0fca5dcc10193a7ce1e3773789f13d6283e7abcd1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-4.0.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 da9f3c822e0cc570bd35de7b67049207426363eae5a65b217ec936c62c4d01f3
MD5 023a66307f190c72173ebe621e1bcffb
BLAKE2b-256 1a145cd732d386f37301678134ed26fd6d04571f6ac1076afc75fa5532462074

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-4.0.0-cp311-cp311-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 f31a5c656b0ab0ce652aa8173091bef03b044d88e251442b3ac02564a02e247a
MD5 1af3f7e83afc6f7b72530aa39893f78c
BLAKE2b-256 bca488d2538ff94c672d5577b66262b45a06b488ed84051c2f92bd41eca74c63

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-4.0.0-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 8c178612d037555aeb5335ddae92ee9798f33768c6cac63cb74bc73100483b5c
MD5 013ae6804ad0dadce45669c1deeded8a
BLAKE2b-256 78b217df5336032d07b633cce145729eeb098d8074904ee8a8db84e0d2c53d0c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-4.0.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 2720c8b54d0b3642e93ead1f901eb9b0129145a1c6e8db82b3ae8f2ee7f78176
MD5 6666ce84bbe34193f72389e3d31445ef
BLAKE2b-256 b4c15bd370c46e9c1a7b269b3ae924f752c0ad92732beacd419579c3a69bcfba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-4.0.0-cp310-cp310-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 4ece0507633a8d67acc41c46c50373cb60d0385a7997e32d5e1f6989e1c44f8b
MD5 0ebd80fea5dacfe0c3a11aca7154fa6f
BLAKE2b-256 98e09390275ddc213f112f8540080f87d826952eac5f1467aff137a3c85b6e58

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opendht-4.0.0-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 1493ea4f825301a188644e00bf279434b153a11119c5a9966510df0b876e868c
MD5 eacf49df86e2f060e910e3e172039670
BLAKE2b-256 ff13cbd73d8a8582eb67cc370cd54b3091fcf67425fae201d05da8c003a01305

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