Internals#
Lower-level building blocks. Most users never need these directly.
HTTP client#
- class BaseClient(config=None, transport=None)[source]#
Sends GET requests to SGU through a transport and pages through results.
- Parameters:
- get(endpoint, params=None, base_url=None)[source]#
GET an endpoint, fetching every page of a FeatureCollection.
- Parameters:
- Return type:
- Returns:
JSON response data, with all features if the response was paginated
- Raises:
SGUConnectionError – If connection fails
SGUTimeoutError – If request times out
SGUAPIError – If API returns an error
pandas helpers#
Pandas utilities with optional dependency handling.
- exception PandasImportError(feature='this feature')[source]#
Raised when pandas functionality is used but pandas is not installed.
- check_pandas_available(feature='this feature')[source]#
Check if pandas is available and raise helpful error if not.
- Parameters:
feature (
str) – Description of the feature that requires pandas- Raises:
PandasImportError – If pandas is not available
- Return type:
- get_pandas()[source]#
Get pandas module with proper error handling.
- Return type:
- Returns:
The pandas module
- Raises:
PandasImportError – If pandas is not available