.. _client:

Core
====

.. module:: simplecouchdb.core

This module is core module to access to CouchDB. 
It allow you to manage server, databases and document.
It try to provide all features documented in  `CouchDB references <http://wiki.apache.org/couchdb/Reference>`_ .


Example:
    
    >>> from simplecouchdb.core import Server
    >>> server = Server()
    >>> db = server.create_db('simplecouchdb_test')
    >>> doc = db.save({ 'string': 'test', 'number': 4 })
    >>> docid = doc['_id']
    >>> doc2 = db.get(docid)
    >>> doc['string']
    u'test'
    >>> del db[docid]
    >>> docid in db
    False
    >>> del server['simplecouchdb_test']

.. seealso::

    See more examples in :ref:`view-ref` documentation.

Reference
---------

.. toctree::
   :maxdepth: 2

   server
   database
   view

Exceptions
----------

.. autoexception:: simplecouchdb.core.InvalidAttachment

.. autoexception:: simplecouchdb.core.InvalidView

