Skip to main content

ALeRCE Client

Project description

imageimageimage

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)

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.2.0.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

alerce-1.2.0-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: alerce-1.2.0.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for alerce-1.2.0.tar.gz
Algorithm Hash digest
SHA256 134b101fdc4c6890ed9bbc59c51444073107bc36f16fefbd55347c5680aec6bd
MD5 8845c84d7e86e729ec05e78b182193f9
BLAKE2b-256 3138cad27f33ac4829512c8e82a0596bcc8def4c5f04a8fcfd7a381110fad07a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: alerce-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for alerce-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4929cfb0aca5dc44d5a05f1fc164d1f5524d35c4e811b205d52c1c3618d4cb11
MD5 184a0054a66b373030af35420150956c
BLAKE2b-256 4ceba1d8af21cea63704efdd47f2fbb2b58009f913ee4bb890fba8f042f4e51d

See more details on using hashes here.

Supported by

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