Server class

class simplecouchdb.core.Server(uri='http://127.0.0.1:5984', transport=None)

Server object that allow you to acces and manage a CouchDB host. A Server object could be used like any dict object.

Properties

uri
Str, uri of couchdb server.
http
An http instance from httplib2.http. Could be used to manage authentification to your server or proxy.
headers
Dict or string, optionnal HTTP headers that you need.

Methods

info()

info of server

Returns:dict
all_dbs()
get list of databases in CouchDb host
create_db(dbname)

Create a database on CouchDb host

Parameters:
  • dname – str, name of db
Returns:

Database instance if it’s ok

delete_db(dbname)

delete a database in CouchDB host

Parameters:
  • dbname – str, name of database
get_db(dbname)

get database

Parameters:
  • dbname – str, name of database
Returns:

Database instance if dbname in server, None

if it don’t exist.

db_exist(dbname)

test if database exist in CouchDB host.

Parameters:
  • dbname – str, name of database
Returns:

bool, True if it exist

compact_db(dbname)
compact database
replicate(source, target)
replicate database. source and target are uri
__contains__(dbname)
__iter__()
__len__()
__nonzero__()
__delitem__(dbname)
__getitem__(dbname)

Previous topic

Core

Next topic

Database class

This Page

Quick search