Skip to content

StrunzRetriever

CorylC edited this page May 12, 2024 · 1 revision

StrunzRetriever Class Documentation

Overview

The StrunzRetriever class in the openmindat package is designed for querying nickel-strunz-10 classification data based on different standards.

Usage

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

Example

from openmindat import StrunzRetriever

sr = StrunzRetriever()
sr.subclasses().saveto("/path/to/directory", "StrunzSubClasses")

Methods

page_size(PAGE_SIZE)

Determines the amount of results that can be queried for each page.

  • PAGE_SIZE (int): number of results per page.
  • Returns: self
    sr = StrunzRetriever()
    sr.page_size(1500)
    sr.save()

retrieve()

Sets the search query to it's base results.

  • Returns: self
  • Example Usage:
    sr.retrieve()

id(ID)

Sets the search to be based off of a given id.

  • ID (int): id to search by
  • Returns: self
  • Example Usage:
    sr.id(3)

classes()

Sets the search to return nickel-strunz-10 class standards.

  • Returns: self
  • Example Usage:
    sr.classes()

subclasses()

Sets the search to return nickel-strunz-10 subclass standards.

  • Returns: self
  • Example Usage:
    sr.subclasses()

families()

Sets the search to return nickel-strunz-10 family classifications.

  • Returns: self
  • Example Usage:
    sr.families()

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