example module
A one-line summary of the module or program, terminated by a period.
Leave one blank line. The rest of this docstring should contain an overall description of the module or program. Optionally, it may also contain a brief description of exported classes and functions and/or usage examples.
Typical usage example:
foo = ClassFoo() bar = foo.FunctionBar()
- class example.SampleClass(likes_spam=False)
Bases:
objectSummary of class here.
Longer class information… Longer class information…
- Parameters:
likes_spam (bool)
- likes_spam
A boolean indicating if we like SPAM or not.
- eggs
An integer count of the eggs we have laid.
- public_method()
Performs operation blah.
- example.fetch_smalltable_rows(table_handle, keys, require_all_keys=False)
Fetches rows from a Smalltable.
Retrieves rows pertaining to the given keys from the Table instance represented by table_handle. String keys will be UTF-8 encoded.
- Parameters:
table_handle (dict) – An open smalltable.Table instance.
keys (Sequence[bytes | str]) – A sequence of strings representing the key of each table row to fetch. String keys will be UTF-8 encoded.
require_all_keys (bool) – If True only rows with values set for all keys will be returned.
- Returns:
A dict mapping keys to the corresponding table row data fetched. Each row is represented as a tuple of strings. For example:
- {b’Serak’: (‘Rigel VII’, ‘Preparer’),
b’Zim’: (‘Irk’, ‘Invader’), b’Lrrr’: (‘Omicron Persei 8’, ‘Emperor’)}
Returned keys are always bytes. If a key from the keys argument is missing from the dictionary, then that row was not found in the table (and require_all_keys must have been False).
- Raises:
IOError – An error occurred accessing the smalltable.
- Return type:
Mapping[bytes, tuple[str, …]]