Skip to main content

dace-query allows for easy querying of DACE and provides access to both public and private data through a simple utility.

Project description

Description

The dace-query package lets easily query DACE and access public and private data using a simple utility tool.

Installation

The dace-query package is available on PyPi and can be installed using pip or conda:

# Install using pip
pip install dace-query

# Make sure you have the latest version of the DACE API
pip show dace-query

# Update using pip
pip install dace-query --upgrade
# Using conda
conda install -c conda-forge dace-query

# Make sure you have the latest version of the DACE API
conda list dace-query

# Upgrade de DACE APIs
conda update dace-query

Make sure the package is installed correctly :

# Import dace
import dace_query

# List content of the dace package
help(dace)

Authentication

In order to access the private data of DACE, an authentication system has been implemented. This one works very simply, it just requires three things detailed in the following subsections:

  • A DACE account

  • An API key

  • A local .dacerc file

1. Create an account

Register on the DACE web portal with a university email address.

2. Generate the DACE API key

To obtain an API key:

  1. Login on DACE (https://dace.unige.ch)

  2. Go to the user profile

  3. Click on [Generate a new API key]

  4. Copy this new API key into the .dacerc file

3. The .dacerc file

The .dacerc file, (you have to create it), located by default in the home directory (~/.dacerc) and in TOML format, defines a user section with a key-value pair specifying the user’s API key (see below).

[user]
key = apiKey:<xxx-xxx-xxx>

For example, if your API key is 12345678-1234-5678-1234-567812345678, then the .dacerc file will be :

[user]
key = apiKey:12345678-1234-5678-1234-567812345678

To create the .dacerc file on Linux or macOs, open a terminal window and type :

printf '[user]\nkey = apiKey:%s\n' "your-api-key-here" > ~/.dacerc

Quickstart

# Import the ready-to-use exoplanet instance
from dace_query.exoplanet import Exoplanet

# Retrieve data from the exoplanet database
result: dict = Exoplanet.query_database(limit=10, output_format='dict')

# Get the planet names
planet_names: list = result.get('obj_id_catname')

# Print the planet names
print(planet_names)

For more examples of uses, such as filtering bad quality data (see Usage examples)

Documentation

The official documentation for the dace-query package is available on Read the Docs.

Contact

In case of questions, proposals or problems, feel free to contact the DACE support .

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

dace_query-3.0.0.tar.gz (79.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dace_query-3.0.0-py3-none-any.whl (89.2 kB view details)

Uploaded Python 3

File details

Details for the file dace_query-3.0.0.tar.gz.

File metadata

  • Download URL: dace_query-3.0.0.tar.gz
  • Upload date:
  • Size: 79.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for dace_query-3.0.0.tar.gz
Algorithm Hash digest
SHA256 2d0064c392740d3809b9c0653c70926dbb6b6d0bc918b4486a9daa5050ed32c1
MD5 f936d771c08ec1d4b7221dd022bb9e5e
BLAKE2b-256 4d0b61e796c0d21d793def7499cffb9a3ce715b21efefccc716fd0a432ef82b9

See more details on using hashes here.

File details

Details for the file dace_query-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: dace_query-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 89.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for dace_query-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a4bd75e37aeb1f01c649d504033d877feb69db0790bdfc9a1794ecbc7c51a251
MD5 e23fbca39242f3bc6d6adbe9e96b8a93
BLAKE2b-256 e6e06bd1859b580b8c6635e74ee2369c3522d53a8e278cddec5a48d66e515e2a

See more details on using hashes here.

Supported by

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