Docs home
ArcSmith documentation
ArcSmith is a Python library for building ArcPy toolboxes. It covers parameter state management, field mapping, workspace setup, and layer output through five focused modules.
-
arcsmith.param
Named helpers for
updateParameters. Parameter state detection, cascade resets, dropdown population, and controlling groups of dependent parameters. -
arcsmith.lyr
Add layers to a map with optional
.lyrxsymbology, apply symbology to existing layers, retrieve or remove layers by name or source. -
arcsmith.ws
Create the output geodatabase and its parent folder in one call. Route intermediate outputs to
memoryor scratch GDB with a single flag. -
arcsmith.fc
Build SQL WHERE clauses with automatic delimiting and quoting. Export filtered subsets, copy with field and row filters, validate geometry, and compute area.
-
arcsmith.flds
Build field mappings, keep or drop fields when copying, standardize blank values, and list column names or unique values for dropdown population.
Function references
All functions listed alphabetically within each module.
arcsmith.param
Named helpers for updateParameters. Covers parameter state detection, cascade resets, dropdown population, and controlling groups of dependent parameters.
| Function | Description |
|---|---|
cascade_clear |
Clear downstream parameters the moment an upstream value changes |
cascade_populate |
Assign a value to downstream parameters when an upstream value changes |
checkbox_dependence |
Show, hide, and seed parameters controlled by a checkbox |
drop_populate |
Fill a parameter's dropdown list |
dynamic_dropdown |
Enable and disable parameter groups based on a dropdown selection |
state |
Translate altered + hasBeenValidated into a single readable state string |
to_path |
Resolve a feature class or layer parameter to its catalog path |
arcsmith.lyr
Add layers to a map with optional .lyrx symbology, apply symbology to existing layers, and retrieve or remove layers by display name or data source path.
| Function | Description |
|---|---|
add |
Add a data source to a map as a new layer, with optional symbology and display name |
apply_lyrx |
Apply .lyrx symbology to layers already in the map, matched by name or source |
get_lyr |
Retrieve layers from the map TOC by display name or data source path |
remove |
Remove layers from the map TOC by display name or data source path |
arcsmith.ws
Create the output geodatabase and its parent folder in one call. Route intermediate outputs to memory or scratch GDB by flipping a single flag.
| Function | Description |
|---|---|
init_gdb |
Create a file geodatabase, creating the parent folder if needed |
temp_space |
Return a workspace path for intermediate outputs, either memory or scratch GDB |
arcsmith.fc
Build SQL WHERE clauses with automatic field delimiting and value quoting. Export filtered subsets, copy with combined field and row filters, validate geometry types, and compute polygon area.
| Function | Description |
|---|---|
build_where |
Build a SQL WHERE clause for a single field, handling delimiters and quoting automatically |
copy_w_fields |
Copy a feature class with optional field and row filtering in a single call |
export_where |
Export a filtered subset of a feature class using a WHERE clause |
get_area |
Return the area of a polygon feature class with optional unit conversion |
to_gdb |
Copy a feature class into a geodatabase |
validate_geom_type |
Check whether a feature class has an expected geometry type |
arcsmith.flds
Build field mappings, keep or drop fields when copying a feature class, standardize blank values across string fields, and list column names or unique values for dropdown population.
| Function | Description |
|---|---|
build_field_map |
Build a FieldMappings object retaining or dropping specified fields |
clean_blanks |
Standardize blank-like values in string fields to a single canonical value |
list_cols |
Return the field names present in a feature class |
unique_values |
Return the unique values or value combinations present in one or more fields |