alerce


Namealerce JSON
Version 1.2.0 PyPI version JSON
download
home_page
SummaryALeRCE Client
upload_time2022-12-15 15:58:37
maintainer
docs_urlNone
authorALeRCE Team
requires_python
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![image](https://github.com/alercebroker/alerce_client_new/workflows/Tests/badge.svg)![image](https://codecov.io/gh/alercebroker/alerce_client_new/branch/master/graph/badge.svg?token=ZUHW7C308N)![image](https://readthedocs.org/projects/alerce/badge/?version=latest)


Welcome to ALeRCE Python Client.
================================

[ALeRCE](http://alerce.science) client is a Python library to interact
with ALeRCE services and databases.

For full documentation please visit the official
[Documentation](https://alerce.readthedocs.io/en/latest/):

Installing ALeRCE Client
========================

``` {.sourceCode .bash}
pip install alerce
```

Or clone the repository and install from there

``` {.sourceCode .bash}
git clone https://github.com/alercebroker/alerce_client.git
cd alerce_client
python setup.py install
```

Usage
=====

``` {.sourceCode .python}
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 
``` {.sourceCode .python}
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.

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

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "alerce",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "ALeRCE Team",
    "author_email": "contact@alerce.online",
    "download_url": "https://files.pythonhosted.org/packages/31/38/cad27f33ac4829512c8e82a0596bcc8def4c5f04a8fcfd7a381110fad07a/alerce-1.2.0.tar.gz",
    "platform": null,
    "description": "![image](https://github.com/alercebroker/alerce_client_new/workflows/Tests/badge.svg)![image](https://codecov.io/gh/alercebroker/alerce_client_new/branch/master/graph/badge.svg?token=ZUHW7C308N)![image](https://readthedocs.org/projects/alerce/badge/?version=latest)\n\n\nWelcome to ALeRCE Python Client.\n================================\n\n[ALeRCE](http://alerce.science) client is a Python library to interact\nwith ALeRCE services and databases.\n\nFor full documentation please visit the official\n[Documentation](https://alerce.readthedocs.io/en/latest/):\n\nInstalling ALeRCE Client\n========================\n\n``` {.sourceCode .bash}\npip install alerce\n```\n\nOr clone the repository and install from there\n\n``` {.sourceCode .bash}\ngit clone https://github.com/alercebroker/alerce_client.git\ncd alerce_client\npython setup.py install\n```\n\nUsage\n=====\n\n``` {.sourceCode .python}\nfrom alerce.core import Alerce\nalerce = Alerce()\n\ndataframe = alerce.query_objects(\n    classifier=\"lc_classifier\", \n    class_name=\"LPV\", \n    format=\"pandas\"\n)\n\ndetections = alerce.query_detections(\"ZTF20aaelulu\", format=\"pandas\", sort=\"mjd\")\n\nmagstats = alerce.query_magstats(\"ZTF20aaelulu\")\n\nquery='''\nSELECT\n    oid, sgmag1, srmag1, simag1, szmag1, sgscore1\nFROM\n    ps1_ztf\nWHERE\n    oid = 'ZTF20aaelulu'\n'''\ndetections_direct = alerce.send_query(query, format=\"pandas\")\n```\n\nConfiguration\n=============\n\nBy default the Alerce object should be ready to use without any external\nconfiguration, but in case you need to adjust any parameters then you\ncan configure the Alerce object in different ways.\n\nAt the client object initialization\n-----------------------------------\n\nYou can pass parameters to the Alerce class constructor to set the\nparameters for API connection.\n\nFor example using the ZTF API on localhost:5000 and the DB API on localhost:5050 \n``` {.sourceCode .python}\nalerce = Alerce(ZTF_API_URL=\"<http://localhost:5000>\", ZTF_DB_API_URL=\"<http://localhost:5050>\")\n```\n\nFrom a dictionary object\n------------------------\n\nYou can pass parameters to the Alerce class from a dictionary object.\n\n``` {.sourceCode .python}\nmy_config = {\n    \"ZTF_API_URL\": \"http://localhost:5000\"\n    \"ZTF_DB_API_URL\": \"http://localhost:5050\"\n}\nalerce = Alerce()\nalerce.load_config_from_object(my_config)\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "ALeRCE Client",
    "version": "1.2.0",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "184a0054a66b373030af35420150956c",
                "sha256": "4929cfb0aca5dc44d5a05f1fc164d1f5524d35c4e811b205d52c1c3618d4cb11"
            },
            "downloads": -1,
            "filename": "alerce-1.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "184a0054a66b373030af35420150956c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 11959,
            "upload_time": "2022-12-15T15:58:35",
            "upload_time_iso_8601": "2022-12-15T15:58:35.572975Z",
            "url": "https://files.pythonhosted.org/packages/4c/eb/a1d8af21cea63704efdd47f2fbb2b58009f913ee4bb890fba8f042f4e51d/alerce-1.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "8845c84d7e86e729ec05e78b182193f9",
                "sha256": "134b101fdc4c6890ed9bbc59c51444073107bc36f16fefbd55347c5680aec6bd"
            },
            "downloads": -1,
            "filename": "alerce-1.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "8845c84d7e86e729ec05e78b182193f9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 10723,
            "upload_time": "2022-12-15T15:58:37",
            "upload_time_iso_8601": "2022-12-15T15:58:37.111842Z",
            "url": "https://files.pythonhosted.org/packages/31/38/cad27f33ac4829512c8e82a0596bcc8def4c5f04a8fcfd7a381110fad07a/alerce-1.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-15 15:58:37",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "alerce"
}
        
Elapsed time: 0.06389s