A Python Redis ORM
Project description
Status
Documentation: popoto.io
Popoto - A Redis/Valkey ORM (Object-Relational Mapper)
Install
pip install popoto
Basic Usage
from popoto import Model, KeyField, Field, SortedField
class Restaurant(Model):
name = KeyField()
cuisine = Field()
rating = SortedField(type=float)
Restaurant.create(name="Burger Palace", cuisine="American", rating=4.5)
restaurant = Restaurant.query.get(name="Burger Palace")
print(f"{restaurant.name} serves {restaurant.cuisine} food.")
# => "Burger Palace serves American food."
Popoto Features
- very fast stores and queries
- familiar syntax, similar to Django models
- Async operations for asyncio-based applications
- Geometric distance search
- Timeseries for streaming data
- compatible with Pandas, Xarray for N-dimensional matrix search
- PubSub for message queues, streaming data processing
- Full Redis and Valkey support - works with both out of the box
- Agent Memory - programmable memory primitives for AI agents (decay, confidence, associations, context assembly)
- Content & Embeddings - large content storage, vector embeddings, and semantic search
Popoto is ideal for streaming data. The pub/sub module allows you to trigger state updates in real time. Currently being used in production for:
- trigger buy/sell actions from streaming price data
- robots sending each other messages for teamwork
- compressing sensor data and training neural networks
Advanced Usage
import popoto
from popoto import Relationship, DatetimeField
class Restaurant(popoto.Model):
name = popoto.KeyField()
cuisine = popoto.Field()
rating = popoto.SortedField(type=float)
location = popoto.GeoField()
class Order(popoto.Model):
order_id = popoto.AutoKeyField()
restaurant = Relationship(Restaurant)
total = popoto.SortedField(type=float)
status = popoto.Field(default="pending")
created_at = DatetimeField(auto_now_add=True)
class Meta:
order_by = "-created_at"
ttl = 2592000 # 30 days
Save Instances
restaurant = Restaurant(name="Burger Palace")
restaurant.cuisine = "American"
restaurant.rating = 4.5
restaurant.location = (40.7128, -74.0060)
restaurant.save()
order = Order.create(restaurant=restaurant, total=24.99)
Queries
from datetime import datetime, timedelta
midtown = (40.7549, -73.9840)
yesterday = datetime.now() - timedelta(days=1)
nearby_restaurants = Restaurant.query.filter(
location=midtown,
location_radius=5, location_radius_unit='km',
rating__gte=4.0
)
print(len(nearby_restaurants))
# => 1
recent_orders = Order.query.filter(
created_at__gte=yesterday,
total__gte=10.00
)
Documentation
Documentation is available at popoto.io
Please create new feature and documentation related issues github.com/tomcounsell/popoto/issues or make a pull request with your improvements.
License
Popoto ORM is released under the MIT Open Source license.
Popoto Community
Questions, bug reports, and feature requests are welcome on GitHub Issues and GitHub Discussions. Contributions via pull request are encouraged.
Popoto gets its name from the Maui dolphin subspecies - the world's smallest dolphin subspecies. Because dolphins are fast moving, agile, and work together in social groups. In the same way, Popoto wraps Redis and Valkey to make it easy to manage streaming timeseries data and object persistence.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file popoto-1.6.0.tar.gz.
File metadata
- Download URL: popoto-1.6.0.tar.gz
- Upload date:
- Size: 443.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53aa17815e202eb9a0aa13271346f1c7e907298e6e03b6caa5890eb488afcb24
|
|
| MD5 |
492664892020fbb6effbbcaa021f3527
|
|
| BLAKE2b-256 |
fb4c483dde1cb125cb0f6feebc259c71d360da4c317ad8a8fae22026a6cec5d4
|
Provenance
The following attestation bundles were made for popoto-1.6.0.tar.gz:
Publisher:
release.yml on tomcounsell/popoto
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
popoto-1.6.0.tar.gz -
Subject digest:
53aa17815e202eb9a0aa13271346f1c7e907298e6e03b6caa5890eb488afcb24 - Sigstore transparency entry: 1409306985
- Sigstore integration time:
-
Permalink:
tomcounsell/popoto@66eb8d801a89c18abaa928d68683d0302b91ceff -
Branch / Tag:
refs/tags/v1.6.0 - Owner: https://github.com/tomcounsell
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@66eb8d801a89c18abaa928d68683d0302b91ceff -
Trigger Event:
push
-
Statement type:
File details
Details for the file popoto-1.6.0-py3-none-any.whl.
File metadata
- Download URL: popoto-1.6.0-py3-none-any.whl
- Upload date:
- Size: 274.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
240fee432e1e6a62456c4e4d1c5c66e8797154e641c10ff650c0dcd71e330288
|
|
| MD5 |
bd84c43f341f83010bd423751ce66a19
|
|
| BLAKE2b-256 |
5ba6c284240937ad0241fe29de4ed7190e4b958285e1f19601099aa20d385d9c
|
Provenance
The following attestation bundles were made for popoto-1.6.0-py3-none-any.whl:
Publisher:
release.yml on tomcounsell/popoto
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
popoto-1.6.0-py3-none-any.whl -
Subject digest:
240fee432e1e6a62456c4e4d1c5c66e8797154e641c10ff650c0dcd71e330288 - Sigstore transparency entry: 1409307001
- Sigstore integration time:
-
Permalink:
tomcounsell/popoto@66eb8d801a89c18abaa928d68683d0302b91ceff -
Branch / Tag:
refs/tags/v1.6.0 - Owner: https://github.com/tomcounsell
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@66eb8d801a89c18abaa928d68683d0302b91ceff -
Trigger Event:
push
-
Statement type: