Package BioSQL :: Module BioSeqDatabase
[hide private]
[frames] | no frames]

Module BioSeqDatabase

source code

Connect with a BioSQL database and load Biopython like objects from it.

This provides interfaces for loading biological objects from a relational
database, and is compatible with the BioSQL standards.

Classes [hide private]
  DBServer
Represents a BioSQL database continaing namespaces (sub-databases).
  _CursorWrapper
A wraper for mysql.connector resolving bytestring representations.
  Adaptor
High level wrapper for a database connection and cursor
  MysqlConnectorAdaptor
A BioSQL Adaptor class with fixes for the MySQL interface
  BioSeqDatabase
Represents a namespace (sub-database) within the BioSQL database.
Functions [hide private]
 
open_database(driver='MySQLdb', **kwargs)
Main interface for loading a existing BioSQL-style database.
source code
Variables [hide private]
  _POSTGRES_RULES_PRESENT = False
  _interface_specific_adaptors = {'mysql.connector': <class 'Bio...
  _allowed_lookups = {'accession': 'fetch_seqid_by_accession', '...
  __package__ = 'BioSQL'
Function Details [hide private]

open_database(driver='MySQLdb', **kwargs)

source code 
Main interface for loading a existing BioSQL-style database.

This function is the easiest way to retrieve a connection to a
database, doing something like:

    >>> from BioSeq import BioSeqDatabase
    >>> server = BioSeqDatabase.open_database(user="root", db="minidb")

Arguments:
 - driver - The name of the database driver to use for connecting. The
   driver should implement the python DB API. By default, the MySQLdb
   driver is used.
 - user -the username to connect to the database with.
 - password, passwd - the password to connect with
 - host - the hostname of the database
 - database or db - the name of the database


Variables Details [hide private]

_interface_specific_adaptors

Value:
{'mysql.connector': <class 'BioSQL.BioSeqDatabase.MysqlConnectorAdapto\
r'>}

_allowed_lookups

Value:
{'accession': 'fetch_seqid_by_accession',
 'display_id': 'fetch_seqid_by_display_id',
 'gi': 'fetch_seqid_by_identifier',
 'name': 'fetch_seqid_by_display_id',
 'primary_id': 'fetch_seqid_by_identifier',
 'version': 'fetch_seqid_by_version'}