예제 #1
0
def GetHabMapURL(strUC):
    """
    (string) -> string
    
    Returns the ScienceBase URL for the habitat map of the passed
    species/strUC.
    
    Arguments:
    strUC -- A gap species code ("mSEWEx")
    
    Example:
    >> url = GetHabMapURL("bAMROx")
    """
    import gapdb
    cursor, connect = gapdb.ConnectAnalyticDB()
    sql = """SELECT tblTaxa.strSbUrlHM
             FROM tblTaxa
             WHERE tblTaxa.strUC = ?"""
    url = cursor.execute(sql, strUC).fetchone()[0]
    del cursor
    connect.close()
    return str(url)
예제 #2
0
def GetRngMapDOI(strUC):
    """
    (string) -> string
    
    Returns the ScienceBase DOI for the range map of the passed
    species/strUC.
    
    Arguments:
    strUC -- A gap species code ("mSEWEx")
    
    Example:
    >> id = GetRngMapDOI("bAMROx")
    """
    import gapdb
    cursor, connect = gapdb.ConnectAnalyticDB()
    sql = """SELECT tblTaxa.strDoiRM
             FROM tblTaxa
             WHERE tblTaxa.strUC = ?"""
    doi = cursor.execute(sql, strUC).fetchone()[0]
    del cursor
    connect.close()
    return str(doi)