|
def | factory (ctor, data) |
| Returns object constructed with data dictionary. More...
|
|
def | is_dataobject (obj) |
| Returns whether input is a data object: namedtuple, or has attributes or slots. More...
|
|
def | is_namedtuple (obj) |
| Returns whether input is a namedtuple class or instance. More...
|
|
def | json_dumps (data, indent=2, sort_keys=True) |
| Returns JSON string, with datetime types converted to ISO-8601 strings (in UTC if no timezone set), sets converted to lists, and Decimal objects converted to float or int. More...
|
|
def | json_loads (s) |
| Returns deserialized JSON, with datetime/date strings converted to objects. More...
|
|
def | keyvalues (obj, namefmt=None) |
| Returns a list of keys and values, or [given object] if not applicable. More...
|
|
def | load_modules () |
| Returns db engines loaded from file directory, as {name: module}. More...
|
|
def | nameify (val, namefmt=None, parent=None) |
| Returns value as table or column name string. More...
|
|
def | parse_datetime (s) |
| Tries to parse string as ISO8601 datetime, returns input on error. More...
|
|
def dblite.util.json_dumps |
( |
|
data, |
|
|
|
indent = 2 , |
|
|
|
sort_keys = True |
|
) |
| |
Returns JSON string, with datetime types converted to ISO-8601 strings (in UTC if no timezone set), sets converted to lists, and Decimal objects converted to float or int.
Returns None if data is None.
Definition at line 98 of file util.py.