**Author:** [Behrouz Safari](https://behrouzz.github.io/)<br/>
**License:** [MIT](https://opensource.org/licenses/MIT)<br/>
# astrobook
*Educational tools for the astronomical book*
## Installation
Install the latest version:
pip install astrobook
Requirements are *numpy*, *pandas*, and *requests*.
## Examples
```python
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
```python
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
```python
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](https://behrouzz.github.io/astrodatascience/)
Raw data
{
"_id": null,
"home_page": "https://github.com/behrouzz/astrobook",
"name": "astrobook",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": null,
"author": "Behrouz Safari",
"author_email": "behrouz.safari@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/aa/45/1891e0fde634ad3748bb2b557462ff815b51e136b7c5d7f590c7a368fdab/astrobook-0.0.3.tar.gz",
"platform": null,
"description": "**Author:** [Behrouz Safari](https://behrouzz.github.io/)<br/>\r\n**License:** [MIT](https://opensource.org/licenses/MIT)<br/>\r\n\r\n# astrobook\r\n*Educational tools for the astronomical book*\r\n\r\n\r\n## Installation\r\n\r\nInstall the latest version:\r\n\r\n pip install astrobook\r\n\r\nRequirements are *numpy*, *pandas*, and *requests*.\r\n\r\n\r\n## Examples\r\n\r\n\r\n```python\r\nfrom astrobook import sql2df\r\n\r\n# Retrieve data from SIMBAD\r\ndf = sql2df('SELECT TOP 10 main_id, ra, dec FROM basic', api='simbad')\r\n\r\n# Retrieve data from VizieR\r\ndf = sql2df('SELECT objID, gmag, zsp FROM \"V/154/sdss16\"', api='vizier')\r\n\r\n# Retrieve data from Gaia DR3\r\ndf = sql2df('SELECT TOP 10 source_id, ra, dec FROM gaiadr3.gaia_source', api='gaia')\r\n```\r\n\r\n### Get tables in a database\r\n\r\nHere we get name, description and number of rows of tables from IRSA database\r\n\r\n\r\n```python\r\nfrom astrobook import sql2df\r\n\r\nquery = \"\"\"\r\nSELECT table_name, description, irsa_nrows\r\nFROM TAP_SCHEMA.tables\r\nWHERE irsa_nrows IS NOT NULL\r\nORDER BY irsa_nrows DESC\r\n\"\"\"\r\n\r\ndf = sql2df(query, api='irsa')\r\n```\r\n\r\n### Get columns of a table\r\n\r\nLet's get columns of the table *basic* from SIMBAD\r\n\r\n```python\r\nfrom astrobook import sql2df\r\n\r\nquery = \"\"\"\r\nSELECT column_name, description\r\nFROM TAP_SCHEMA.columns\r\nWHERE table_name='basic'\r\n\"\"\"\r\n\r\ndf = sql2df(query, api='simbad')\r\n```\r\n\r\n\r\nSee more at [behrouzz.github.io/astrodatascience](https://behrouzz.github.io/astrodatascience/)\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A python package for astronomical calculations",
"version": "0.0.3",
"project_urls": {
"Homepage": "https://github.com/behrouzz/astrobook"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f52bac9cbe322e9ec8f05fae4d5427ae76e868ac00b442cb01e966f87de47e1e",
"md5": "89c799122f6be74ab34642518f57a012",
"sha256": "272b8d9a5e581bd4220361a6f846c05dcda961f4b0348ebe7ba0b0d56ea6be76"
},
"downloads": -1,
"filename": "astrobook-0.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "89c799122f6be74ab34642518f57a012",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 3578,
"upload_time": "2024-08-07T18:48:31",
"upload_time_iso_8601": "2024-08-07T18:48:31.035694Z",
"url": "https://files.pythonhosted.org/packages/f5/2b/ac9cbe322e9ec8f05fae4d5427ae76e868ac00b442cb01e966f87de47e1e/astrobook-0.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "aa451891e0fde634ad3748bb2b557462ff815b51e136b7c5d7f590c7a368fdab",
"md5": "bbff7d1e21d4235f0ce9a13596c524ba",
"sha256": "d3b4e665830412c158e058514ce44d28d75baa8206af8e619cf106c6a21e2e3d"
},
"downloads": -1,
"filename": "astrobook-0.0.3.tar.gz",
"has_sig": false,
"md5_digest": "bbff7d1e21d4235f0ce9a13596c524ba",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 3339,
"upload_time": "2024-08-07T18:48:32",
"upload_time_iso_8601": "2024-08-07T18:48:32.244505Z",
"url": "https://files.pythonhosted.org/packages/aa/45/1891e0fde634ad3748bb2b557462ff815b51e136b7c5d7f590c7a368fdab/astrobook-0.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-07 18:48:32",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "behrouzz",
"github_project": "astrobook",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "astrobook"
}