Skip to main content

(Cosmic) Tendrils is the generic API for (cosmic) FLOWS project and pipeline.

Project description

tendrils api

Cosmic tendrils is a fully type annoted Python API endpoint for both FLOWS pipeline and project.

Currently, tendrils is reliant on the flows project webserver. However, the functionality is there for it to interface with any remote server providing an API with given URLS. all URLS can be modified in utils/urls.py to point to a different API, and tendrils can be used to interface with it.

Homepage: https://github.com/SNflows/tendrils
PYPI: https://pypi.org/project/tendrils/

installation

pip install tendrils

Requirements:

astropy, numpy, requests, tqdm
python >= 3.8

Before you begin [IMPORTANT!]

You will need to populate the included template config.ini with the right paths and flows API token. To do so, you can use the tools provided in tendrils.utils. There is:

  • a guided method that queries you in the command line for each field.
  • a function for copying from an already filled out (e.g., previous) config.ini file.
  • functions for setting each attribute separately (if you only need the API token for example)

using python shell (or ipython, or a script):

import tendrils

# Option 1
tendrils.utils.create_config()  # will also ask for location of where to store flows photometry.

# Option 2
tendrils.utils.copy_from_other_config('<path_to_other_config>')

# Option 3
# can also be called without any arguments to query for manually inputting the token.
tendrils.utils.set_api_token(token = 'my_long_token')  

After doing any of the above, your config.ini will have your API token, and all API calls will now use that token.

Dev

After clonening from the github repo, use the provided pyproject.toml file. Install using flit (pip install flit): flit install --symlink to install in EDITABLE mode. A legacy setup.py is also provided for installing with pip install -e . from the root directory. Important, do not upload you config.ini! Make sure all values are None as in the template from Pypi. We welcome all PRs.

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

tendrils-0.2.0.tar.gz (31.4 kB view hashes)

Uploaded Source

Built Distribution

tendrils-0.2.0-py3-none-any.whl (35.5 kB view hashes)

Uploaded Python 3

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