Code Monkey home page Code Monkey logo

pytds's Introduction

pytds

https://secure.travis-ci.org/denisenkom/pytds.png?branch=master https://ci.appveyor.com/api/projects/status/a5h4y29063crqtet?svg=true

Python DBAPI driver for MSSQL using pure Python TDS (Tabular Data Stream) protocol implementation. Doesn't depend on ADO or FreeTDS. Can be used on any platform, including Linux, MacOS, Windows.

It can be used with https://pypi.python.org/pypi/django-sqlserver as a Django database backend.

Features

  • Fully supports new MSSQL 2008 date types: datetime2, date, time, datetimeoffset
  • MARS
  • Bulk insert
  • Table-valued parameters
  • TLS connection encryption
  • Kerberos support on non-Windows platforms (requires kerberos package)

Installation

To install run this command:

$ pip install python-tds

If you want to use TLS you should also install pyOpenSSL package:

$ pip install pyOpenSSL

For a better performance install bitarray package too:

$ pip install bitarray

To use Kerberos on non-Windows platforms (experimental) install kerberos package:

$ pip install kerberos

Documentation

Documentation is available at https://python-tds.readthedocs.io/en/latest/.

Example

To connect to database do

import pytds
with pytds.connect('server', 'database', 'user', 'password') as conn:
    with conn.cursor() as cur:
        cur.execute("select 1")
        cur.fetchall()

To enable TLS you should also provide cafile parameter which should be a file name containing trusted CAs in PEM format.

For detailed documentation of connection parameters see: pytds.connect

pytds's People

Contributors

denisenkom avatar vflashm avatar lhcgreg avatar tpow avatar diegueus9 avatar quinox avatar takoau avatar terratrue-daniel avatar tarper24 avatar niphlod avatar niconil avatar allaboutmikey avatar shubha-rajan avatar sandrotosi avatar mariusdkm avatar deronnax avatar jackwotherspoon avatar m32 avatar radyz avatar zdxerr avatar chadcatlett avatar aersam avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.