Skip to main content

Easy access to access DES DB. Command line interpreter client for DESDM

Project description

# easyaccess <a href="https://github.com/mgckind/easyaccess/releases/tag/1.2.0"> <img src="https://img.shields.io/badge/release-v1.2.0-blue.svg" alt="latest release" /></a> <a href="https://github.com/mgckind/easyaccess/blob/master/LICENSE.txt"><img src="https://img.shields.io/badge/license-NCSA%20License-blue.svg" alt="License" /> </a> <a href="https://pypi.python.org/pypi/easyaccess/1.2.0"><img src="https://img.shields.io/badge/pypi-v1.2.0-orange.svg" alt="pypi version"/></a>
![help_screen](help_screenshot.png)

Refactored version of trivialAccess for accessing the DES DB

Python Command Line Interpreter to access Oracle DES DB
using cx_Oracle

For a short tutorial (To be completed) check [here](http://deslogin.cosmology.illinois.edu/~mcarras2/data/DESDM.html)
(Using des credentials)


**Current version = 1.2.0**

## Requirements

- Oracle Client > 11g.2 (External library, no python)
Check [here](https://opensource.ncsa.illinois.edu/confluence/display/DESDM/Instructions+for+installing+Oracle+client+and+easyaccess+without+EUPS) for instructions on how to install these libraries
- [cx_Oracle](https://bitbucket.org/anthony_tuininga/cx_oracle)
- [fitsio](https://github.com/esheldon/fitsio) >= 0.9.6
- [pandas](http://pandas.pydata.org/) >= 0.14
- [termcolor](https://pypi.python.org/pypi/termcolor)
- [PyTables](http://pytables.github.io/) (optional, for hdf5 output)
- [future](http://python-future.org/) (for python 2/3 compatibility)
- **Note that you need to install python-future for python2/3 compatibility**

## Some *nice* features
- Nice output format
- Very flexible configuration
- Smart tab completion for commands, table names, column names and file paths accordingly
- write output results to csv, tab, fits files or HDF5 files
- load tables from csv or fits directly into DB
- intrinsic db commands to describe tables, own schema, quota and more
- It can be imported as module
- Can run command directly from command line
- Load sql query from file and/or from editor
- Show the execution plan of a query if required
- Many more

## Basic use

### Running SQL commands
Once inside the interpreter run SQL queries by adding a ; at the end::

DESDB ~> select ... from ... where ... ;

To save the results into a table add ">" after the end of the query (after ";") and namefile at the end of line

DESDB ~> select ... from ... where ... ; > test.fits

The files supported so far are (.csv, .tab, .fits, .h5) any other extension is ignored

### Load tables
To load a table it needs to be in a csv format with columns names in the first row
the name of the table is taken from filename


DESDB ~> load_table <filename>

### Load SQL queries
To load sql queries just run:

DESDB ~> loadsql <filename.sql>
or

DESDB ~> @filename.sql

The format is the same as in command line, SQL statement must end with ;
and to write output files it must be followed by > <output file>

### Configuration

The configuration file is located at $HOME/.easyaccess/config.ini

but everything can be configured from inside easyaccess

type:

DESDB ~> help config

to see the meanings of all the options, and:

DESDB ~> config all show

to see the current values, to modify one value, e.g., the prefetch value

DESDB ~> config prefetch set 50000

and to see any particular option (e.g., timeout):

DESDB ~> config timeout show


### TODO
- There is a bug with some versions of readline
- Other small changes when loading tables
- Self-upgrade

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

easyaccess-1.2.0.tar.gz (124.2 kB view details)

Uploaded Source

Built Distribution

easyaccess-1.2.0.macosx-10.6-x86_64.exe (116.2 kB view details)

Uploaded Source

File details

Details for the file easyaccess-1.2.0.tar.gz.

File metadata

  • Download URL: easyaccess-1.2.0.tar.gz
  • Upload date:
  • Size: 124.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for easyaccess-1.2.0.tar.gz
Algorithm Hash digest
SHA256 f06d5a210dbceebc313be4b88f9b1f42d498deb2b18574eb4f19816f5421a6d9
MD5 93c19f148b55b4cdfc1a9492a4240772
BLAKE2b-256 6644e0f534b85cba21e10e50a0b72808aff236067997ed62987a41b868ed38a4

See more details on using hashes here.

File details

Details for the file easyaccess-1.2.0.macosx-10.6-x86_64.exe.

File metadata

File hashes

Hashes for easyaccess-1.2.0.macosx-10.6-x86_64.exe
Algorithm Hash digest
SHA256 fbcde09d37d359c63129d3e34749cd2a558c143a098813a186ab5b2c7f4dd755
MD5 ac540ae650fa82efcb678546b7d978e1
BLAKE2b-256 c26b7bea0fb32d6de7a7c5436db790b04af1a0aefddabace4f8f48fcef594c93

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