Package pysql :: Module pysqlmain
[hide private]
[frames] | no frames]

Module pysqlmain

source code

Pysql is an Oracle client for all those who suffer from sqlplus.

It aims to bring confort and power to user without a heavy graphical application.

Developpers (in order of arrival in the project) :
- Sébastien Renard
- Sébastien Delcros
- <your name here if you want to contribute ! (your firstname must be Sebastien of course)

- Mandatory:
    o python. Pysql has been tested with Python 2.4.x and 2.5.0
    o cx_Oracle :
- Optionnal:
    o pyreadline for Windows user to have input completion
    o cTypes for windows user to have input completion (already included in Python 2.5)
    o pydot for graphical functions (show datamodel in png for example)
    o pyparser as a dependancy of pydot

Supported plateforms:
- GNU/Linux (developper choice!)
- Windows (some limitations: poor completion and no colors)
- AIX (cx_Oracle is quite painfull to install, but all works correctly)

Pysql should work on many other platform (like Solaris, HPUX, MacOSX, *BSD) but has not been
tested. Feel free to report success to the pysql team.

Very simple for the moment, you can put pysql everywhere. Just put the pysql command in your path.

Internationalisation (i18n):
Pysql is available in English (base langage for developpement) and French.
To generate other language messages, use "" script in the pysql directory. You'll need
GNU Gettext to achieve this.
Next, to use pysql in French, set the LANG variable to fr (export LANG=fr) « et voilà » !

API documentation can be found in doc/ directory.
User documentation is available in pysql itself. Type « help » to get some help.

Modules overview:
- main module. Just used to setup i18n and fire the shell
- user shell interaction. All pysql « command » are here.
                pysqlshell command handle argument parsing and display.
                Real works is done in pysqlfunction.
- :advanced functions for pysql.
- all configuration stuff (parameters, cache, history, user sql library...)
- object model for main Oracle objects (table, view, package, index).
                    this is used for functions like desc and edit
- all graphical stuff that creates images with graphviz
- an effort is done to put all SQL queries in this module to have a cleaner code
- color bank definition
- all connection and cursor handling. Also manages background queries
- all pysql defined exceptions

Developpement conventions:
- classes must begin with an uppercase caracter
- variables must begin with a lowercase caracter and user alternate uppercase instead of _
- all lines must be less than 109 characters (ask developpers why)
- all patches must be sent to

@author: Sébastien Renard (
@author: Sébastien Delcros (
@license: GNU GPL V3

Functions [hide private]
Pysql main function
source code
Sets the right encoding
source code
Parses pysql command argument using optparse python module
source code