restgdf.utils

restgdf.utils.crawl

async restgdf.utils.crawl.fetch_all_data(session: ClientSession, base_url: str, token: str | None = None) dict[source]

Fetch all services and their layers in a highly concurrent manner.

restgdf.utils.getgdf

Get a GeoDataFrame from an ArcGIS FeatureLayer.

async restgdf.utils.getgdf.chunk_generator(url: str, session: ClientSession, **kwargs) AsyncGenerator[GeoDataFrame, None][source]
async restgdf.utils.getgdf.concat_gdfs(gdfs: list[GeoDataFrame]) GeoDataFrame[source]
async restgdf.utils.getgdf.gdf_by_concat(url: str, session: ClientSession, **kwargs) GeoDataFrame[source]
async restgdf.utils.getgdf.get_gdf(url: str, session: ClientSession | None = None, where: str | None = None, token: str | None = None, **kwargs) GeoDataFrame[source]
async restgdf.utils.getgdf.get_gdf_list(url: str, session: ClientSession, **kwargs) list[GeoDataFrame][source]
async restgdf.utils.getgdf.get_sub_gdf(url: str, session: ClientSession, offset: int, **kwargs) GeoDataFrame[source]

restgdf.utils.getinfo

A package for getting GeoDataFrames from ArcGIS FeatureLayers.

restgdf.utils.getinfo.default_data(data: dict | None = None, default_dict: dict | None = None) dict[source]

Return a dict with default values for ArcGIS REST API requests.

async restgdf.utils.getinfo.get_feature_count(url: str, session: ClientSession, **kwargs) int[source]

Get the feature count for a layer.

restgdf.utils.getinfo.get_max_record_count(metadata: dict) int[source]

Get the maximum record count for a layer.

async restgdf.utils.getinfo.get_metadata(url: str, session: ClientSession, token: str | None = None, **kwargs) dict[source]

Get the JSON dict for a layer.

restgdf.utils.getinfo.get_name(metadata: dict) str[source]

Get the name of a layer.

async restgdf.utils.getinfo.get_offset_range(url: str, session: ClientSession, **kwargs) range[source]

Get the offset range for a layer.

restgdf.utils.getinfo.getfields(layer_metadata: dict, types: bool = False)[source]

Get the fields of a layer.

restgdf.utils.getinfo.getfields_df(layer_metadata: dict) DataFrame[source]

Get the fields of a layer as a DataFrame.

async restgdf.utils.getinfo.getuniquevalues(url: str, fields: tuple | str, session: ClientSession, sortby: str | None = None, **kwargs) list | DataFrame[source]

Get the unique values for a field.

async restgdf.utils.getinfo.getvaluecounts(url: str, field: str, session: ClientSession, **kwargs) DataFrame[source]

Get the value counts for a field.

async restgdf.utils.getinfo.nestedcount(url: str, fields, session: ClientSession, **kwargs) DataFrame[source]

Get the nested value counts for a field.

async restgdf.utils.getinfo.service_metadata(session: ClientSession, service_url: str, token: str | None = None) dict[source]

Asynchronously retrieve layers for a single service.

restgdf.utils.utils

restgdf.utils.utils.ends_with_num(url: str) bool[source]

Return True if the given URL ends with a number.

restgdf.utils.utils.where_var_in_list(var: str, vals: Iterable[str]) str[source]

Return a where clause for a variable in a list of values.