Skip to main content

CloudCatalog (cloudcatalog) API

Indexing millions of files for easy, searchable yet serverless and decentralized access is hard. CloudCatalog is a lightweight CSV- and JSON-based indexing schema enabling HAPI-like "data ID + time range" queries on massive cloud datasets, and includes an implementation of the API and support tools in Python. Key goals include that (1) data owners control their own indices, (2) indices are static files to avoid incurring server costs, (3) searching is efficient and (4) indices are easily constructable and maintainable by the scientists/data-owners (the 'lazy' part). In addition to the FAIR principles of findability, accessibility, interoperability, and reusability, it is serverless and decentralized so that contributors can publish and update their open science data without the worries of external gatekeeping or server maintenance.

CloudCatalog is a generalized indexing specification for large cloud datasets.

  • For sharing datasets across cloud frameworks
  • Decentralized: data owners control their own data and access via JSON
  • RESTful & serverless (indices are flat CSV files alongside their datasets)
  • Removes need for doing slow/expensive disk ‘ls’ on large holdings
  • Searchable

The push to open science means many more published datasets, and finding and accessing is important to solve. CloudCatalog is an indexing method for sharing big datasets in cloud systems. It is scientist-friendly and it is easy to generate a set of indices. It uses static index files in time-ordered CSV format that are easy to fetch, easy to access via an API, and very low cost in both money and bandwidth needed to support. Metadata is kept in a simple JSON schema. We also provide a Python client toolset for scientists to access datasets that use CloudCatalog.

The CloudCatalog specification and tools are open source, created by the HelioCloud project, and already used for 2 Petabytes of publicly available NASA and scientist-contributed data. We hope the community continues to adopt this CloudCatalog standard (in github, linked off heliocloud.org).

  • For sharing datasets across cloud frameworks
  • Decentralized: data owners control their own data and access
  • RESTful & serverless (indices are flat files alongside their datasets)
  • Removes need for doing slow/expensive disk ‘ls’ on large holdings
  • Global registry JSON points to owner-controlled ‘buckets’
  • Uses minimal JSON to list metadata, CSV files for indices
  • Searchable
  • Public specification here on GitHub.

The Specification enables anyone to index a public dataset such that other users can find it and retrieve file listings in a cost-effective serverless fashion.

The API is designed for retrieving file catalog (index) files from a specific ID entry in a catalog within a bucket. It also includes search functionality for searching through all data index catalogs found in the bucket list.

Command-line tools

We also include command-line tools for creating and viewing the networked catalogs.

Viewing tools

  • cloudcatalog-tree: lists or returns list of all toplevel datasets and number of dataIDs available, fast
  • cloudcatalog-spider: as 'tree' plus lists valid years and number of files, slow

Generator/updater tools (beta, use at risk for now)

  • cloudcatalog-update-json: updates catalog.json using metadata from catalog_stub.json
  • cloudcatalog-update-csv: updates catalog.json using metadata from cat.csv
  • cloudcatalog-gui: GUI for selecting files for cloudcatalog-update-json
  • cloudcatalog-manifest2indices: tries to convert an AWS Manifest.csv to individual [dataID]_[YYYY].csv indices

Use Case

Suppose there is a mission on S3 that follows the HelioCloud 'CloudCatalog' specification, and you want to obtain specific files from this mission.

Initial Setup and Global Catalog

First, install the tool if it has not been already installed. Then, import the tool into a script or shell. You will likely want to search the global catalog to find the specific bucket/catalog containing the data catalog files. You first create a CatalogRegistry object to pull from the default global catalog. This lists buckets not datasets; each bucket owner retains direct ownership over which of their datasets they wish to expose to the public.

import cloudcatalog

cr = cloudcatalog.CatalogRegistry()
print(cr.get_catalog())

print(cr.get_entries())

Finding and Requesting the File Catalog

At this point, you should have found the bucket containing the data of interest. Next, you will want to search the bucket-specific catalog (data catalog) for the ID representing the mission you want to obtain data for.

bucket_name = cr.get_endpoint('e.g. Bucket Mnemonic') # or hard-code, e.g. 's3://mybucket'
# If not a public bucket, pass access_key or boto S3 client params to access it
fr = cloudcatalog.CloudCatalog(bucket_name)  

# Print out the entire local catalog (datasets)
print(fr.get_catalog())

# To find the specific ID we can also get the ID + Title by
print(fr.get_entries_id_title())

# Now with the ID we can request the catalog index files as a Pandas dataframe
fr_id = 'a_dataset_id_from_the_catalog'
start_date = '2007-02-01T00:00:00Z'  # A ISO 8601 standard time
stop_date = None  # A ISO 8601 standard time or None for everything after start_date
myfiles = fr.request_cloud_catalog(fr_id, start_date=start_date, end_date=end_date, overwrite=False)

Searching the Entire Catalog

You can use the EntireCatalogSearch class to find a catalog entry:

search = cloudcatalog.EntireCatalogSearch()
top_search_result = search.search_by_keywords(['vector', 'mission', 'useful'])[0]
print(top_search_result)

Specific example for an SDO fetch of the filelist for all the 94A EUV images (1,624,900 files)

import cloudcatalog
fr = cloudcatalog.CloudCatalog("s3://gov-nasa-hdrl-data1/")
dataid = "aia_0094"
start, stop = fr.get_entry(dataid)['start'], fr.get_entry(dataid)['stop']
mySDOlist = fr.request_cloud_catalog(dataid, start, stop)

Add-on example for an MMS fetch of the filelist for all of a specific MMS item (64,383 files)

dataid = "MMS1_FEEPS_BRST_L2_ELECTRON"
start, stop = fr.get_entry(dataid)['start'], fr.get_entry(dataid)['stop']
myMMSlist = fr.request_cloud_catalog(dataid, start, stop)

Streaming Data from the File Catalog

You now have a pandas DataFrame with startdate, stopdate, key, and filesize for all the files of the mission within your specified start and end dates. From here, you can use the key to stream some of the data through EC2, a Lambda, or other processing methods.

This tool also offers a simple function for streaming the data once the file catalog is obtained:

cloudcatalog.CloudCatalog.stream(cloud_catalog, lambda bfile, startdate, stopdate, filesize: print(len(bo.read()), filesize))

Full Notebook Tutorial

For an in-depth walkthrough using the CloudCatalog on NASA datasets, see CloudCatalog-Demo.ipynb

Metadata

Release files for cloudcatalog 1.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cloudcatalog 1.3.3
File Size Uploaded Provenance
cloudcatalog-1.3.3.tar.gz 204.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cloudcatalog 1.3.3
File Interpreter ABI Platform
cloudcatalog-1.3.3-py3-none-any.whl Python 3 none any Details

Total release size: 250.2 kB

Release files / cloudcatalog-1.3.3.tar.gz

Download URL cloudcatalog-1.3.3.tar.gz
Size 204.0 kB
Tags Source
SHA-256 checksum
How to use checksums
befdc30317ff0e4c2cc4538af649ca16797e54eee253eba6bb880d02e036699e
BLAKE2b-256 checksum
How to use checksums
68a0d9537a786ba6c227f69cc02751d64c64e2a911bc2b5e15b28a18aeaf31e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release files / cloudcatalog-1.3.3-py3-none-any.whl

Download URL cloudcatalog-1.3.3-py3-none-any.whl
Size 46.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
deac68dca93a25dc87885edf5f48afae0855ff7c68600e5f3b23c548ef17f186
BLAKE2b-256 checksum
How to use checksums
fa2440fb35df3c50e0a296e17e5ed1d08740565f3ec449b2068e05664b3b26b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Security for cloudcatalog 1.3.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page