Developer Guide¶
Configure API for other environment¶
The ALeRCE client can be modified to request other APIs (for example local or develop APIs). To change the default behavior we have two ways, as initialization parameters or calling a method to change the routes.
As initialization parameters¶
You can pass parameters to the Alerce class constructor to set the parameters for API connection.
alerce = Alerce(ZTF_API_URL="https://localhost:5000")
From a dictionary object¶
You can pass parameters to the Alerce class from a dictionary object.
my_config = {
"ZTF_API_URL": "https://localhost:5000"
}
alerce = Alerce()
alerce.load_config_from_object(my_config)
Routes that can be modified¶
The examples changes the default ZTF api, but there are other API and routes that can be modified, all the routes are the following
Variable | Default | Description |
---|---|---|
ZTF_API_URL | http://api.alerce.online/ztf/v1 | ALeRCE ZTF API route. |
ZTF_ROUTES |
} |
Dictionary with query type and route, with %s as wildcard for object id |
CATSHTM_API_URL | http://catshtm.alerce.online | ALeRCE catsHTM API base url. |
CATSHTM_ROUTES |
} |
ALeRCE catsHTM routes. |
AVRO_URL | http://avro.alerce.online | ZTF AVRO/Stamps API |
AVRO_ROUTES |
} |
ZTF AVRO/Stamps API Routes |
How to contribute¶
We are open to contributions in new features or fixing issues.
To send a contribution add the #IssueNumber in the Pull Request (PR) for Issue tracker, the PR then will be assigned to the team to be reviewed.