This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Write to multiple databases and formats easily from python

Project Description

Description

This project is useful in any scenario where you need to write some data in a readable manner quickly and easily.

It can be used to write to:

  • csv
  • sqlite
  • mysql
  • redis
  • mongo
  • postgres
  • aerospike

Look at https://pypi.python.org/pypi/data-readers/ to write to them. This library was written with the intention to be useful without data-readers but they work very well together.

Setup

Install

pip install data-writers

Usage

Import DataWriter

from datawriters.datawriter import DataWriter

Create a list of dictionaries for your data:

data = [{“column1”:”row1-item1”, “column2”:”row1-item2”}, {“column1”:”row2-item1”, “column2”:”row2-item2”}, {“column1”:”row3-item1”, “column2”:”row3-item2”}]

csv

DataWriter(writer=’csv’, database=’data.csv’).save(data)

sqlite

DataWriter(writer=’sqlite’, database=’data.sqlite’, table=’DataTable’).save(data)

mysql

DataWriter(writer=’mysql’, database=’data’, user=’root’, table=’DataTable’).save(data)

redis

DataWriter(writer=’redis’, database=‘1’).save(data)

mongo

DataWriter(writer=’mongo’, database=’data’, table=’DataTable’).save(data)

postgres

DataWriter(writer=’postgres’, database=’data’, table=’DataTable’).save(data)

aerospike

DataWriter(writer=’aerospike’, namespace=’data’, set=’DataTable’).save(data)
Release History

Release History

This version
History Node

0.5.3

History Node

0.5.2

History Node

0.5.1

History Node

0.5.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
data-writers-0.5.3.zip (14.8 kB) Copy SHA256 Checksum SHA256 Source Aug 6, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting