
Security News
GitHub Actions Supply Chain Attack Puts Thousands of Projects at Risk
A compromised GitHub Action exposed secrets in CI/CD logs, putting thousands of projects at risk and forcing developers to urgently secure their workflows.
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 compromised GitHub Action exposed secrets in CI/CD logs, putting thousands of projects at risk and forcing developers to urgently secure their workflows.
Research
Security News
A malicious Maven package typosquatting a popular library is secretly stealing OAuth credentials on the 15th of each month, putting Java developers at risk.
Security News
Socket and Seal Security collaborate to fix a critical npm overrides bug, resolving a three-year security issue in the JavaScript ecosystem's most popular package manager.