The sedbuilder package implements a Python interface to the ASI Space Science Data Center's SED Builder REST API.
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.
pip install ssdc-sedbuilderYou can fetch data by querying a source name or its coordinates.
fromsedbuilderimportget_data# By coordinatesresponse=get_data(ra=244.9795, dec=-15.64022)
# By nameresponse=get_data(name="Sco X-1")
# Access data in different formatstable=response.to_astropy() # Astropy Tabledata_dict=response.to_dict() # Python dictionaryjt=response.to_jetset(z=0.034) # Jetset tablejson_str=response.to_json() # JSON stringdf=response.to_pandas() # Pandas DataFrame (requires pandas)# Find where data come fromfirst_reference=response.datasets[0].referencerefs=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.
fromsedbuilderimportresolve_name
(ra, dec), db=resolve_name("Crab Nebula")Resolving a source name takes time. We suggest querying on coordinates when available.
# 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 buildFor more, see documentation.
Need a new feature? Don't hesitate to ask in our discussion section.
Check out our API reference.