Spaces:
Sleeping
Sleeping
Download core/analysis.py from GodsDevProject/FOIA_Doc_Search: direct link, hf CLI and curl.
- Browser
- Download file 301 Bytes
-
https://huggingface.co/spaces/GodsDevProject/FOIA_Doc_Search/resolve/main/core/analysis.py
- Command line
-
hf download hf://spaces/GodsDevProject/FOIA_Doc_Search/core/analysis.py
-
curl -L -o analysis.py https://huggingface.co/spaces/GodsDevProject/FOIA_Doc_Search/resolve/main/core/analysis.py
301 Bytes
| from typing import Dict, List | |
| def build_timeline(docs: List[dict]) -> Dict[str, int]: | |
| timeline: Dict[str, int] = {} | |
| for d in docs: | |
| year = d.get("date", "")[:4] | |
| if not year.isdigit(): | |
| continue | |
| timeline[year] = timeline.get(year, 0) + 1 | |
| return timeline |