pyCloudy
0.9.6
manage Cloudy photoionization code
|
Inherits object.
Public Member Functions | |
def | __init__ |
def | __del__ (self) |
def | connect_dB (self) |
def | use_dB |
def | use_dB_tmp |
def | show_tables (self) |
def | share_dB_cursor (self, m) |
def | close_dB (self) |
def | exec_dB |
def | select_dB |
def | count_dB |
def | get_fields |
def | get_cols |
def | get_dtype |
def | __repr__ (self) |
Public Attributes | |
log_ | |
calling | |
SQLdb | |
OVN_dic | |
base_name | |
tmp_base_name | |
user_name | |
user_passwd | |
port | |
host | |
unix_socket | |
table | |
connected | |
Static Public Attributes | |
tuple | MdBlog_ = my_logging() |
def __init__ | ( | self, | |
OVN_dic = None , |
|||
base_name = 'OVN' , |
|||
tmp_base_name = 'OVN_tmp' , |
|||
user_name = 'OVN_user' , |
|||
user_passwd = 'getenv' , |
|||
host = 'localhost' , |
|||
unix_socket = '/var/mysql/mysql.sock' , |
|||
port = 3306 , |
|||
connect = True , |
|||
master_table = 'tab' |
|||
) |
This is the package to deal with MySQL OVN database. You must have MySQL or PyMySQL library installed. The latest is easier to get working, as it comes with its own mysql client. Latter, we will also use the ODBC connector. Install the connector from MySQl: http://dev.mysql.com/downloads/connector/odbc/ and then use pyodbc with: cnxn = pyodbc.connect('DRIVER={MySQL ODBC 5.2 Driver};SERVER=127.0.0.1;DATABASE=OVN;UID=OVN_user;PWD=oiii5007;SOCKET=/var/mysql/mysql.sock')
def __del__ | ( | self | ) |
def __repr__ | ( | self | ) |
def close_dB | ( | self | ) |
def connect_dB | ( | self | ) |
def count_dB | ( | self, | |
from_ = None , |
|||
where_ = None , |
|||
commit = False |
|||
) |
def exec_dB | ( | self, | |
command, | |||
format_ = 'dict' , |
|||
return_descr = False , |
|||
commit = False |
|||
) |
def get_cols | ( | self, | |
select_ = '*' , |
|||
from_ = None |
|||
) |
def get_dtype | ( | self, | |
select_ = '*' , |
|||
from_ = None |
|||
) |
def get_fields | ( | self, | |
from_ = None |
|||
) |
def select_dB | ( | self, | |
select_ = '*' , |
|||
from_ = None , |
|||
where_ = None , |
|||
order_ = None , |
|||
group_ = None , |
|||
limit_ = 1 , |
|||
format_ = 'dict' , |
|||
dtype_ = None , |
|||
commit = False |
|||
) |
Usage: dd, n = mdb.select_dB(select_ = 'L_1, L_26, L_21', from_='tab', where_ = 'ref like "DIG12HR_"', limit_ = 100000, format_='numpy') loglog(dd['L_26']/dd['L_1'], dd['L_21']/dd['L_1'], 'r+')
def share_dB_cursor | ( | self, | |
m | |||
) |
def show_tables | ( | self | ) |
def use_dB | ( | self, | |
base_name = None |
|||
) |
def use_dB_tmp | ( | self, | |
tmp_base_name = None |
|||
) |
base_name |
calling |
connected |
host |
log_ |
|
static |
OVN_dic |
port |
SQLdb |
table |
tmp_base_name |
unix_socket |
user_name |
user_passwd |