Skip to main content

A python package for astronomical calculations

Project description

Author: Behrouz Safari
License: MIT

astrobook

Educational tools for the astronomical book

Installation

Install the latest version:

pip install astrobook

Requirements are numpy, pandas, and requests.

Examples

from astrobook import sql2df

# Retrieve data from SIMBAD
df = sql2df('SELECT TOP 10 main_id, ra, dec FROM basic', api='simbad')

# Retrieve data from VizieR
df = sql2df('SELECT objID, gmag, zsp FROM "V/154/sdss16"', api='vizier')

# Retrieve data from Gaia DR3
df = sql2df('SELECT TOP 10 source_id, ra, dec FROM gaiadr3.gaia_source', api='gaia')

Get tables in a database

Here we get name, description and number of rows of tables from IRSA database

from astrobook import sql2df

query = """
SELECT table_name, description, irsa_nrows
FROM TAP_SCHEMA.tables
WHERE irsa_nrows IS NOT NULL
ORDER BY irsa_nrows DESC
"""

df = sql2df(query, api='irsa')

Get columns of a table

Let's get columns of the table basic from SIMBAD

from astrobook import sql2df

query = """
SELECT column_name, description
FROM TAP_SCHEMA.columns
WHERE table_name='basic'
"""

df = sql2df(query, api='simbad')

See more at behrouzz.github.io/astrodatascience

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

astrobook-0.0.2.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

astrobook-0.0.2-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file astrobook-0.0.2.tar.gz.

File metadata

  • Download URL: astrobook-0.0.2.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.7

File hashes

Hashes for astrobook-0.0.2.tar.gz
Algorithm Hash digest
SHA256 9bea85a8421e57e52e53507cde28ee7eb838ce9281e86fc2ecd87bcdbf1dc9c6
MD5 b6d4a36b01802d34cdf6b84dac619b9f
BLAKE2b-256 18300f9f927f57696b5c183e8976654ae64cd67772305e961d96115de9e465a3

See more details on using hashes here.

File details

Details for the file astrobook-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: astrobook-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.7

File hashes

Hashes for astrobook-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a0c99a0616a46fb1f3538e53f3cec175b6e517bbeb1d65e3647b6cc686f9029c
MD5 8da04befe8e82c56e7f9dc6b9da065ff
BLAKE2b-256 1b110cacf7394fc2e54e843a833783d223177ff96f2ba262f7ebff203e5cc46f

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