
Security News
High Salaries No Longer Enough to Attract Top Cybersecurity Talent
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
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.
Install AARS using pip:
pip install aars
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()
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.
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
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.
AARS is released under the MIT License.
FAQs
Experimental Object-Document-Mapper using pydantic to store objects on Aleph.im
We found that aars demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.
Security News
Corepack will be phased out from future Node.js releases following a TSC vote.