ALeRCE Python Client
ALeRCE client is a Python library to interact with ALeRCE services and databases.
This README highlights installation, quickstart usage and migration notes for the multi-survey client (ZTF and LSST). For the full reference and tutorials, see the official documentation at https://alerce.readthedocs.io/en/latest/
Key features
- Multi-survey support: query ZTF and LSST data through a unified client.
- Access to objects, lightcurves (detections / non-detections / forced photometry), stamps, classifiers, crossmatches (catsHTM) and more.
- Return formats:
json(default),pandas, andvotablewhere applicable.
Installing
Install from PyPI:
pip install alerce
Or install from source:
git clone https://github.com/alercebroker/alerce_client.git
cd alerce_client
python setup.py install
Quickstart
Basic usage with the Alerce client:
from alerce.core import Alerce
client = Alerce()
# Query objects (must specify survey for multi-survey API)
ztf_objects = client.query_objects(survey="ztf", classifier="lc_classifier", class_name="SN", probability=0.8, format="pandas")
# Query a lightcurve (detections/non-detections/forced photometry)
lightcurve = client.query_lightcurve(oid="ZTF18abbuksn", survey="ztf", format="json")
# Query detections only
detections = client.query_detections(oid="ZTF18abbuksn", survey="ztf", format="pandas")
# Get stamps for an object (first detection by default or use measurement_id)
stamps = client.get_stamps(oid="ZTF18abkifng", survey="ztf")
# Crossmatch (catsHTM conesearch)
ra, dec, radius = 10.0, 20.0, 1000 # radius in arcsec
cone = client.catshtm_conesearch(ra, dec, radius, "GAIA/DR1", format="pandas")
See the documentation for many more examples and parameters.
Multi-survey notes / Migration from ZTF-only API
The client supports multiple surveys. Most query methods now require an explicit
survey parameter. Supported surveys:
ztf— Zwicky Transient Facilitylsst— Legacy Survey of Space and Time (Rubin Observatory)
Backward compatibility: many methods default to survey="ztf" when omitted,
but this behavior is deprecated and will be removed in a future release. Update
your code to always pass survey="ztf" or survey="lsst" explicitly.
Object ID formats differ between surveys:
- ZTF: string IDs like
"ZTF18abbuksn" - LSST: numeric-like IDs such as
45121627560013211
Contributing
Please read CONTRIBUTING.rst for the project's contribution guidelines.
License
This project is licensed under the terms in LICENSE.txt.
Release files for alerce 2.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| alerce-2.3.1.tar.gz | 18.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| alerce-2.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 40.1 kB
Release files / alerce-2.3.1.tar.gz
| Download URL | alerce-2.3.1.tar.gz |
|---|---|
| Size | 18.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
efacce6ad6a952db31e26ae50cc84302cbd0085fd45265edc55cf9f4dd815af0
|
|
BLAKE2b-256 checksum How to use checksums |
eaf68bc6cbcb830e55780cdf31ab4a338119ba9f9924bb2d07d879aebfbffe64
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / alerce-2.3.1-py3-none-any.whl
| Download URL | alerce-2.3.1-py3-none-any.whl |
|---|---|
| Size | 21.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
30efbcd42e1a92459816ec068af0d6252ddeaf49697f6d1b62e54455d3fccd3a
|
|
BLAKE2b-256 checksum How to use checksums |
d0958a3a7b4eb3d8d2686feddd5903c49b6fedaf7712b835fa1c32b4d7c7e22d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|