Skip to main content

No project description provided

Project description

dynamodb-python

Installation

pip install dynamodb-python

Requirements

Dependencies

  • python = "^3.9"
  • ddbcereal
  • botocore
  • boto3
  • requests

Credentials

You will first need to set your AWS credentials. Since this library uses boto3 under the hood, you can use the same methods as described in the boto3 documentation. In short, AWS looks for credentials in these places:

  1. Environment variables
  2. Shared credentials file (~/.aws/credentials)
  3. AWS config file (~/.aws/config)

You cacn also pass a dictionary to DynamoDB class:

from dynamodb_python import DynamoDB

dynamodb = DynamoDB(credentials={
    "aws_access_key_id": ACCESS_KEY,
    "aws_secret_access_key": SECRET_KEY,
    "aws_session_token": SESSION_TOKEN
})

How to use

Having a table called table_name, you can access it like this:

from dynamodb_python import DynamoDB

dynamodb = DynamoDB()
table = dynamodb.table_name

And then you can get an item like this:

table.read_item(key={"partition_key": "key", "sort_key": "sort_key" })  # NOTE that sort_key is optional

Or you can get a list of items with the same key like this:

table.read_items(key={"partition_key": "key"})  # NOTE that you can also pass in boto3 condition key 

Or you can write an item like this:

table.write(key={"partition_key": "key", "sort_key": "sort_key"}, data={"data": "data"})

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

dynamodb_python-0.1.4.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dynamodb_python-0.1.4-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file dynamodb_python-0.1.4.tar.gz.

File metadata

  • Download URL: dynamodb_python-0.1.4.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.9.16 Darwin/23.2.0

File hashes

Hashes for dynamodb_python-0.1.4.tar.gz
Algorithm Hash digest
SHA256 46bf3755edfeccc11654e29b615f2ec20fe8e4eaad081184a258731379df2447
MD5 4ec273379aca4cc8f58f0734b9d61470
BLAKE2b-256 2a97fd83a586c0c9e8e9d3426336e8c147a2fdcd33628e66b9fbf72f7a8d2617

See more details on using hashes here.

File details

Details for the file dynamodb_python-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: dynamodb_python-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.9.16 Darwin/23.2.0

File hashes

Hashes for dynamodb_python-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 20d730595af0d2042129f8369371b0e3a9aaa2540279c366026c3b4aee656eab
MD5 d9624693c13b859c8fe032fb1b4d6ca3
BLAKE2b-256 4f34a8df299b1322781e7521ac621a01a640c0d1828a8af654ccbba45d870a28

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page