compass.utilities.base.Directories#

class Directories(out, logs=None, clean_files=None, ordinance_files=None, jurisdiction_dbs=None, collect_only=False)[source]#

Bases: object

Encapsulate filesystem locations used by a COMPASS run

The helper centralizes directory computations so downstream code can rely on fully resolved pathlib.Path instances for logging, cleaned text, downloaded ordinances, and intermediate databases.

Notes

All provided paths are expanded to absolute form when the class is instantiated, guaranteeing consistent behavior across relative and user-expanded paths.

Parameters:
  • out (path-like) – Output directory for COMPASS run.

  • logs (path-like, optional) – Directory for storing logs. If not specified, defaults to out/logs. By default, None.

  • clean_files (path-like, optional) – Directory for storing cleaned ordinance files. If not specified, defaults to out/cleaned_text. By default, None.

  • ordinance_files (path-like, optional) – Directory for storing ordinance files. If not specified, defaults to out/ordinance_files. By default, None.

  • jurisdiction_dbs (path-like, optional) – Directory for storing jurisdiction databases. If not specified, defaults to out/jurisdiction_dbs. By default, None

  • collect_only (bool, optional) – Flag indicating whether the run is a collection-only run. If True, the default directories for cleaned text and ordinance files are changed to out/parsed_docs and out/source_docs, respectively. By default, False.

Methods

make_dirs()

Create the managed directories if they do not exist

make_dirs()[source]#

Create the managed directories if they do not exist