Skip to content

MineralsIdRetriever

CorylC edited this page May 2, 2024 · 3 revisions

MineralsIdRetriever Class Documentation

Overview

The MineralsIdRetriever class in the openmindat package is designed for querying Mineral_Ima data from the Mindat API by Id. The class supports method chaining for flexible query building and provides functionalities to save the queried data.

Usage

Create an instance of the MineralsIdRetriever class and use its methods to set up your search Id and retrieve data.

Example

from openmindat import MineralsIdRetriever

midr = MineralsIdRetriever()
midr.id(3).saveto("/path/to/directory", "Mineral_Ima_3")

Methods

id(ID)

Declares Id to search for.

  • ID (int): specified Id.
  • Returns: self

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

Clone this wiki locally