utils
Utils init file
filter_json(json, filters)
#
Extension Method to Dictionaries, allows easy filtering
Parameters:
Name | Type | Description | Default |
---|---|---|---|
json |
dict
|
|
required |
filters |
Union[str, List[str]]
|
|
required |
Returns:
Name | Type | Description |
---|---|---|
filtered_object |
object
|
Resulting JSON Filtered Object |
Source code in camply/utils/api_utils.py
generate_url(scheme, netloc, path='', params='', query='', fragment='')
#
Build a URL
Parameters:
Name | Type | Description | Default |
---|---|---|---|
scheme |
str
|
URL scheme specifier |
required |
netloc |
str
|
Network location part |
required |
path |
str
|
Hierarchical path |
''
|
params |
str
|
Parameters for last path element |
''
|
query |
str
|
Query component |
''
|
fragment |
str
|
Fragment identifier |
''
|
Returns:
Name | Type | Description |
---|---|---|
url |
str
|
Compiled URL |
Source code in camply/utils/api_utils.py
log_camply(self, message, *args, **kwargs)
#
Custom Logging Notification Level for Pushover Logging
Between logging.ERROR and logging.CRITICAL (45)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
self |
Logger
|
|
required |
message |
str
|
Message String |
required |
args |
|
()
|
|
kwargs |
|
{}
|
Returns:
Type | Description |
---|---|
None
|
|
Source code in camply/utils/logging_utils.py
make_list(obj, coerce=None)
#
Make Anything An Iterable Instance
Parameters:
Name | Type | Description | Default |
---|---|---|---|
obj |
|
required | |
coerce |
Optional[Callable]
|
|
None
|
Returns:
Type | Description |
---|---|
List[object]
|
|