-
Notifications
You must be signed in to change notification settings - Fork 2
LocalitiesTypeRetriever
CorylC edited this page May 2, 2024
·
2 revisions
The LocalitiesTypeRetriever
class in the openmindat
package is designed for querying locality data from the Mindat API. The class supports method chaining for flexible query building and provides functionalities to save the queried data.
Create an instance of the LocalitiesTypeRetriever
class and use its methods to set up your search and retrieve data.
from openmindat import LocalitiesTypeRetriever
ltr = LocalitiesTypeRetriever()
ltr.page(9).saveto("/path/to/directory", "page9_locType")
Sets the page number for paginated results.
-
Parameters:
-
PAGE (int)
: The page number.
-
-
Example Usage:
Ltr.page(2)
Sets the number of results per page.
-
Parameters:
-
PAGE_SIZE (int)
: The number of results per page.
-
-
Example Usage:
Ltr.page_size(50)
Executes the query and saves the results to a specified directory.
-
OUTDIR
(str): Directory path. -
FILE_NAME
(str): file name. - Returns: None
Executes the query and saves the results to the current directory.
-
FILE_NAME
(str): file name - Returns: None
Executes the query and saves the results to an object.
- Returns: Dictionary
For more details, please refer to the Mindat API documentation.