Skip to main content
ReadTheDocs Project generated with PyScaffold

atto.py

A Python API wrapper for the Atto node API.

Atto.py provides a Pythonic interface for communicating with Atto nodes, allowing developers to interact with the account-chain ledgers without dealing with low-level API details.

An instance of AttoClient() represents a connection to an Atto node. Communication with the node happens through AttoClient()’s members.

The methods wrap the information from API responses in the form of Python builtins and classes in this module, such as:

  • Account

  • Entry

  • Receivable

  • Transaction

  • Block

Typical usage example:

from attopy import AttoClient

ADDRESS = '<your_address>'

with AttoClient('http://h:8080') as node:
    print('Account:')
    account = node.account(ADDRESS)
    print(account)
    print()

    COUNT = 10
    print(f'First {COUNT} entries:')
    for entry in account.entries(to=COUNT):
        print(entry)

Example output:

Account:
FF9DA..E37D:     2,665,633.1703     #93

First 10 entries:
03E9.. O           10.0000 ECC0E..99EA FF9DA..E37D      #1 @ 20250415 18:03
2B82.. +           10.0000 ECC0E..99EA FF9DA..E37D      #2 @ 20250415 18:03
04D3.. +           10.0000 ECC0E..99EA FF9DA..E37D      #3 @ 20250415 18:05
5DF6.. +           10.0000 ECC0E..99EA FF9DA..E37D      #4 @ 20250415 18:06
7AB1.. +           10.0000 ECC0E..99EA FF9DA..E37D      #5 @ 20250415 18:07
1D46.. +           10.0000 ECC0E..99EA FF9DA..E37D      #6 @ 20250415 18:39
A710.. +           10.0000 ECC0E..99EA FF9DA..E37D      #7 @ 20250415 18:47
EE78.. +           10.0000 ECC0E..99EA FF9DA..E37D      #8 @ 20250415 18:49
E911.. +           10.0000 ECC0E..99EA FF9DA..E37D      #9 @ 20250415 18:50
C435.. +           10.0000 ECC0E..99EA FF9DA..E37D     #10 @ 20250415 18:52

Installation

Simply run pip install atto.py.

What’s missing?

AttoClient() is a synchronous client, meaning that all calls are blocking. Generators that access endpoints that stream indefinitely (such as the endpoint to scan for new entries) therefore should not be iterated over using for without a timeout, as they will never end and cannot be interrupted without user intervention.

An asynchronous client, AttoClientAsync(), is in the works. This client would facilitate near-instant updating of UI elements representing balances and lists of new entries, and would be able to wait for transactions to be confirmed, all without blocking the main thread.

Currently, AttoClient() supports some of the GET methods provided by the node API, and none of the POST methods. This means that AttoClient() can only query nodes, and can’t post transactions. This will change once a testing framework has been set up.

All classes and members should be fully documented soon.

Need help?

I’m always available in the Atto Discord server. Feel free to get in touch.

For some insight into what inspired me to write this library, see this blog post.

Metadata

Release files for atto.py 0.9.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for atto.py 0.9.1
File Size Uploaded
atto_py-0.9.1.tar.gz 38.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for atto.py 0.9.1
File Interpreter ABI Platform
atto_py-0.9.1-py3-none-any.whl Python 3 none any Details

Total release size: 65.8 kB

Release files / atto_py-0.9.1.tar.gz

Download URL atto_py-0.9.1.tar.gz
Size 38.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ef64a455796940daa6fa54c5eaef5079d387dee301248e2084c906b4f1300ede
BLAKE2b-256 checksum
How to use checksums
92c56062d275b47bc64fbc53d17253d3a7b5206a6824ef9496ef9da562d071bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release files / atto_py-0.9.1-py3-none-any.whl

Download URL atto_py-0.9.1-py3-none-any.whl
Size 27.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
51520187c6958816b890e71f4437fea70ce13e0565e6c0d42f89db949709bd20
BLAKE2b-256 checksum
How to use checksums
c0988907a8eb0424c466e6126fd2abf74b3a9a8d5c1aa217370df98650f649fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release history Release notifications | RSS feed

This release

0.9.1 This release

2 release files

0.1.3

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page