Skip to main content

Reusable toolkit for science-ready catalog preparation with Dask, LSDB, and HATS.

Project description

science_catalogs

science_catalogs is a reusable Python library for building science-ready catalogs with LSDB-oriented workflows. The package focuses on the reusable core of the processing stack:

  • column selection
  • column transformations
  • row filtering
  • output materialization to memory, partitioned files, or HATS catalogs

The package is published on PyPI as science-catalogs and imported in Python as science_catalogs.

Installation

pip install science-catalogs

For local development:

pip install -e '.[dev]'

Or, if you prefer a requirements file for a full developer environment including build and PyPI publication tools:

pip install -r requirements-dev.txt

Main API

from science_catalogs import (
    build_catalog,
    materialize_catalog,
    materialize_lsdb_catalog,
    open_lsdb_catalog,
    prepare_catalog,
    write_catalog,
)

Beta API

The beta public API is:

  • prepare_catalog
  • materialize_catalog
  • write_catalog
  • materialize_lsdb_catalog
  • open_lsdb_catalog
  • build_catalog

Legacy names based on pipeline are not part of the beta API.

Usage

Prepare a catalog from a catalog-processing YAML configuration:

from science_catalogs import prepare_catalog

prepared = prepare_catalog("configs/catalog.yml")

Materialize the processed data in memory and keep track of the written output paths:

from science_catalogs import materialize_catalog

result = materialize_catalog(prepared, "./output")
frame = result["data"]
paths = result["path"]

Write the result to disk. The write mode follows the output configuration, including HATS when output.save_as: hats is selected:

from science_catalogs import write_catalog

written_paths = write_catalog(prepared, "./output")

Open the final result as an LSDB catalog after writing HATS output:

from science_catalogs import materialize_lsdb_catalog

result = materialize_lsdb_catalog(prepared, "./output")
catalog = result["data"]
hats_path = result["path"]

Execute the full flow from configuration and persist parquet output in one call:

from science_catalogs import build_catalog

paths = build_catalog("configs/catalog.yml", output_dir="./output")

Or force a HATS artifact from the same flow:

hats_path = build_catalog(
    "configs/catalog.yml",
    output_dir="./output",
    output_format="hats",
)

If you already have a HATS catalog on disk, you can open it directly:

from science_catalogs import open_lsdb_catalog

catalog = open_lsdb_catalog("./output/my_catalog")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

science_catalogs-0.1.0b2.tar.gz (272.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

science_catalogs-0.1.0b2-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

Details for the file science_catalogs-0.1.0b2.tar.gz.

File metadata

  • Download URL: science_catalogs-0.1.0b2.tar.gz
  • Upload date:
  • Size: 272.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for science_catalogs-0.1.0b2.tar.gz
Algorithm Hash digest
SHA256 79315d9e9eaf13c46a99ed8754eb4b19d410b8a257ec876126ff0f1eaad0dae1
MD5 a41d230d86e2b2c73ae05b907e3ffc74
BLAKE2b-256 d7945b4af0703aab7af2a50a7798b7db27a7a93ef91bc31a405d6b18c5fbc140

See more details on using hashes here.

Provenance

The following attestation bundles were made for science_catalogs-0.1.0b2.tar.gz:

Publisher: publish-to-pypi.yml on linea-it/science_catalogs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file science_catalogs-0.1.0b2-py3-none-any.whl.

File metadata

File hashes

Hashes for science_catalogs-0.1.0b2-py3-none-any.whl
Algorithm Hash digest
SHA256 0ef9d222145bbe6a100c1363702c7c06ffcd597b763fafabef52c23cb56c3d8d
MD5 e92096f262090a63715996ecc90e7cdd
BLAKE2b-256 ce3250c8d5c0e729d1b9ead36efe4743befd61400d05d513a0b6dae37235e6bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for science_catalogs-0.1.0b2-py3-none-any.whl:

Publisher: publish-to-pypi.yml on linea-it/science_catalogs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page