Object mapper for Amazon's DynamoDB

Overview

Flywheel

Build: build coverage
Documentation: http://flywheel.readthedocs.org/
Downloads: http://pypi.python.org/pypi/flywheel
Source: https://github.com/stevearc/flywheel

Object mapper for Amazon's DynamoDB

END OF LIFE WARNING: I haven't personally used this project, or even written much python, since early 2014. I will continue to respond to bugs and pull requests, but I am no longer doing active development. My apologies to those of you who have come to rely on Flywheel; I wish I had the time to continue it. If there is anyone in the community interested in becoming the new maintainer and continuing to move development forward, send me an email and we can discuss.

If you are looking for an alternative, I can recommend PynamoDB.

Getting Started

This is what a basic model looks like (schema taken from this DynamoDB API documentation)

from flywheel import Model, Field, GlobalIndex

class GameScore(Model):
    __metadata__ = {
        'global_indexes': [
            GlobalIndex('GameTitleIndex', 'title', 'top_score')
        ],
    }
    userid = Field(hash_key=True)
    title = Field(range_key=True)
    top_score = Field(type=int)
    top_score_time = Field(type=datetime)
    wins = Field(type=int)
    losses = Field(type=int)

    def __init__(self, title, userid):
        self.title = title
        self.userid = userid

Create a new top score

>>> score = GameScore('Master Blaster', 'abc')
>>> score.top_score = 9001
>>> score.top_score_time = datetime.utcnow()
>>> engine.sync(score)

Get all top scores for a user

>>> scores = engine.query(GameScore).filter(userid='abc').all()

Get the top score for Galaxy Invaders

>>> top_score = engine.query(GameScore).filter(title='Galaxy Invaders')\
...     .first(desc=True)

Atomically increment a user's "wins" count on Alien Adventure

>>> score = GameScore('Alien Adventure', 'abc')
>>> score.incr_(wins=1)
>>> engine.sync(score)

Get all scores on Comet Quest that are over 9000

>>> scores = engine.query(GameScore).filter(GameScore.top_score > 9000,
...                                         title='Comet Quest').all()
Owner
Steven Arcangeli
Steven Arcangeli
Global base classes for Pyramid SQLAlchemy applications.

pyramid_basemodel pyramid_basemodel is a thin, low level package that provides an SQLAlchemy declarative Base and a thread local scoped Session that c

Grzegorz Śliwiński 15 Jan 03, 2023
A Python Object-Document-Mapper for working with MongoDB

MongoEngine Info: MongoEngine is an ORM-like layer on top of PyMongo. Repository: https://github.com/MongoEngine/mongoengine Author: Harry Marr (http:

MongoEngine 3.9k Dec 30, 2022
The Orator ORM provides a simple yet beautiful ActiveRecord implementation.

Orator The Orator ORM provides a simple yet beautiful ActiveRecord implementation. It is inspired by the database part of the Laravel framework, but l

Sébastien Eustace 1.4k Jan 01, 2023
The ormar package is an async mini ORM for Python, with support for Postgres, MySQL, and SQLite.

python async mini orm with fastapi in mind and pydantic validation

1.2k Jan 05, 2023
A Python Library for Simple Models and Containers Persisted in Redis

Redisco Python Containers and Simple Models for Redis Description Redisco allows you to store objects in Redis. It is inspired by the Ruby library Ohm

sebastien requiem 436 Nov 10, 2022
Rich Python data types for Redis

Created by Stephen McDonald Introduction HOT Redis is a wrapper library for the redis-py client. Rather than calling the Redis commands directly from

Stephen McDonald 281 Nov 10, 2022
A pythonic interface to Amazon's DynamoDB

PynamoDB A Pythonic interface for Amazon's DynamoDB. DynamoDB is a great NoSQL service provided by Amazon, but the API is verbose. PynamoDB presents y

2.1k Dec 30, 2022
A pure Python Database Abstraction Layer

pyDAL pyDAL is a pure Python Database Abstraction Layer. It dynamically generates the SQL/noSQL in realtime using the specified dialect for the databa

440 Nov 13, 2022
Easy-to-use data handling for SQL data stores with support for implicit table creation, bulk loading, and transactions.

dataset: databases for lazy people In short, dataset makes reading and writing data in databases as simple as reading and writing JSON files. Read the

Friedrich Lindenberg 4.2k Dec 26, 2022
Redis OM Python makes it easy to model Redis data in your Python applications.

Object mapping, and more, for Redis and Python Redis OM Python makes it easy to model Redis data in your Python applications. Redis OM Python | Redis

Redis 568 Jan 02, 2023
Piccolo - A fast, user friendly ORM and query builder which supports asyncio.

A fast, user friendly ORM and query builder which supports asyncio.

919 Jan 04, 2023
Object mapper for Amazon's DynamoDB

Flywheel Build: Documentation: http://flywheel.readthedocs.org/ Downloads: http://pypi.python.org/pypi/flywheel Source: https://github.com/stevearc/fl

Steven Arcangeli 128 Dec 31, 2022
Solrorm : A sort-of solr ORM for python

solrorm : A sort-of solr ORM for python solrpy - deprecated solrorm - currently in dev Usage Cores The first step to interact with solr using solrorm

Aj 1 Nov 21, 2021
ORM for Python for PostgreSQL.

New generation (or genius) ORM for Python for PostgreSQL. Fully-typed for any query with Pydantic and auto-model generation, compatible with any sync or async driver

Yan Kurbatov 3 Apr 13, 2022
A dataclasses-based ORM framework

dcorm A dataclasses-based ORM framework. [WIP] - Work in progress This framework is currently under development. A first release will be announced in

HOMEINFO - Digitale Informationssysteme GmbH 1 Dec 24, 2021
Sqlalchemy seeder that supports nested relationships.

sqlalchemyseed Sqlalchemy seeder that supports nested relationships. Supported file types json yaml csv Installation Default installation pip install

Jedy Matt Tabasco 10 Aug 13, 2022
A very simple CRUD class for SQLModel! ✨

Base SQLModel A very simple CRUD class for SQLModel! ✨ Inspired on: Full Stack FastAPI and PostgreSQL - Base Project Generator FastAPI Microservices I

Marcelo Trylesinski 40 Dec 14, 2022
A PostgreSQL or SQLite orm for Python

Prom An opinionated lightweight orm for PostgreSQL or SQLite. Prom has been used in both single threaded and multi-threaded environments, including en

Jay Marcyes 18 Dec 01, 2022
Sqlalchemy-databricks - SQLAlchemy dialect for Databricks

sqlalchemy-databricks A SQLAlchemy Dialect for Databricks using the officially s

Flynn 19 Nov 03, 2022
Twisted wrapper for asynchronous PostgreSQL connections

This is txpostgres is a library for accessing a PostgreSQL database from the Twisted framework. It builds upon asynchronous features of the Psycopg da

Jan Urbański 104 Apr 22, 2022