j40-cejst-2/data/data-pipeline/data_pipeline/etl/sources/tribal/etl_utils.py
Lucas Merrill Brown 6e6223cd5e
Issue 105: Configure and run black and other pre-commit hooks (clean branch) (#1962)
* Configure and run `black` and other pre-commit hooks

Co-authored-by: matt bowen <matthew.r.bowen@omb.eop.gov>
2022-10-04 18:08:47 -04:00

25 lines
580 B
Python

from pathlib import Path
from data_pipeline.utils import get_module_logger
from data_pipeline.utils import remove_all_from_dir
from data_pipeline.utils import remove_files_from_dir
logger = get_module_logger(__name__)
def reset_data_directories(
data_path: Path,
) -> None:
"""Empties all tribal files"""
tribal_data_path = data_path / "tribal"
# csv
csv_path = tribal_data_path / "csv"
remove_files_from_dir(
csv_path,
".csv",
)
# geojson
geojson_path = tribal_data_path / "geojson"
remove_all_from_dir(geojson_path)