Skip to main content

Simple API to access to existing astronomical MySQL database

Project description

Build Status

astroSQL - Simple Database Tools for Python

Simple Python API to access existing astronomy MySQL database.

While designed for astronomy, astroSQL can be used for every field.


  • astroSQL Python API:
    • [x] create SQL database table
    • [x] read SQL database table
    • [x] update SQL database table
    • [x] SQL query using peewee ORM
  • astroSQL Shell Command
    • [ ] query SQL database to text-based file
    • [ ] update SQL database with text-based file  


  • MySQL server
  • Python 3.x


  1. Perform a pip install,

    $ pip install astroSQL

    Check the version installed:

    $ pip show astroSQL
  2. Edit the configuration file as necessary in ~/.astrosql/config.yml:

    # Uncomment 'forward' if you want to place config.yml elsewhere, specify the file path (maybe `~/.astrosql/config.yml` ?)
    # forward: '/path/to/config.yml'
    # Comment out any unecessary lines, empty will be read
        host: 'localhost'
        user: 'username'
        password: ''
        database: 'database_name'

    WARNING: Keep this file secure if password is written

  3. Test setup

    >>> from astrosql.sqlconnector import connect
    >>> from astrosql import AstroSQL
    >>> db = AstroSQL(connect()) # connect does not need args as it reads from config.yml
    >>> db.tables.values()
    dict_values(['tb1, tb2, ...']) # should output all table names from your database


See wiki:


Filippenko Group - Project Team

The program was built for the Filippenko Group, astronomy researchers led by Alex Filippenko for analyzing data from the Lick Observatory and Keck Observatory.

Project team led by Keto Zhang and Weikang Zheng.

Source Code and Inspiration:

Some parts of the program was provided by and inspired from Issac Shiver and Thomas Tu from the FlipperPhoto repository.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for astrosql, version 0.3.0
Filename, size File type Python version Upload date Hashes
Filename, size astrosql-0.3.0-py3-none-any.whl (11.7 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size astrosql-0.3.0.tar.gz (10.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page