DynamoDB value serialisation and deserialisation
Convert values from AWS DynamoDB to native Python types.
Makes more sensible decisions about numbers and binary values, at the cost of floating-point precision. Very lightweight.
Installation
pip install dynamodb-serialise
Usage
import dynamodb_serialise
dynamodb_serialise.deserialise(
{"M": {"foo": {"N": "42"}, "bar": {"B": "c3BhbQ=="}}}
)
# {'foo': 42, 'bar': b'spam'}
dynamodb_serialise.serialise(
{'foo': 42, 'bar': b'spam'}, bytes_to_base64=True
)
# {"M": {"foo": {"N": "42"}, "bar": {"B": "c3BhbQ=="}}}
Command-line
Can be run to transform values at the command-line, transforming stdin to stdout as
JSON. Pass -d to deserialise instead of serialise.
The following example uses AWS CLI (aws) to produce
DynamoDB values in lists of objects, jq to convert the
scan
result to full DynamoDB values, and dynamodb-serialise to convert to native types.
aws dynamodb scan \
--table-name my-table \
| jq '{ L: .Items | map({ M: . }) }' \
| python3 -m dynamodb_serialise -d
Release files for dynamodb-serialise 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dynamodb_serialise-1.1.0.tar.gz | 9.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dynamodb_serialise-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.5 kB
Release files / dynamodb_serialise-1.1.0.tar.gz
| Download URL | dynamodb_serialise-1.1.0.tar.gz |
|---|---|
| Size | 9.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
339526058a626af46a035f5117b0824b2d0ea31ce06a9ac644a8d79756c64605
|
|
BLAKE2b-256 checksum How to use checksums |
1363fd8c7f2ebb300deab61b0c9633e8ea6016049a10ed5a9c141d44d9028f52
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 2, 2025.
Transparency logRelease files / dynamodb_serialise-1.1.0-py3-none-any.whl
| Download URL | dynamodb_serialise-1.1.0-py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ceb2ee9bc1ea80d296a5dc99d02215e715ecfbbaaed2358399430bdf1478ad86
|
|
BLAKE2b-256 checksum How to use checksums |
1ce324ab04c764ebf42fda8547956ae4e97602dd253bc04b7e0fb2e365c450e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 2, 2025.
Transparency log