dql.models module

Data containers

class dql.models.GlobalIndex(name, index_type, status, hash_key, range_key, read_throughput, write_throughput, size, item_count, includes=None)[source]

Bases: object

Container for global index data

classmethod from_description(description, attrs)[source]

Create an object from a boto response

pformat()[source]

Pretty format for insertion into table pformat

schema[source]

The DQL fragment for constructing this index

class dql.models.IndexField(name, data_type, index_type, index_name, includes=None)[source]

Bases: dql.models.TableField

A TableField that is also part of a Local Secondary Index

schema[source]

The DQL syntax for creating this item

class dql.models.TableField(name, data_type, key_type=None)[source]

Bases: object

A DynamoDB table attribute

Parameters:

name : str

data_type : str

The type of object (e.g. ‘STRING’, ‘NUMBER’, etc)

key_type : str, optional

The type of key (e.g. ‘RANGE’, ‘HASH’, ‘INDEX’)

index_name : str, optional

If the key_type is ‘INDEX’, this will be the name of the index that uses the field as a range key.

schema[source]

The DQL syntax for creating this item

to_index(index_type, index_name, includes=None)[source]

Create an index field from this field

class dql.models.TableMeta(name, status, attrs, global_indexes, read_throughput, write_throughput, decreases_today, size, item_count)[source]

Bases: object

Container for table metadata

Parameters:

name : str

status : str

attrs : dict

Mapping of attribute name to :class:`.TableField`s

global_indexes : dict

Mapping of hash key to GlobalIndex

read_throughput : int

write_throughput : int

decreases_today : int

consumed_read_capacity : int

May be None if unknown

consumed_write_capacity : int

May be None if unknown

size : int

Size of the table in bytes

item_count : int

Number of items in the table

decreases_remaining[source]

Number of remaining times you may decrease throughput today

classmethod from_description(description)[source]

Factory method that uses the boto ‘describe’ return value

pformat()[source]

Pretty string format

primary_key(hkey, rkey=None)[source]

Construct a primary key dictionary

You can either pass in a (hash_key[, range_key]) as the arguments, or you may pass in an Item itself

schema[source]

The DQL query that will construct this table’s schema

total_read_throughput[source]

Combined read throughput of table and global indexes

total_write_throughput[source]

Combined write throughput of table and global indexes

Read the Docs v: 0.1.0
Versions
latest
0.1.0
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.