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
Changing the namespace
The following will change the namespace for all function calls following it.
from datastore_client.client import client
client.namespace = 'specific_namespace'
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
Release history Release notifications | RSS feed
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.3.tar.gz
(2.1 kB
view hashes)
Built Distribution
Close
Hashes for datastore_client-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78af10852a726c9689a28b44983b2c2fd144d3c9d2905af80c111efe784979a7 |
|
MD5 | 775543301b10d8885ab498238819104b |
|
BLAKE2b-256 | cb0ac315ef6ac9d9ac7178132f48ab93d2bb7a2e9c8fa27dd146a8a8b3277583 |