This document discusses using NoSQL databases with Python. It introduces Cassandra and its data model, and demonstrates how to install and use Cassandra from the command line and with the Python driver Pycassa. It shows how to perform basic operations like inserting, retrieving, and deleting data using both low-level Thrift APIs and higher-level Pycassa APIs.
42. set encontroxvi['08:30~09:00']['Titulo'] = 'Apresentacao';
set encontroxvi['08:30~09:00']['Palestrante'] = 'Marcel';
set encontroxvi['09:00~09:40']['Titulo'] = 'noSQL';
set encontroxvi['09:00~09:40']['Palestrante'] = 'Gustavo';
set encontroxvi['09:00~09:40']['Slide'] = 'bit.ly/jhae1';
48. from thrift import Thrift
from thrift.transport import TTransport
from thrift.transport import TSocket
from thrift.transport import THttpClient
from thrift.protocol import TBinaryProtocol
from cassandra import Cassandra
from cassandra.ttypes import *
import time
socket = TSocket.TSocket("localhost", 9160)
transport = TTransport.TBufferedTransport(socket)
protocol = TBinaryProtocol.TBinaryProtocol(transport)
client = Cassandra.Client(protocol)