Pre-release
This release is a pre-release and may not be stable for production use.
DynamoClasses
API interface for Amazon Web Services DynamoDB built on top of PEP 557 Data Classes.
The goal is to have something that is fully a dataclass class, but gets some helpers bolted on allowing for retrieving/storing the objects in DynamoDB.
Basic Usage
>>> import botocore
>>>
>>> from moto import mock_dynamodb2
>>>
>>> from dynamoclasses import dynamoclass
>>>
>>> mock_dynamodb2().start()
>>>
>>> session = botocore.session.get_session()
>>> client = session.create_client("dynamodb")
>>> client.create_table(
... TableName="inventory",
... KeySchema=[
... {"AttributeName": "item_id", "KeyType": "HASH"},
... ],
... AttributeDefinitions=[
... {"AttributeName": "item_id", "AttributeType": "S"},
... ],
... ProvisionedThroughput={"ReadCapacityUnits": 1, "WriteCapacityUnits": 1},
... )
{'TableDescription': ...}
>>>
>>> @dynamoclass(table_name="inventory", partition_key_name="item_id")
... class InventoryItem:
... item_id: str
...
>>> item = InventoryItem("hammers")
>>> item.save()
{'Attributes': ...}
>>>
>>> found_item = InventoryItem.get(partition_key="hammers", sort_key=None)
>>>
>>> print(found_item.item_id)
hammers
Metadata
Release files for dynamoclasses 1.0.0a2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dynamoclasses-1.0.0a2.tar.gz | 3.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dynamoclasses-1.0.0a2-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 7.8 kB
Release files / dynamoclasses-1.0.0a2.tar.gz
| Download URL | dynamoclasses-1.0.0a2.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d67f05ac42bfcb60d25403305dd4a924b6eac100867ea38b4325bae0939cfaf9
|
|
BLAKE2b-256 checksum How to use checksums |
ecf2f321c3647ef79603412c9d6817d2ef3e860548606088cce9a2b499d3d075
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / dynamoclasses-1.0.0a2-py2.py3-none-any.whl
| Download URL | dynamoclasses-1.0.0a2-py2.py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
bbbbc572f2bc488b8298bdc99d345ace0f34654eac2e1de04c0f928f04eb90a4
|
|
BLAKE2b-256 checksum How to use checksums |
13b0f7da35ebce90dccd9f650199006a8c9630cce9c6a6e08026ecbeaa134771
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|