Skip to content

DanaRetriever

CorylC edited this page May 12, 2024 · 1 revision

DanaRetriever Class Documentation

Overview

The DanaRetriever class in the openmindat package is designed for querying Dana-8 classification data based on different standards.

Usage

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

Example

from openmindat import DanaRetriever

dr = DanaRetriever()
dr.families().saveto("/path/to/directory", "DanaFamilies")

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
dr = DanaRetriever()
dr.page_size(1500)
dr.save()

retrieve()

Sets the search query to it's base results.

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

id(ID)

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

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

groups()

Sets the search to return dana-8 groups standards.

  • Returns: self
  • Example Usage:
    dr.groups()

subgroups()

Sets the search to return dana-8 subgroup standards.

  • Returns: self
  • Example Usage:
    dr.subgroups()

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