file_manager package

Subpackages

Submodules

file_manager.base_file_manager module

class file_manager.base_file_manager.BaseFileManager(scale, object_name, script_source_name='', description='')[source]

Bases: object

The core file manager class handles the creation of absolute paths across our project, imported in different file managers.

Functions:
generate_file_name_gdb (str, str) -> str:

Generates the absolute path for files that can be stored in geodatabases (gdb).

generate_file_name_general_files (str, str, str) -> str:

Generates the absolute path for files that cannot be stored in geodatabases, specifying its file type.

generate_file_name_lyrx (str, str) -> str:

Generates the absolute path for ArcGIS layer files (.lyrx) that cannot be stored in geodatabases.

local_root_directory

The local root directory for the project’s output.

Type:

str

project_root_directory

The root directory name of the project.

Type:

str

general_files_directory_name

The directory name for storing general files.

Type:

str

lyrx_directory_name

The directory name for storing ArcGIS layer files (.lyrx).

Type:

str

Parameters:
  • scale (str) – The scale of the geospatial data, used to differentiate directories and file names. Needs to be defined when imported.

  • object_name (str) – The name of the geospatial object, used to differentiate directories and file names. Needs to be defined when imported.

This class provides methods to generate standardized absolute paths for geodatabase files, general files, and layer files, using the project’s naming conventions and directory structure.

local_root_directory = 'C:\\path\\to\\folder\\you\\want\\your\\outputs\\in'
project_root_directory = 'ag_outputs'
general_files_directory_name = 'general_files'
lyrx_directory_name = 'lyrx_outputs'
property script_source_name
property description
validate_inputs(*args)[source]

Uses the validate_input method to validate the input.

generate_file_name_gdb(script_source_name: str, description: str)[source]

Generates a file path for geodatabase (.gdb) files. After validating the input.

Parameters:
  • script_source_name (str) – The name of the script or source generating the file.

  • description (str) – A brief description of the file’s purpose or contents.

Returns:

The absolute path for the .gdb file.

Return type:

str

generate_file_name_general_files(script_source_name: str, description: str, file_type: str)[source]

Generates a file path for general files (e.g., CSV, TXT). After validating the input.

Parameters:
  • script_source_name (str) – The name of the script or source generating the file.

  • description (str) – A brief description of the file’s purpose or contents.

  • file_type (str) – The filetype extension (without dot).

Returns:

The absolute path for the general file, including the file extension.

Return type:

str

generate_file_name_general_directory(script_source_name: str, description: str, file_type: str)[source]

Generates a file path for general files (e.g., CSV, TXT). After validating the input.

Parameters:
  • script_source_name (str) – The name of the script or source generating the file.

  • description (str) – A brief description of the file’s purpose or contents.

  • file_type (str) – The filetype extension (without dot).

Returns:

The absolute path for the general file, including the file extension.

Return type:

str

generate_file_name_lyrx(script_source_name: str, description: str)[source]

Generates a file path for ArcGIS layer files (.lyrx). After validating the input.

Parameters:
  • script_source_name (str) – The name of the script or source generating the file.

  • description (str) – A brief description of the layer file’s purpose or contents.

Returns:

The absolute path for the .lyrx file.

Return type:

str

generate_file_lyrx_directory(script_source_name: str, description: str)[source]

Generates a file path for ArcGIS layer files (.lyrx). After validating the input.

Parameters:
  • script_source_name (str) – The name of the script or source generating the file.

  • description (str) – A brief description of the layer file’s purpose or contents.

Returns:

The absolute path for the .lyrx file.

Return type:

str

generate_final_outputs(file_name: str)[source]

Generates a file path for geodatabase (.gdb) files for the final output files. After validating the input.

Parameters:

file_name (str) – The name of the file name for the final output file.

Returns:

The absolute path for the .gdb file.

Return type:

str

Module contents