Skip to main content

ALeRCE Client

Project description

imagecodecovimage

Welcome to ALeRCE Python Client.

ALeRCE client is a Python library to interact with ALeRCE services and databases.

For full documentation please visit the official Documentation:

Installing ALeRCE Client

pip install alerce

Or clone the repository and install from there

git clone https://github.com/alercebroker/alerce_client.git
cd alerce_client
python setup.py install

Usage

from alerce.core import Alerce
alerce = Alerce()

dataframe = alerce.query_objects(
    classifier="lc_classifier", 
    class_name="LPV", 
    format="pandas"
)

detections = alerce.query_detections("ZTF20aaelulu", format="pandas", sort="mjd")

magstats = alerce.query_magstats("ZTF20aaelulu")

query='''
SELECT
    oid, sgmag1, srmag1, simag1, szmag1, sgscore1
FROM
    ps1_ztf
WHERE
    oid = 'ZTF20aaelulu'
'''
detections_direct = alerce.send_query(query, format="pandas")

Configuration

By default the Alerce object should be ready to use without any external configuration, but in case you need to adjust any parameters then you can configure the Alerce object in different ways.

At the client object initialization

You can pass parameters to the Alerce class constructor to set the parameters for API connection.

For example using the ZTF API on localhost:5000 and the DB API on localhost:5050

alerce = Alerce(ZTF_API_URL="<http://localhost:5000>", ZTF_DB_API_URL="<http://localhost:5050>")

From a dictionary object

You can pass parameters to the Alerce class from a dictionary object.

my_config = {
    "ZTF_API_URL": "http://localhost:5000"
    "ZTF_DB_API_URL": "http://localhost:5050"
}
alerce = Alerce()
alerce.load_config_from_object(my_config)

Contribuiting

Each pull request must have at least one commit following the angular commit guidelines for the semantic versioning to work.

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

alerce-1.4.0.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

alerce-1.4.0-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file alerce-1.4.0.tar.gz.

File metadata

  • Download URL: alerce-1.4.0.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for alerce-1.4.0.tar.gz
Algorithm Hash digest
SHA256 7742eb607c4f340e5c5ea3cb251fd6a5948effe2d33f771b7f70bc44c802efef
MD5 83cfc1908e9f248f864d7b393d3e95e8
BLAKE2b-256 9f5e0f3d16851befc818a154eff505f973b01f170ccaa94d8b36ff2843819300

See more details on using hashes here.

File details

Details for the file alerce-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: alerce-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for alerce-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7250dd0a748eca860c6ac545df949c8e1441f506baf877894c4d3e5354482729
MD5 9687adc68bdc085ca728bc80e8fa139e
BLAKE2b-256 4f025c1da52ffbcb886c5d63f82ee27b90e793ff1a79e6e5aacdda88161dacc4

See more details on using hashes here.

Supported by

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