Skip to content

SQL database adapters forked from IOPro

License

Notifications You must be signed in to change notification settings

Global19/DBAdapter

 
 

Repository files navigation

DBAdapter

Database adapters forked from IOPro

DBAdapter is a Python module containing optimized data adapters for importing data from a variety of database sources into NumPy arrays and Pandas DataFrame. Database adapter leverages an optimized pyodbc module for accessing any relational database that supports the ODBC interface (SQL Server, PostgreSQL, MySQL, etc).

Build Requirements

Building DBAdapter requires a number of dependencies. In addition to a C/C++ dev environment, the following modules are needed, which can be installed via conda:

  • NumPy
  • Pandas
  • unixodbc 2.3.4 (C lib, Linux only)

Building Conda Package

Note: If building under Windows, make sure the following commands are issued within the Visual Studio command prompt for version of Visual Studio that matches the version of Python you're building for. Python 2.6 and 2.7 needs Visual Studio 2008, Python 3.3 and 3.4 needs Visual Studio 2010, and Python 3.5 needs Visual Studio 2015.

  1. Build DBAdapter using the following command:

    conda build buildscripts/condarecipe --python 3.5
    
  2. DBAdapter can now be installed from the built conda package:

    conda install dbadapter --use-local
    

Building By Hand

Note: If building under Windows, make sure the following commands are issued within the Visual Studio command prompt for version of Visual Studio that matches the version of Python you're building for. Python 2.6 and 2.7 needs Visual Studio 2008, Python 3.3 and 3.4 needs Visual Studio 2010, and Python 3.5 needs Visual Studio 2015.

For building DBAdapter for local development/testing:

  1. Install most of the above dependencies into environment called 'dbadapter':

    conda env create -f environment.yml
    

    Be sure to activate new dbadapter environment before proceeding.

  2. Build DBAdapter using Cython/distutils:

    python setup.py build_ext --inplace
    

Testing

Tests can be run by calling the dbadapter module's test function. By default only the TextAdapter tests will be run:

TODO: The pyodbc tests live in the dbadapter/pyodbc/test* directories. They are not being run (yet).

python -Wignore -c 'import dbadapter; dbadapter.test()'

(Note: numpy.testing might produce a FurtureWarning that is not directly relevant to these unit tests).

Related projects

About

SQL database adapters forked from IOPro

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 58.5%
  • C++ 27.5%
  • C 8.4%
  • HTML 5.2%
  • Shell 0.3%
  • CSS 0.1%