-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also finishes up the workbook demo
- Loading branch information
Showing
19 changed files
with
152 additions
and
41 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import requests | ||
import os | ||
from collections import defaultdict | ||
from math import floor | ||
from pprint import pprint | ||
|
||
continuing = True | ||
|
||
all_results = [] | ||
start = 0 | ||
limit = 20000 | ||
while continuing: | ||
req = requests.get("https://api.fac.gov/general", | ||
params = { | ||
"select": "auditee_uei,audit_year", | ||
"audit_year": "eq.2023", | ||
"offset": start | ||
}, | ||
headers = { | ||
"x-api-key": os.getenv("API_GOV_KEY") | ||
} | ||
) | ||
if req.json() == []: | ||
continuing = False | ||
else: | ||
all_results = all_results + req.json() | ||
start += limit | ||
|
||
dups = defaultdict(int) | ||
|
||
print(f"Found: {len(req.json())}") | ||
for rec in all_results: | ||
key = rec["auditee_uei"] + "-" + rec["audit_year"] | ||
dups[key] += 1 | ||
|
||
# This produces something like: | ||
# | ||
# ABC-2023: 3 | ||
# DEF-2023: 1 | ||
# XYZ-2023: 9 | ||
# ... | ||
|
||
resub = defaultdict(int) | ||
for k, v in dups.items(): | ||
resub[v] += 1 | ||
|
||
# This now counts how many of each count: | ||
|
||
# 1: 28323 | ||
# 2: 260 | ||
# 3: 41 | ||
# 4: 1 | ||
# 5: 1 | ||
# 9: 2 | ||
|
||
for k, v in dups.items(): | ||
if v > 2: | ||
print(f"{k}: {v}") | ||
|
||
|
||
for k, v in sorted(resub.items(), key=lambda kv: kv[0]): | ||
print(f"{k} {'re' if k > 1 else ''}submission{'s' if k > 1 else ''}: {v}") | ||
|
||
resub_count = 0 | ||
for k, v in dups.items(): | ||
if v > 1: | ||
resub_count += 1 | ||
|
||
print(f"total: {len(dups)} resub: {resub_count}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.venv | ||
dist/ | ||
*.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"jupyter-lite-schema-version": 0, | ||
"jupyter-config-data": { | ||
"appName": "FAC Labs", | ||
"collaborative": false, | ||
"exposeAppInBrowser": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,26 @@ | ||
{ | ||
"LiteBuildConfig": { | ||
"contents": ["notebooks"], | ||
"output_dir": "dist" | ||
"LiteBuildConfig": { | ||
"contents": ["notebooks"], | ||
"output_dir": "dist", | ||
"extra_file_types": { | ||
"xlsx": { | ||
"name": "xlsx", | ||
"extensions": [".xlsx"], | ||
"mimeTypes": ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"], | ||
"fileFormat": "application" | ||
}, | ||
"docx": { | ||
"name": "docx", | ||
"extensions": [".docx"], | ||
"mimeTypes": ["application/vnd.openxmlformats-officedocument.wordprocessingml.document"], | ||
"fileFormat": "application" | ||
}, | ||
"pdf": { | ||
"name": "pdf", | ||
"extensions": [".pdf"], | ||
"mimeTypes": ["application/pdf"], | ||
"fileFormat": "application" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters