Package: lakepy
LakePyLakePy is the pythonic user-centered front-end to theGlobal Lake Level Database. This package can instantly
deliver lake water levels for some 2000+ lakes scattered across the globe. Data comes from three sources (so far!)United States Geological Survey National Water Information SystemUnited States Department of Agriculture: Foreign Agricultural Service's G-REALM DatabaseTheia's HydroWeb DatabaseFunding for this work comes from the Earth Science Information Partners (ESIP) Winter 2020 GrantSee the funded proposalhereMotivationLake level data is incredibly important to federal and local governments, scientists, and citizens. Until now,
accessing lake level data involves laborious data-preparation and wrangling. We aim to provide this data quickly
and on-demand.Software UsedBuilt withPythonPandasPyMySQLBoto3Amazon MySQL RDSAmazon API GatewayAmazon LambdaQuickstartFor a full API Reference, please consult LakePy'sdocumentationFor a list of Lakes with corresponding ID numbers, see theLake Reference ListInstallationpip install lakepyif you are using conda for package management you canstill use pip!Searching the Global Lake Level DatabaseThe database can be searched using a name, a source ("grealm", "hydroweb", or "usgs"), or an identification number
. The best practice for searching is to first specify a name.Let's search forLake Meadinstantiating a Lake() object.import lakepy as lk
my_lake = lk.search("mead")If there is more than one Lake matching "Mead", the search function will return a RuntimeWarning and display a table."Search Result: 'Mead' has more than 1 Result. Showing the 2 most relevant results.
Specify 'id_No' or narrow search name."id_Nosourcelake_name0138hydrowebMead11556usgsMEAD LAKE WEST BAY NEAR WILLARD, WIWe will select id_No 138 corresponding to Lake Mead from HydroWeb's database and re-run our search 1 of 2 ways:Specify theid_Noexplicitly as a stringmy_lake = lk.search(id_No = "138")Specify anameand asourcemy_lake = lk.search(name="mead", source="hydroweb", markdown=True)Wehighly recommendspecifying an id_Nowhenever possibleto avoid issues with similarly named lakes. Either way
, the search returns a metadata markdown dataframeid_Nosourcelake_namebasinstatuscountryend_datelatitudelongitudeidentifierstart_date0138hydrowebMeadColoradoresearchUSA2014-12-29 00:2136.13-114.45L_mead2000-06-14 10:22It is important to note that different databases will return different types and amounts of metadata. Currently
latitude & longitude are only available from the USGS and HydroWeb databases, but GREALM lakes will soon have them!Lake() objectThe "my_lake" variable is now an object of class Lake() which comes with several attributesnamecountrycontinent(currently not supported for HydroWeb)sourceoriginal_idid_Noobservation_periodlatitude(currently not supported for G-REALM)longitude(currently not supported for G-REALM)misc_datadataframedataimportantly, my_lake.dataframe and my_lake.data are pandas dataframe instances with associated methodsmy_lake.dataframe.describe().to_markdown()water_levelcount119mean342.807std7.34547min330.7525%337.90550%342.2675%347.555max365.43PlottingLakePy allows for native time series plotting as well as map-view plotsmy_lake.plot_timeseries()Plotly (default)Seaborn/Matplotlibmy_lake.plot_timeseries(how='seaborn')my_lake.plot_mapview()API ReferencePlease refer to theLakePy documentationContributeWe would love your help in making this project better. Please refer to ourcontribution guideto learn how.Citing LakePyPlease consider citing us if you use LakePy in your research! The recommended citation is:James Gearon, & John Franey. (2021, January 4). ESIPFed/LakePy v2.1.0 (Version v2.1.0). Zenodo.http://doi.org/10.
5281/zenodo.4415936CreditsThis work is based on funding provided by the ESIP Lab with support from the National Aeronautics and Space
Administration (NASA), National Oceanic and Atmospheric Administration (NOAA) and the United States Geologic
Survey (USGS). LakePy received additional, generous support in 2021 from Derek Masaki and Farial Shahnaz. Many thanks to them.LicenseMIT ©James Hooker Gearon & John Franey