Skip to main content

A simple Google DataStore client

Project description

Simple DataStore Client

A simple Google DataStore client that exposes 3 functions.

def set_key(entity_name: str, key_name: str, **properties: Any) -> None:
    ...
def get_key(entity_name: str, key_name: str) -> Optional[Entity]:
    ...
def query_entity(
    entity_name: str,
    *query_filters: Tuple[str, str, Any],
    projection: List[str]=None,
    limit: Optional[int]=None,
) -> Iterator:
    ...

Examples

set_key

set_key(
    entity_name=RECHARGE_NOTES_ENTITY, 
    key_name=note_key, 
    username=username, 
    reference=reference, 
    note=notes,
)

get_key

get_key(LOGIN_ENTITY, username)

query_entity

product_list = list(query_entity(
    PRODUCT_ENTITY,
    ('network', '=', network_name),
    ('product_type', '=', product_code),
    ('bundle_size', '=', denomination),
    projection=['id'],
    limit=1,
))

print(product_list[0]['id'])

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

datastore_client-0.0.2.tar.gz (1.8 kB view hashes)

Uploaded Source

Built Distribution

datastore_client-0.0.2-py3-none-any.whl (2.7 kB view hashes)

Uploaded Python 3

Supported by

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