Skip to main content

No project description provided

Project description

dweb

dweb ants tron

dweb → use the Autonomi network as a global datalake where you can just throw in data and retrieve it from anywhere.

Wrapper around autonomi-client to simplify fetching immutable public data with async and sync APIs.

  • Async: dweb.aio
  • Sync: dweb
  • Networks: from dweb import networknetwork.mainnet (default) or network.alpha

Install

poetry install --with test,notebooks

Usage

Sync

from dweb import autonomi, network
content = autonomi.get("a7d2fdbb975efaea25b7ebe3d38be4a0b82c1d71e9b89ac4f37bc9f8677826e0", network=network.alpha)
with open("dogfile.jpg", "wb") as f:
    f.write(content)

Async

import asyncio
from dweb.aio import autonomi
from dweb import network

async def main():
    data = await autonomi.get("a7d2fdbb975efaea25b7ebe3d38be4a0b82c1d71e9b89ac4f37bc9f8677826e0", network=network.mainnet)
    print(len(data))

asyncio.run(main())

Tests (Alpha network)

  • Provide .env with AUTONOMI_TEST_ADDRESS.
  • Run unit tests: poetry run pytest -m "not alpha"
  • Run alpha tests: poetry run pytest -m alpha

Reference: https://pypi.org/project/autonomi-client/

What is dweb (decentralized web)?

"dweb" is a small, ergonomic wrapper that lets your application interact with the decentralized Autonomi network as if it were a single, global data service. You can read from and (soon) write to globally addressable immutable data without running servers, without coordinating networks between participants, and without account-bound storage quotas or subscriptions. Producers and consumers of data do not need to be in the same local network or share infrastructure.

Key ideas:

  • Global addressing via deterministic content/data map addresses
  • Public, immutable data fetch with a single call (sync or async)
  • No app servers to manage for reads; the network serves the data
  • Writers and readers can be completely decoupled in time and space

How it works (high level)

flowchart LR
    A[Your App] -- sync/async --> B[dweb wrapper]
    B -- uses --> C[autonomi-client]
    C -- connects --> D{Autonomi Network}
    D -- mainnet/alpha --> E[(Immutable Data)]

    subgraph Notes
    N1[Data is addressed by its data map address (64-hex)]
    N2[Readers do not need to know writers or share infra]
    N3[No app server required for public reads]
    end
    B -. future .-> F[[Convenience writes]]
    F -. put helpers .-> D

With dweb, fetching public content by its data map address is one call. Think of it as pulling a blob from a global, decentralized datastore.

Concept: storing and retrieving data

  • Reading (available today): Provide a 64-hex data map address and the network (default mainnet). You receive raw bytes of the immutable object.
  • Writing (planned convenience): The wrapper will expose simple helpers to publish immutable data via the underlying autonomi-client so your app can store content without handling low-level details.

Properties:

  • Decentralized: No single server you own or operate for public reads
  • Global: Any participant can read the same address anywhere
  • Durable: Immutable data is content-addressed; readers get the exact bytes referenced

Note: Actual network policies and costs are determined by the Autonomi network and client library. The wrapper does not impose subscription fees or quotas itself.

Notebook display example

from IPython.display import Image, display
from dweb import autonomi, network

addr = "a7d2fdbb975efaea25b7ebe3d38be4a0b82c1d71e9b89ac4f37bc9f8677826e0"
content = autonomi.get(addr, network=network.alpha)
display(Image(data=content))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dweb-0.1.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dweb-0.1.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file dweb-0.1.0.tar.gz.

File metadata

  • Download URL: dweb-0.1.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.10 Darwin/24.6.0

File hashes

Hashes for dweb-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e94cdebe9e00f6d5673fedd4057d88fd375ce6d27232c958df04638f25d33b3b
MD5 0fa77369100807bb42d2a5751fd61504
BLAKE2b-256 7239874bd06a7106c5d1e47c6e9b368108f4be82c9d8e5d8ae63d10cbf06b544

See more details on using hashes here.

File details

Details for the file dweb-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dweb-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.10 Darwin/24.6.0

File hashes

Hashes for dweb-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6fb3fb8686eb6a09994897da9663c97c48f93e5435e580041058ac03900d72e4
MD5 0991796be7d24417b29ada0877fa9763
BLAKE2b-256 a55bc7193c802d4e6fd1e50d55f51e23273f35ac4544bc8acd6ec6141f402bb4

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