CollectionSearch Subclasses¶
Collection-specific subclasses are the recommended public entry points.
Each class inherits CollectionSearch behavior while preconfiguring a collection target.
Choosing a Subclass¶
- Pick the subclass matching the record type you want to query.
- Use inherited methods such as
get_record_by_id,get_record_by_attribute,get_record_by_filter, andget_records. - See Using MongoDB Filters for query construction and operator examples.
- NMDC Schema reference: https://microbiomedata.github.io/nmdc-schema/
- Typecode-to-class map: https://microbiomedata.github.io/nmdc-schema/typecode-to-class-map/
Biosample and Study Related¶
These classes focus on study-level and site-level discovery. Use them when starting from study metadata, biosamples, or collection events.
BiosampleSearch
¶
BiosampleSearch(api_base_url: str = 'https://api.microbiomedata.org', env: str = '')
Bases: nmdc_client.collection_search.CollectionSearch, nmdc_client.lat_long_filters.LatLongFilters
Class to interact with the NMDC API to search for records within the biosample_set collection.
Warnings
The env parameter is deprecated. Use api_base_url instead.
Source code in nmdc_client/biosample_search.py
26 27 28 29 30 31 | |
StudySearch
¶
StudySearch(api_base_url: str = 'https://api.microbiomedata.org', env: str = '')
Bases: nmdc_client.collection_search.CollectionSearch
Class to interact with the NMDC API to search for records within the study_set collection.
Warnings
The env parameter is deprecated. Use api_base_url instead.
Source code in nmdc_client/study_search.py
17 18 19 20 21 22 | |
CollectingBiosamplesFromSiteSearch
¶
CollectingBiosamplesFromSiteSearch(api_base_url: str = 'https://api.microbiomedata.org', env: str = '')
Bases: nmdc_client.collection_search.CollectionSearch
Class to interact with the NMDC API to search for records within the collecting_biosamples_from_site_set collection.
Warnings
The env parameter is deprecated. Use api_base_url instead.
Source code in nmdc_client/collecting_biosamples_from_site_search.py
18 19 20 21 22 23 | |
FieldResearchSiteSearch
¶
FieldResearchSiteSearch(api_base_url: str = 'https://api.microbiomedata.org', env: str = '')
Bases: nmdc_client.lat_long_filters.LatLongFilters, nmdc_client.collection_search.CollectionSearch
Class to interact with the NMDC API to search for records within the field_research_site_set collection.
Warnings
The env parameter is deprecated. Use api_base_url instead.
Source code in nmdc_client/field_research_site_search.py
18 19 20 21 22 23 | |
Sample Processing Related¶
These classes target records produced through sample processing lifecycle, including processed sample entities and upstream material/storage processes. Use NMDC Schema docs to confirm class semantics and filterable fields.
ProcessedSampleSearch
¶
ProcessedSampleSearch(api_base_url: str = 'https://api.microbiomedata.org', env: str = '')
Bases: nmdc_client.collection_search.CollectionSearch
Class to interact with the NMDC API to search for records within the processed_sample_set collection.
Warnings
The env parameter is deprecated. Use api_base_url instead.
Source code in nmdc_client/processed_sample_search.py
17 18 19 20 21 22 | |
MaterialProcessingSearch
¶
MaterialProcessingSearch(api_base_url: str = 'https://api.microbiomedata.org', env: str = '')
Bases: nmdc_client.collection_search.CollectionSearch
Class to interact with the NMDC API to search for records within the material_processing_set collection.
Warnings
The env parameter is deprecated. Use api_base_url instead.
Source code in nmdc_client/material_processing_search.py
17 18 19 20 21 22 | |
StorageProcessSearch
¶
StorageProcessSearch(api_base_url: str = 'https://api.microbiomedata.org', env: str = '')
Bases: nmdc_client.collection_search.CollectionSearch
Class to interact with the NMDC API to search for records within the storage_process_set collection.
Warnings
The env parameter is deprecated. Use api_base_url instead.
Source code in nmdc_client/storage_process_search.py
17 18 19 20 21 22 | |
Data Generation Related¶
These classes cover records tied to generation setup and instrumentation. Use schema and typecode map when selecting classes for linked-instance queries.
DataGenerationSearch
¶
DataGenerationSearch(api_base_url: str = 'https://api.microbiomedata.org', env: str = '')
Bases: nmdc_client.collection_search.CollectionSearch
Class to interact with the NMDC API to search for records within the data_generation_set collection.
Warnings
The env parameter is deprecated. Use api_base_url instead.
Source code in nmdc_client/data_generation_search.py
17 18 19 20 21 22 | |
ManifestSearch
¶
ManifestSearch(api_base_url: str = 'https://api.microbiomedata.org', env: str = '')
Bases: nmdc_client.collection_search.CollectionSearch
Class to interact with the NMDC API to search for records within the manifest_set collection.
Warnings
The env parameter is deprecated. Use api_base_url instead.
Source code in nmdc_client/manifest_search.py
17 18 19 20 21 22 | |
InstrumentSearch
¶
InstrumentSearch(api_base_url: str = 'https://api.microbiomedata.org', env: str = '')
Bases: nmdc_client.collection_search.CollectionSearch
Class to interact with the NMDC API to search for records within the instrument_set collection.
Warnings
The env parameter is deprecated. Use api_base_url instead.
Source code in nmdc_client/instrument_search.py
17 18 19 20 21 22 | |
ConfigurationSearch
¶
ConfigurationSearch(api_base_url: str = 'https://api.microbiomedata.org', env: str = '')
Bases: nmdc_client.collection_search.CollectionSearch
Class to interact with the NMDC API to search for records within the configuration_set collection.
Warnings
The env parameter is deprecated. Use api_base_url instead.
Source code in nmdc_client/configuration_search.py
18 19 20 21 22 23 | |
Data and Processing Related¶
These classes are useful for workflow context, calibration context, data objects, and functional annotation aggregation outputs. Use NMDC Schema docs for exact field meanings and schema class names.
WorkflowExecutionSearch
¶
WorkflowExecutionSearch(api_base_url: str = 'https://api.microbiomedata.org', env: str = '')
Bases: nmdc_client.collection_search.CollectionSearch
Class to interact with the NMDC API to search for records within the workflow_execution_set collection.
Warnings
The env parameter is deprecated. Use api_base_url instead.
Source code in nmdc_client/workflow_execution_search.py
17 18 19 20 21 22 | |
CalibrationSearch
¶
CalibrationSearch(api_base_url: str = 'https://api.microbiomedata.org', env: str = '')
Bases: nmdc_client.collection_search.CollectionSearch
Class to interact with the NMDC API to search for records within the calibration_set collection.
Warnings
The env parameter is deprecated. Use api_base_url instead.
Source code in nmdc_client/calibration_search.py
18 19 20 21 22 23 | |
DataObjectSearch
¶
DataObjectSearch(api_base_url: str = 'https://api.microbiomedata.org', env: str = '')
Bases: nmdc_client.collection_search.CollectionSearch
Class to interact with the NMDC API to search for records within the data_object_set collection.
Warnings
The env parameter is deprecated. Use api_base_url instead.
Source code in nmdc_client/data_object_search.py
22 23 24 25 26 27 | |
get_data_objects_for_studies
¶
get_data_objects_for_studies(study_id: str, max_page_size: Optional[int] = None) -> list[dict]
Deprecated alias for get_data_objects_for_study.
Deprecated
Deprecated since version 0.7.0. Use get_data_objects_for_study instead.
Source code in nmdc_client/data_object_search.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |
get_data_objects_for_study
¶
get_data_objects_for_study(study_id: str) -> list[dict]
Get all data objects related to the specified study.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
study_id
|
str
|
The ID of the study. |
required |
Returns:
| Type | Description |
|---|---|
list[dict]
|
The data objects. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If the API request fails. |
Source code in nmdc_client/data_object_search.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | |
FunctionalAnnotationAggSearch
¶
FunctionalAnnotationAggSearch(api_base_url: str = 'https://api.microbiomedata.org', env: str = '')
Bases: nmdc_client.functional_search.FunctionalSearch
Class to interact with the NMDC API to search for records within the functional_annotation_agg collection.
These are most helpful when trying to identify workflows associated with a KEGG, COG, or PFAM ids.
Warnings
The env parameter is deprecated. Use api_base_url instead.
Source code in nmdc_client/functional_annotation_agg_search.py
19 20 21 22 23 | |