Skip to content

GeoRegionRetriever

CorylC edited this page May 2, 2024 · 2 revisions

GeoRegionRetriever Class Documentation

Overview

The GeoRegionRetriever class in the openmindat package is designed to facilitate the retrieval of locality geoRegion data from the Mindat API.

Usage

Create an instance of the GeoRegionRetriever class and use its methods to retrieve data.

Example

from openmindat import GeoRegionRetriever

Grr = GeoRegionRetriever()
Grr.page(3).saveto("/path/to/directory", "geoReg_page3")

Methods

page(PAGE)

Sets the page number for paginated results.

  • Parameters:
    • PAGE (int): The page number.
  • Example Usage:
    grr.page(2)

page_size(PAGE_SIZE)

Sets the number of results per page.

  • Parameters:
    • PAGE_SIZE (int): The number of results per page.
  • Example Usage:
    grr.page_size(50)

saveto(OUTDIR, FILE_NAME)

Executes the query and saves the results to a specified directory.

  • OUTDIR (str): Directory path.
  • FILE_NAME (str): file name.
  • Returns: None

save(FILE_NAME)

Executes the query and saves the results to the current directory.

  • FILE_NAME (str): file name
  • Returns: None

get_dict()

Executes the query and saves the results to an object.

  • Returns: Dictionary

Additional Information

For more details, please refer to the Mindat API documentation.

Back to Top