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_catalogmaterialize_catalogwrite_catalogmaterialize_lsdb_catalogopen_lsdb_catalogbuild_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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79315d9e9eaf13c46a99ed8754eb4b19d410b8a257ec876126ff0f1eaad0dae1
|
|
| MD5 |
a41d230d86e2b2c73ae05b907e3ffc74
|
|
| BLAKE2b-256 |
d7945b4af0703aab7af2a50a7798b7db27a7a93ef91bc31a405d6b18c5fbc140
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
science_catalogs-0.1.0b2.tar.gz -
Subject digest:
79315d9e9eaf13c46a99ed8754eb4b19d410b8a257ec876126ff0f1eaad0dae1 - Sigstore transparency entry: 2040702308
- Sigstore integration time:
-
Permalink:
linea-it/science_catalogs@5773ea4f3f9808ad7fc412c4a17e88ac37d10d7e -
Branch / Tag:
refs/tags/v0.1.0b2 - Owner: https://github.com/linea-it
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@5773ea4f3f9808ad7fc412c4a17e88ac37d10d7e -
Trigger Event:
release
-
Statement type:
File details
Details for the file science_catalogs-0.1.0b2-py3-none-any.whl.
File metadata
- Download URL: science_catalogs-0.1.0b2-py3-none-any.whl
- Upload date:
- Size: 19.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ef9d222145bbe6a100c1363702c7c06ffcd597b763fafabef52c23cb56c3d8d
|
|
| MD5 |
e92096f262090a63715996ecc90e7cdd
|
|
| BLAKE2b-256 |
ce3250c8d5c0e729d1b9ead36efe4743befd61400d05d513a0b6dae37235e6bb
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
science_catalogs-0.1.0b2-py3-none-any.whl -
Subject digest:
0ef9d222145bbe6a100c1363702c7c06ffcd597b763fafabef52c23cb56c3d8d - Sigstore transparency entry: 2040702477
- Sigstore integration time:
-
Permalink:
linea-it/science_catalogs@5773ea4f3f9808ad7fc412c4a17e88ac37d10d7e -
Branch / Tag:
refs/tags/v0.1.0b2 - Owner: https://github.com/linea-it
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@5773ea4f3f9808ad7fc412c4a17e88ac37d10d7e -
Trigger Event:
release
-
Statement type: