Skip to main content

AARS - Aleph Active Record SDK

AARS is a powerful and flexible Python library built on top of the Aleph decentralized storage network, designed to help you build better backends for your decentralized applications. It provides an easy-to-use interface for managing and querying your data, with a focus on performance and versatility.

Features

  • Asynchronous, high-performance data storage and retrieval
  • Customizable schema with support for different data types
  • Indexing for efficient querying
  • Revision history tracking for records
  • Support for forgetting data (GDPR compliant)
  • Built-in pagination for large result sets

Installation

Install AARS using pip:

pip install aars

Getting Started

To get started with AARS, you will need to define your data schema by creating classes that inherit from Record. These classes represent the objects you want to store and query on the Aleph network.

Here's an example of how you can implement a simple social media platform, that we'll call "Chirper":

from src.aars import Record

class User(Record):
    username: str
    bio: str

class Chirp(Record):
    author: User
    content: str
    likes: int
    timestamp: int

In this example, we have a User class representing a user of Chirper, and a Chirp class representing a user's message. Now, let's create some indices to make querying our data more efficient:

from src.aars import Index

Index(User, 'username')
Index(Chirp, 'author')
Index(Chirp, 'timestamp')

With the schema defined and indices created, we only need to initialize an AARS session:

from src.aars import AARS

AARS()

It is enough to call the constructor once, and it will automatically initialize the session with the default settings.

We can now perform various operations, such as creating new records, querying records, and updating records:

import time

# Create a new user
new_user = await User(username='chirpy_user', display_name='Chirpy User', bio='I love chirping!').save()

# Create a new chirp
new_chirp = await Chirp(author=new_user, content='Hello, Chirper!', likes=0, timestamp=int(time.time())).save()

# Query chirps by author
chirps_by_author = await Chirp.filter(author=new_user).all()

# Update a chirp
new_chirp.likes += 1
updated_chirp = await new_chirp.save()

Documentation

For detailed documentation, including advanced features such as revision history, forgetting data, and pagination, refer to the docs folder in the repository or visit the official documentation website.

Building the Docs

To build the documentation, you will need to install the dependencies listed in the requirements.txt and docs-requirements.txt. Then, run the following command:

mkdocs build

You can serve the documentation locally by running the following command:

mkdocs serve

Contributing

Contributions to AARS are welcome! If you have found a bug, want to suggest an improvement, or have a question, feel free to open an issue on the GitHub repository.

License

AARS is released under the MIT License.

Metadata

Release files for aars 0.7.5

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

Source distribution (sdist)

Source distribution for aars 0.7.5
File Size Uploaded Provenance
aars-0.7.5.tar.gz 22.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for aars 0.7.5
File Interpreter ABI Platform
aars-0.7.5-py3-none-any.whl Python 3 none any Details

Total release size: 40.9 kB

Release files / aars-0.7.5.tar.gz

Download URL aars-0.7.5.tar.gz
Size 22.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9ac49086e9e2f165e17e7e0263f85bea95563cb8521891ce08a8437d0c2986c8
BLAKE2b-256 checksum
How to use checksums
cbda03dd1ac7191f113ebbf89688297ea1c015172e871dc341b3dbdd75a9703c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.16

Release files / aars-0.7.5-py3-none-any.whl

Download URL aars-0.7.5-py3-none-any.whl
Size 18.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6a978a04737d03100f5a263f71a38b7df19158f6cea580ef4691b70aa35d85c1
BLAKE2b-256 checksum
How to use checksums
b1037eaffecf7b9559369e1136ce63a10c6ca8e881fc30455ac15fc028013616
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.16

Security for aars 0.7.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.7.5 This release

2 release files No provenance

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