python database access his describes the programming interfaces that python uses to interface with relational and hash table style databases unlike other that describe specific library modulesthe material in this partly applies to third-party extensions for exampleif you want python to interface with mysql or oracle databaseyou would first have to download third-party extension module that modulein turnwould then follow the basic conventions described here relational database api specification for accessing relational databasesthe python community has developed standard known as the python database api specification or pep for short (the formal description can be found at database modules ( mysqloracleand so onfollow this specificationbut may add even more features this section covers the essential elements needed to use it for most applications at high levelthe database api defines set of functions and objects for connecting to database serverexecuting sql queriesand obtaining results two primary objects are used for thisa connection object that manages the connection to the database and cursor object that is used to perform queries connections to connect to databaseevery database module provides module-level function connect(parametersthe exact parameters depend on the database but typically include information such as the data source nameuser namepasswordhost nameand database name typically these are provided with keyword arguments dsnuserpasswordhostand databaserespectively soa call to connect(might look like thisconnect(dsn="hostname:dbname",user="michael",password="peekaboo"if successfula connection object is returned an instance of connection has the following methodsc close(closes the connection to the server lib fl ff