fieldnames_from_geojson#

To grab the header lines from all the CSV files and parse to get fieldnames” This code is mostly from GitHub copilot 3/26/2025

Attributes#

Functions#

find_geojson_files(directory)

Find all the GeoJSON files in a Path.

main(directory)

Accumulate all the attributes in a directory tree and parse for unique fieldnames.

read_attribute_names(file_path)

Collect a list of unique attribute names in a GeoJSON file.

Module Contents#

fieldnames_from_geojson.find_geojson_files(directory)#

Find all the GeoJSON files in a Path.

Parameters:

directory (pathlib.Path)

Return type:

list[pathlib.Path]

fieldnames_from_geojson.main(directory)#

Accumulate all the attributes in a directory tree and parse for unique fieldnames.

Parameters:

directory (pathlib.Path)

Return type:

None

fieldnames_from_geojson.read_attribute_names(file_path)#

Collect a list of unique attribute names in a GeoJSON file.

Parameters:

file_path (pathlib.Path)

Return type:

list[str]

fieldnames_from_geojson.directory#