Skip to main content

Common attributes for PynamoDB

Project description

This Python 3 library contains compound and high-level PynamoDB attributes:

  • FloatAttribute – same as NumberAttribute but whose value is typed as float
  • IntegerAttribute – same as NumberAttribute but whose value is typed as int (rather than float)
  • UnicodeDelimitedTupleAttribute - a delimiter-separated value, useful for storing composite keys
  • UnicodeEnumAttribute - serializes a string-valued Enum into a Unicode (S-typed) attribute
  • UnicodeProtobufEnumAttribute - serializes a Protobuf enum into a Unicode (S-typed) attribute
  • IntegerEnumAttribute - serializes a int-valued Enum into a number (N-typed) attribute
  • TimedeltaAttribute, TimedeltaMsAttribute, TimedeltaUsAttribute – serializes timedeltas as integer seconds, milliseconds (ms) or microseconds (µs)
  • TimestampAttribute, TimestampMsAttribute, TimestampUsAttribute – serializes datetimes as Unix epoch seconds, milliseconds (ms) or microseconds (µs)
  • IntegerDateAttribute - serializes date as an integer representing the Gregorian date (e.g. 20181231)
  • UUIDAttribute - serializes a UUID Python object as a S type 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. Homebrew) or as a Docker container:

docker run -d -p 8000:8000 amazon/dynamodb-local

Afterwards, run tests as usual:

pytest tests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pynamodb-attributes-0.4.0.tar.gz (16.0 kB view hashes)

Uploaded source

Built Distribution

pynamodb_attributes-0.4.0-py2.py3-none-any.whl (26.2 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page