api_utils
Recreation.gov Web Searching Utilities
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 |