Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
:Build: |build|_ |coverage|_ :Documentation: http://flywheel.readthedocs.org/ :Downloads: http://pypi.python.org/pypi/flywheel :Source: https://github.com/stevearc/flywheel
.. |build| image:: https://travis-ci.org/stevearc/flywheel.png?branch=master .. _build: https://travis-ci.org/stevearc/flywheel .. |coverage| image:: https://coveralls.io/repos/stevearc/flywheel/badge.png?branch=master .. _coverage: https://coveralls.io/r/stevearc/flywheel?branch=master
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 <https://github.com/jlafon/PynamoDB>
_.
This is what a basic model looks like (schema taken from this DynamoDB API documentation <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.html>
_)
::
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()
dynamo3
dependency to avoid breakagequery().limit()
will limit the number of results, query().scan_limit()
will limit number of items scannedupdate_schema()
method to Engineno_read
, which changes the behavior for syncing models with no changes. Instead of performing a GET, it will leave them as-is. This should make it easer to perform batch syncs without worrying as much about wasted bandwidth on GETs.Field
has renamed the data_type
argument to type
(data_type
will still work)exists()
method to Enginesave()
method to Modelsupdate_field()
method to Engineindex_pk_dict_
index_pk_dict_
method for constructing exclusive_start_key
for index queriesConditionalCheckFailedException
when syncing changes to a Composite field.DateTimeType
to be stored as a naive datetime.dict
, list
, and bool
types backwards-compatible with the old json-serialized formatin
, not null
, and a few other constraints that were missingexpected
syntax for dynamo3list
, dict
, and bool
data types to use native DynamoDB types instead of JSON serializingdatetime
and date
objects (for more info see the commit)nullable=False
)Data type changes are due to an update in the DynamoDB API <https://aws.amazon.com/blogs/aws/dynamodb-update-json-and-more/>
_
All changes are due to an update in the DynamoDB API <http://aws.amazon.com/blogs/aws/improved-queries-and-updates-for-dynamodb/>
_
.count()
terminator for queriesEngine.create_schema()
namespace
is truly isolatedincr_()
on models that have not been saved yetNone
FAQs
SQLAlchemy-style ORM for Amazon's DynamoDB
We found that flywheel 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.