Skip to main content

A client to the ASI-SSDC's SED Builder API.

Project description

sedbuilder

The sedbuilder package implements a Python interface to the ASI Space Science Data Center's SED Builder REST API.

Overview

This package provides programmatic access to multi-wavelength spectral energy distribution (SED) data from catalogs, surveys, and archival observations across the electromagnetic spectrum. It is based on SED Builder, a software developed at the ASI-SSDC to produce and display the SED data over the web.

Installation

pip install ssdc-sedbuilder

Quick Start

You can fetch data by querying a source name or its coordinates.

from sedbuilder import get_data

# By coordinates
response = get_data(ra=244.9795, dec=-15.64022)
# By name
response = get_data(name="Sco X-1")

# Access data in different formats
table = response.to_astropy()  # Astropy Table
data_dict = response.to_dict()  # Python dictionary
jt = response.to_jetset(z=0.034)  # Jetset table
json_str = response.to_json()  # JSON string
df = response.to_pandas()  # Pandas DataFrame (requires pandas)

# Find where data come from
first_reference = response.datasets[0].reference
refs = response.references()

When calling get_data by name, resolve_name queries the SSDC server — which checks SSDC, SIMBAD, and NED — falling back to the CDS Sesame resolver via astropy if no match is found.

from sedbuilder import resolve_name

(ra, dec), db = resolve_name("Crab Nebula")

Resolving a source name takes time. We suggest querying on coordinates when available.

Development

# install with development dependencies
git clone https://github.com/peppedilillo/sedbuilder.git
cd sedbuilder
pip install -e ".[dev,docs]"
# or with uv
uv sync --extra dev --extra docs
# routes queries to test server (requires internal network)
source dev.env
# install linter pre-commit hooks
pre-commit install
# runs tests
pytest
# runs smoke tests against the live server
pytest --smoke
# serve and build documentation
mkdocs serve
mkdocs build

For more, see documentation.

Requests

Need a new feature? Don't hesitate to ask in our discussion section.

Documentation

Check out our API reference.

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

ssdc_sedbuilder-2.0.0.tar.gz (393.6 kB view details)

Uploaded Source

Built Distribution

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

ssdc_sedbuilder-2.0.0-py3-none-any.whl (37.6 kB view details)

Uploaded Python 3

File details

Details for the file ssdc_sedbuilder-2.0.0.tar.gz.

File metadata

  • Download URL: ssdc_sedbuilder-2.0.0.tar.gz
  • Upload date:
  • Size: 393.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.11.2 HTTPX/0.28.1

File hashes

Hashes for ssdc_sedbuilder-2.0.0.tar.gz
Algorithm Hash digest
SHA256 717e2d326ead8b34752c48097949af6bc87e6cd79bb64a28c1ab5bf47ba3791b
MD5 1c66df8d02d779c2295922f625fcd3e9
BLAKE2b-256 55af6d7c1461e96f985fefc34cdfa2d3a8306b47b6e30bbac51384ce56f5a9f5

See more details on using hashes here.

File details

Details for the file ssdc_sedbuilder-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: ssdc_sedbuilder-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 37.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.11.2 HTTPX/0.28.1

File hashes

Hashes for ssdc_sedbuilder-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 93f6cfbfa302fa555b03ff301c9eafe0684205945041e083df6806c74cb6bfaa
MD5 1b92869e0bff26668552155485fcb072
BLAKE2b-256 0bc74c73698fd6594af9793532661c4f6ff2dcf6e0f53952823f5bbdd3e04266

See more details on using hashes here.

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