Skip to main content

Experimental Object-Document-Mapper using pydantic to store objects on Aleph.im

Project description

AARS: Aleph Active Record SDK

AARS's goal is to provide simple guardrails for the creation of document databases, based on Aleph's decentralized storage API. It provides tools for modelling, creating and managing decentralized databases, and a set of extensions for the Aleph Python SDK.

You can create a model of your planned database by using the Record class.

Usage

from aars import Record, Index, AARS


class Book(Record):
  title: str
  author: str


# initialize the SDK and post subsequent requests to the "MyLibrary" channel on Aleph
AARS(channel="MyLibrary")

# create and add an index for the book title
Index(Book, 'title')

# create & upload a book
new_book = await Book.create(title='Atlas Shrugged', author='Ayn Rand')

# retrieve a book by its ID
book = await Book.get(new_book.id_hash)[0]

# retrieve a book by its title
book = await Book.query(title='Atlas Shrugged')[0]

ToDo:

  • Basic CRUD operations
  • Versioning
    • Use "amend" post_type for updates
    • Fetch revisions with messages endpoint
  • Basic indexing/querying operations
    • Single-key indexing
    • Multi-key indexing
    • Query with list of keys
    • Update indices function
  • Automatic multi-page fetching
  • Encapsulate Aleph SDK as class
  • Local VM caching
  • Add tests
  • Add documentation
  • Add to indexes when fetching records
  • Test query() for fetching multiple records
  • Add reindexing function on AARS

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

aars-0.2.5.tar.gz (22.2 kB view hashes)

Uploaded Source

Built Distribution

aars-0.2.5-py3-none-any.whl (10.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page