fied.tools package¶
Submodules¶
fied.tools.misc_tools module¶
- class FRS_API(huc_only=True)[source]¶
Bases:
object
- find_huc(registryID, huc='HUC_8')[source]¶
Calls EPA API for finding USGS Watershed Boundary Dataset information for a passed FRS ID. See https://www.epa.gov/frs/frs-rest-services#get_facilities_wbd
- parallelize_api(method, data)[source]¶
Method for parallelizing API call methods
- Parameters:
method – API call method
data – Data to pass to mthod
- Returns:
results – List of results from API calls
- Return type:
- find_huc_parallelized(final_data)[source]¶
Parallelized API call to get HUC codes based on FRS Registry IDs
- Parameters:
final_data (pandas.DataFrame)
- Returns:
results – List of dictionaries with registryID, HUC as key, value pairs
- Return type:
- find_facility_program_data(registryID)[source]¶
” Get basic facility program data from EPA’s Facility Registry Service (FRS) API.
- Parameters:
registryID (int) – Facility ID
- Returns:
data
- Return type:
json
- query_program_facility(registryID)[source]¶
Use EPA FRS Query API (requires registration for user ID and password)
fied.tools.naics_matcher module¶
- naics_matcher(naics_column, naics_vintage=2017)[source]¶
Method for matching aggregated NAICS codes (i.e., <6 digit) with 6-digit NAICS codes.
- Parameters:
naics_column (pandas.Series) – Series of NAICS codes to match to 6-digit NAICS.
naics_vintage (int; 2007, 2012, 2017, or 2022) – Year of NAICS codes
- Returns:
ncmatch – Original NAICS matched to 6-digit versions.
- Return type:
pandas.DataFrame