def currency(tsn, as_dataframe=False, **kwargs): """ Get currency from tsn :param tsn: (int) TSN for a taxonomic group :param as_dataframe: (bool) specify return type, if pandas is available :param \*\*kwargs: Curl options passed on to `requests.get` Usage:: from pytaxize import itis # currency data itis.currency(28727) # no currency dat itis.currency(526852) # as data_frame itis.currency(526852, as_dataframe=True) """ out = Refactor(itis_base + "getCurrencyFromTSN", payload={ "tsn": tsn }, request="get").json(**kwargs) out.pop("class") return _df(out, as_dataframe)
def jurisdictional_origin(tsn, as_dataframe=False, **kwargs): """ Get jurisdictional origin from tsn :param tsn: (int) TSN for a taxonomic group :param as_dataframe: (bool) specify return type, if pandas is available :param \*\*kwargs: Curl options passed on to `requests.get` Usage:: from pytaxize import itis itis.jurisdictional_origin(180543) itis.jurisdictional_origin(180543, True) """ out = Refactor( itis_base + "getJurisdictionalOriginFromTSN", payload={ "tsn": tsn }, request="get", ).json(**kwargs) out.pop("class") if out["jurisdictionalOrigins"][0] is not None: [z.pop("class") for z in out["jurisdictionalOrigins"]] return _df(out["jurisdictionalOrigins"], as_dataframe)
def hierarchy_down(tsn, as_dataframe=False, **kwargs): """ Get hierarchy down from tsn :param tsn: (int) TSN for a taxonomic group :param as_dataframe: (bool) specify return type, if pandas is available :param \*\*kwargs: Curl options passed on to `requests.get` Usage:: from pytaxize import itis itis.hierarchy_down(tsn = 179913) itis.hierarchy_down(tsn = 161994) itis.hierarchy_down(tsn = 9999999) """ tt = Refactor(itis_base + "getHierarchyDownFromTSN", payload={ "tsn": tsn }, request="get").json(**kwargs) tt.pop("class") if tt["hierarchyList"]: pass [z.pop("class") for z in tt["hierarchyList"] if z is not None] return _df(tt["hierarchyList"], as_dataframe)
def credibility_ratings(**kwargs): """ Get possible credibility ratings :param \*\*kwargs: Curl options passed on to `requests.get` :return: a dict Usage:: from pytaxize import itis itis.credibility_ratings() """ out = Refactor(itis_base + "getCredibilityRatings", payload={}, request="get").json(**kwargs) out.pop("class") return out["credibilityValues"]
def jurisdiction_values(**kwargs): """ Get possible jurisdiction values :param \*\*kwargs: Curl options passed on to `requests.get` :return: list Usage:: from pytaxize import itis itis.jurisdiction_values() """ out = Refactor(itis_base + "getJurisdictionValues", payload={}, request="get").json(**kwargs) out.pop("class") return out["jurisdictionValues"]
def jurisdiction_origin_values(as_dataframe=False, **kwargs): """ Get jurisdiction origin values :param as_dataframe: (bool) specify return type, if pandas is available :param \*\*kwargs: Curl options passed on to `requests.get` Usage:: from pytaxize import itis itis.jurisdiction_origin_values() """ out = Refactor(itis_base + "getJurisdictionalOriginValues", payload={}, request="get").json(**kwargs) out.pop("class") [z.pop("class") for z in out["originValues"]] return _df(out["originValues"], as_dataframe)
def rank_name(tsn, as_dataframe=False, **kwargs): """ Returns the kingdom and rank information for the TSN. :param tsn: (int) TSN for a taxonomic group :param as_dataframe: (bool) specify return type, if pandas is available :param \*\*kwargs: Curl options passed on to `requests.get` Usage:: from pytaxize import itis itis.rank_name(tsn = 202385) """ tt = Refactor(itis_base + "getTaxonomicRankNameFromTSN", payload={ "tsn": tsn }, request="get").json(**kwargs) tt.pop("class") return _df(tt, as_dataframe)
def experts(tsn, as_dataframe=False, **kwargs): """ Get expert information for the TSN. :param tsn: (int) TSN for a taxonomic group :param as_dataframe: (bool) specify return type, if pandas is available :param \*\*kwargs: Curl options passed on to `requests.get` Usage:: from pytaxize import itis itis.experts(tsn=180544) """ out = Refactor(itis_base + "getExpertsFromTSN", payload={ "tsn": tsn }, request="get").json(**kwargs) out.pop("class") return _df(out["experts"], as_dataframe)
def hierarchy_up(tsn, as_dataframe=False, **kwargs): """ Get hierarchy up from tsn :param tsn: (int) TSN for a taxonomic group :param as_dataframe: (bool) specify return type, if pandas is available :param \*\*kwargs: Curl options passed on to `requests.get` Usage:: from pytaxize import itis itis.hierarchy_up(tsn = 36485) itis.hierarchy_up(tsn = 37906) """ tt = Refactor(itis_base + "getHierarchyUpFromTSN", payload={ "tsn": tsn }, request="get").json(**kwargs) tt.pop("class") return _df(tt, as_dataframe)
def geographic_divisions(tsn, as_dataframe=False, **kwargs): """ Get geographic divisions from tsn :param tsn: (int) TSN for a taxonomic group :param as_dataframe: (bool) specify return type, if pandas is available :param \*\*kwargs: Curl options passed on to `requests.get` Usage:: from pytaxize import itis itis.geographic_divisions(tsn=180543) """ out = Refactor(itis_base + "getGeographicDivisionsFromTSN", payload={ "tsn": tsn }, request="get").json(**kwargs) out.pop("class") [z.pop("class") for z in out["geoDivisions"]] return _df(out["geoDivisions"], as_dataframe)
def credibility_rating(tsn, as_dataframe=False, **kwargs): """ Get credibility rating from tsn :param tsn: (int) TSN for a taxonomic group :param as_dataframe: (bool) specify return type, if pandas is available :param \*\*kwargs: Curl options passed on to `requests.get` Usage:: from pytaxize import itis itis.credibility_rating(tsn=526852) itis.credibility_rating(28727) """ out = Refactor(itis_base + "getCredibilityRatingFromTSN", payload={ "tsn": tsn }, request="get").json(**kwargs) out.pop("class") return _df(out, as_dataframe)
def global_species_completeness(tsn, as_dataframe=False, **kwargs): """ Get global species completeness from tsn :param tsn: (int) TSN for a taxonomic group :param as_dataframe: (bool) specify return type, if pandas is available :param \*\*kwargs: Curl options passed on to `requests.get` Usage:: from pytaxize import itis itis.global_species_completeness(180541) """ out = Refactor( itis_base + "getGlobalSpeciesCompletenessFromTSN", payload={ "tsn": tsn }, request="get", ).json(**kwargs) out.pop("class") return _df(out, as_dataframe)
def core_metadata(tsn, as_dataframe=False, **kwargs): """ Get core metadata from tsn :param tsn: (int) TSN for a taxonomic group :param as_dataframe: (bool) specify return type, if pandas is available :param \*\*kwargs: Curl options passed on to `requests.get` Usage:: from pytaxize import itis # coverage and currrency data itis.core_metadata(tsn=28727) # no coverage or currrency data itis.core_metadata(tsn=183671) """ out = Refactor(itis_base + "getCoreMetadataFromTSN", payload={ "tsn": tsn }, request="get").json(**kwargs) out.pop("class") return _df([out], as_dataframe)