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(title='Atlas Shrugged', author='Ayn Rand').save()

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

# retrieve a book by its title
book = await Book.where_eq(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
    • Allow multiple items to share one index key
    • Add more comparators for where_() queries
      • where_gte()
      • where_lte()
      • where_contains()
    • Persist indices to lower startup time
  • Automatic multi-page fetching
  • Encapsulate Aleph SDK as class
  • Local VM caching
  • Add tests
  • Add documentation
  • Add to indices when fetching records
  • Test where_eq() for fetching multiple records
  • Add reindexing function on AARS
  • Add caching of records
    • Cache records retrieved by item_hash
    • Cache records retrieved by fetch_all/timeline
      • Add item_hashes endpoint to pyaleph for quick cross-checking of cache hashes

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.4.6.tar.gz (41.0 kB view details)

Uploaded Source

Built Distribution

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

aars-0.4.6-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file aars-0.4.6.tar.gz.

File metadata

  • Download URL: aars-0.4.6.tar.gz
  • Upload date:
  • Size: 41.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.16

File hashes

Hashes for aars-0.4.6.tar.gz
Algorithm Hash digest
SHA256 d01dc2db75f82fc85e090bc67f90e94b64f64dba6ff8cc03bcefca11318b7677
MD5 23d6b5c99a1bd43c924ad3749b489389
BLAKE2b-256 6f55a2a8a68e0a158202da391b97e6a89d9a290cdc4330967f0640d16e98f9f1

See more details on using hashes here.

File details

Details for the file aars-0.4.6-py3-none-any.whl.

File metadata

  • Download URL: aars-0.4.6-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.16

File hashes

Hashes for aars-0.4.6-py3-none-any.whl
Algorithm Hash digest
SHA256 30e5ee9599d08936782889e99aa803c67699cd4c6cd940cdff6d4842e01a72ed
MD5 5bb85b7ed3af60e82408c23a9dfb9c53
BLAKE2b-256 b98046b53588bfcd3a7555d881e825cc45d8702187de36ea26c7f385324c959c

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