Add YAPF style + ignore, and format tracked Python files
This commit is contained in:
23
API/loc.py
23
API/loc.py
@@ -47,8 +47,10 @@ class LOCClient:
|
||||
*,
|
||||
start: int = 1,
|
||||
count: int = 25,
|
||||
extra_params: Optional[Dict[str, Any]] = None,
|
||||
) -> Dict[str, Any]:
|
||||
extra_params: Optional[Dict[str,
|
||||
Any]] = None,
|
||||
) -> Dict[str,
|
||||
Any]:
|
||||
"""Search the Chronicling America collection via LoC JSON API.
|
||||
|
||||
Args:
|
||||
@@ -63,14 +65,17 @@ class LOCClient:
|
||||
|
||||
q = str(query or "").strip()
|
||||
if not q:
|
||||
return {"results": []}
|
||||
return {
|
||||
"results": []
|
||||
}
|
||||
|
||||
params: Dict[str, Any] = {
|
||||
"q": q,
|
||||
"fo": "json",
|
||||
"c": int(count) if int(count) > 0 else 25,
|
||||
"sp": int(start) if int(start) > 0 else 1,
|
||||
}
|
||||
params: Dict[str,
|
||||
Any] = {
|
||||
"q": q,
|
||||
"fo": "json",
|
||||
"c": int(count) if int(count) > 0 else 25,
|
||||
"sp": int(start) if int(start) > 0 else 1,
|
||||
}
|
||||
if extra_params:
|
||||
for k, v in extra_params.items():
|
||||
if v is None:
|
||||
|
||||
Reference in New Issue
Block a user