Skip to main content

AI-ready GIS toolkit for energy and subsurface workflows.

Project description

env-able

An open source spatial analysis library built for AI-driven GIS workflows. Designed to give AI systems like Claude reliable, hallucination-free tools for spatial operations in energy and subsurface contexts.

Install

pip install env-able

# with Databricks support
pip install env-able[databricks]

Usage

import env_able as env

Functions

env.pull(table, output=None, wkt_col=None, chunk_size=None, crs="EPSG:4326")

Pull a Databricks table or query to a local file, chunking around the row/byte limit automatically.

Databricks caps result sets (~4 096 rows for narrow tables, fewer when WKT columns are present). pull() paginates with LIMIT/OFFSET, assembles the complete dataset in memory, and writes it to disk in the requested format.

Parameters

  • table — fully-qualified table name (catalog.schema.table) or a complete SELECT query
  • output — destination file path; format inferred from extension (.gpkg, .geojson, .shp, .parquet, .csv, .xlsx). Omit to return a GeoDataFrame or DataFrame.
  • wkt_col — column containing WKT geometry strings. Auto-detected if omitted.
  • chunk_size — rows per Databricks query. Defaults to 512 (WKT) or 4 096 (tabular). Reduce if you hit payload errors on wide tables.
  • crs — CRS to assign geometry. Default EPSG:4326.

Environment variables required

DATABRICKS_HOST       # https://adb-<workspace-id>.azuredatabricks.net
DATABRICKS_TOKEN      # personal access token
DATABRICKS_HTTP_PATH  # /sql/1.0/warehouses/<warehouse-id>
import env_able as env

# pull a full table to GeoPackage
env.pull("catalog.schema.wells", "wells.gpkg")

# pull with a filter query
env.pull("SELECT * FROM catalog.schema.wells WHERE state = 'TX'", "wells_tx.gpkg")

# pull tabular (no geometry)
env.pull("catalog.schema.formations", "formations.csv")

# return in-memory without writing
gdf = env.pull("catalog.schema.leases", wkt_col="geom_wkt", crs="EPSG:4269")

env.Intersect(input_layer, intersect_layer, output=None)

Computes geometric intersection of input features against a polygon boundary.

  • input_layer — point, line, or polygon (file path or GeoDataFrame)
  • intersect_layer — polygon layer defining the intersection boundary
  • output — file path to save result (.gpkg, .shp, etc.) — omit to return a GeoDataFrame
import env_able as env
env.Intersect("wells.shp", "boundary.shp", "result.gpkg")

env.Buffer(input_layer, distance, unit="meters", output=None)

Buffers input features by a given distance and unit.

  • input_layer — point, line, or polygon (file path or GeoDataFrame)
  • distance — numeric buffer distance
  • unitmeters, km, miles, feet, usfeet, nautical miles
  • output — file path to save result — omit to return a GeoDataFrame
env.Buffer("wells.shp", 1, "miles", "wells_buffer.gpkg")

env.Clip(input_layer, clip_layer, output=None)

Clips input features to the extent of a polygon clip boundary.

  • input_layer — point, line, or polygon (file path or GeoDataFrame)
  • clip_layer — polygon layer defining the clip boundary
  • output — file path to save result — omit to return a GeoDataFrame
env.Clip("roads.shp", "county.shp", "roads_clipped.gpkg")

env.morph(input_path, output_path, **kwargs)

Universal format translation. Converts between shp, gpkg, gdb, csv, xlsx, xls, dbf, geojson, json with automatic CRS handling, field name fixes, and multi-layer support.

  • input_path — source file or geodatabase
  • output_path — destination file. Extension sets the format. Use trailing / for directory output (one file per layer). Use dot notation for named layers: roads.parcels.gpkg
  • x_col, y_col — column names for X/Y coordinates (auto-detected if not provided)
  • wkt_col — column containing WKT geometry (auto-detected if not provided)
  • crs — coordinate reference system e.g. EPSG:4326 (required for tabular → spatial)
env.morph("roads.shp", "roads.gpkg")
env.morph("county.gdb", "county.gpkg")
env.morph("county.gdb", "output_folder/")
env.morph("owners.csv", "owners.geojson", crs="EPSG:4269")
env.morph("owners.csv", "owners.shp", x_col="LONGITUDE", y_col="LATITUDE", crs="EPSG:4269")
env.morph("roads.gpkg", "roads.parcels.gpkg")
env.morph("data.json", "data.gpkg")

Smart behavior:

  • GDB / GPKG with multiple layers → detects all layers automatically
  • CRS mismatch → auto-reprojects
  • Shapefile field name limit (10 chars) → auto-truncates with warnings
  • Invalid output path → plain English error
  • Empty layers → skipped with a warning, not a crash

Changelog

v0.3.0 — 2026-07-14

  • pull() — paginated Databricks table fetch with WKT auto-detection and chunked assembly

v0.2.0 — 2026-07-14

  • Renamed import alias convention from e to env

v0.1.0 — 2026-07-14

  • Initial release of env-able
  • Intersect(), Buffer(), Clip() with full guardrails
  • morph() — universal format translation
  • Smart geometry detection for WKT and lat/lon columns
  • GeoJSON, JSON support with auto WGS84 reprojection
  • Multi-layer GDB/GPKG support

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

env_able-0.3.3.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

env_able-0.3.3-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file env_able-0.3.3.tar.gz.

File metadata

  • Download URL: env_able-0.3.3.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for env_able-0.3.3.tar.gz
Algorithm Hash digest
SHA256 399c57b2720f56bea257214353fa1ed4e73da0048e8b01844bb5e4d84ceccb47
MD5 db8be744b7e31662c50c391cc5a4b8d5
BLAKE2b-256 a62cbddb5f357c1ece80f8c71267fc72269402c5f632fb3b4ecf63a6d111d1ac

See more details on using hashes here.

File details

Details for the file env_able-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: env_able-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 16.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for env_able-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 829d8f80fa5d9ec40b4e456ee9f7a0e47ff839bafa7325073220a28e0ee470f4
MD5 16ec31f2745e450819fa4f3e8ed46e65
BLAKE2b-256 f8efb2dccac1938c031dfd7b8a545b8b50c1b1bac6e9d5701461709e9b2e6a73

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page