Skip to content

Python API for accessing climate data records from the NOAA National Centers for Environmental Information (NCEI)

License

Notifications You must be signed in to change notification settings

WalidGharianiEAGLE/py-cdr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 

Repository files navigation

py-cdr - Climate Data Records API

This is a small project in progress. pycdr provides an API for accessing climate data records from the National Centers for Environmental Information (NCEI) hosted datasets. With pycdr, you can easily query datasets, retrieve dataset URLs, and access dataset information.

This is a MVP that provides some dataset to retrieve:

Installation.

pycdr will be installed using pip

Usage

from pycdr.cdr import CDRApi
from pycdr.datasets import Datasets

# Create an instance of CDRApi
api = CDRApi(start_date='2022-01-01', end_date='2022-01-10', dataset=Datasets.AVHRR_VIIRS_NDVI_V5)

# Query data and retrieve URLs
api.query(return_urls=False)

# Display the saved dataset URLs
print("Dataset URLs:")
for url in api.dataset_urls:
    print(url)
# Retrieve dataset information
infos = api.info(return_info=True)
infos

# Check if a specific URL is available
url_to_check = 'https://www.ncei.noaa.gov/thredds/dodsC/cdr/ndvi/2022/VIIRS-Land_v001-preliminary_NPP13C1_S-NPP_20220101_c20220419212429.nc'
if api.is_available(url_to_check):
    print(f"{url_to_check} is available.")
else:
    print(f"{url_to_check} is not available.")

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Thanks to the National Centers for Environmental Information (NCEI) for hosting the datasets used by this API.

About

Python API for accessing climate data records from the NOAA National Centers for Environmental Information (NCEI)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages