Common attributes for PynamoDB
Slowing down. Last release over 2 years ago, little activity since. Fine for existing code; think twice for a new project.
$
pip install pynamodb-attributesREADME as published on PyPI with version 0.5.0.
This Python 3 library contains compound and high-level PynamoDB attributes:
FloatAttribute– same asNumberAttributebut whose value is typed asfloatIntegerAttribute– same asNumberAttributebut whose value is typed asint(rather thanfloat)IntegerSetAttribute– same asNumberSetAttributebut whose value is typed asint(rather thanfloat)UnicodeDelimitedTupleAttribute- a delimiter-separated value, useful for storing composite keysUnicodeEnumAttribute- serializes a string-valuedEnuminto a Unicode (S-typed) attributeUnicodeProtobufEnumAttribute- serializes a Protobuf enum into a Unicode (S-typed) attributeIntegerEnumAttribute- serializes a int-valuedEnuminto a number (N-typed) attributeTimedeltaAttribute,TimedeltaMsAttribute,TimedeltaUsAttribute– serializestimedeltas as integer seconds, milliseconds (ms) or microseconds (µs)TimestampAttribute,TimestampMsAttribute,TimestampUsAttribute– serializesdatetimes as Unix epoch seconds, milliseconds (ms) or microseconds (µs)IntegerDateAttribute- serializesdateas an integer representing the Gregorian date (e.g.20181231)UUIDAttribute- serializes aUUIDPython object as aStype attribute (e.g.'a8098c1a-f86e-11da-bd1a-00112444be1e')UnicodeDatetimeAttribute- ISO8601 datetime strings with offset information
Testing
The tests in this repository use an in-memory implementation of dynamodb. To run the tests locally, make sure DynamoDB Local is running. It is available as a standalone binary, through package managers (e.g. ) or as a Docker container: