pytups.utils package

Subpackages

Submodules

pytups.utils.PaleoData module

class pytups.utils.PaleoData.PaleoData(paleo_data, study_id, site_id)[source]

Bases: object

Represents paleo data associated with a site.

datatable_id

The NOAA data table identifier.

Type:

str

dataTableName

The name of the data table.

Type:

str

timeUnit

The unit of time for the data.

Type:

str

file_url

The URL from which the data file can be fetched.

Type:

str

variables

A list of variable names or identifiers.

Type:

list

study_id

The NOAA study ID this data belongs to.

Type:

str

site_id

The site identifier this data belongs to.

Type:

str

to_dict()[source]

Return a dictionary representation of the paleo data.

to_dict()[source]

Convert the paleo data into a dictionary.

Returns:

A dictionary representation of the paleo data.

Return type:

dict

pytups.utils.Publication module

class pytups.utils.Publication.Publication(pub_data)[source]

Bases: object

Represents a publication within a study.

author

The name of the author(s) of the publication.

Type:

str

title

The title of the publication.

Type:

str

journal

The journal where the publication appeared.

Type:

str

year

The publication year.

Type:

str

volume

The volume number (if applicable).

Type:

str or None

number

The issue number (if applicable).

Type:

str or None

pages

The page numbers (if applicable).

Type:

str or None

pub_type

The type of publication.

Type:

str or None

doi

The Digital Object Identifier.

Type:

str or None

url

URL for the publication.

Type:

str or None

study_id

The NOAA study ID to which this publication belongs.

Type:

str or None

get_citation_key()[source]

Generate and return a unique citation key.

to_dict()[source]

Return a dictionary representation of the publication.

get_citation_key()[source]

Generate a unique citation key for the publication.

Returns:

A citation key in the format: “<LastName>_<FirstSignificantWord>_<Year>_<StudyID>”.

Return type:

str

to_dict()[source]

Convert the publication data into a dictionary.

Returns:

A dictionary representation of the publication.

Return type:

dict

pytups.utils.Site module

class pytups.utils.Site.Site(site_data, study_id)[source]

Bases: object

Represents a site within a study.

site_id

The unique identifier for the site.

Type:

str

site_name

The name of the site.

Type:

str

location_name

A descriptive location name.

Type:

str

lat

The latitude coordinate.

Type:

float or str

lon

The longitude coordinate.

Type:

float or str

min_elevation

The minimum elevation in meters.

Type:

float or None

max_elevation

The maximum elevation in meters.

Type:

float or None

paleo_data

A list of PaleoData objects associated with this site.

Type:

list of PaleoData

to_dict()[source]

Return a dictionary representation of the site.

to_dict()[source]

Convert the site data into a dictionary.

Returns:

A dictionary representation of the site, including its paleo data.

Return type:

dict

pytups.utils.helpers module

pytups.utils.helpers.assert_list(input_item)[source]

Ensure the input is a list.

If the input is not a list, it converts it into a single-element list.

Parameters:

input_item (any) – The item to be converted to a list if it is not already one.

Returns:

A list containing the input item(s). If input_item is None, returns an empty list.

Return type:

list

pytups.utils.helpers.params_validators(key, value)[source]

Validate and process a parameter for the NOAA studies.

This function performs validations on parameter values such as latitude, longitude, keywords, and year ranges.

Parameters:
  • key (str) – The name of the parameter.

  • value (any) – The value of the parameter.

Returns:

This function is currently a stub for validation logic.

Return type:

None

Notes

Implement appropriate validations based on project requirements.

Module contents