New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cushion

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cushion

A simple wrapper for CouchDB

  • 0.2
  • PyPI
  • Socket score

Maintainers
1

Cushion: a simple CouchDB Document API wrapper

    This is a Python wrapper for the CouchDB Document API (http://wiki.apache.org/couchdb/HTTP_Document_API). 
    It was created primarily as an exercise to learn CouchDB's document API.  
    The library attempts to expose a very simple interface that closely resembles REST.

    For example,

    	from cushion import api

        c = api.Cushion("http://localhost:5984/albums",
    		username='abc',
    		password='xyz'
    	)
    	c.get(id='1b0c7bb19b1bbacf7f567bf379000d9c')

    returns the following JSON object:

        {
    		'Band': 'The Postal Service',
    		'_rev':'1-f319aeef4dbb8c232f0257cf2a9ae64b',
    		'_id': '1b0c7bb19b1bbacf7f567bf379000d9c',
    		'Name': 'Give Up'
    	}

    alternatively, the database can be specified at runtime,

    	c = api.Cushion("http://localhost:5984",
    		username='abc',
    		password='xyz',
    		timeout=5
    	)
    	c.get.albums(id='1b0c7bb19b1bbacf7f567bf379000d9c')

    which also returns:

    	{
    		'Band': 'The Postal Service',
    		'_rev':'1-f319aeef4dbb8c232f0257cf2a9ae64b',
    		'_id': '1b0c7bb19b1bbacf7f567bf379000d9c',
    		'Name': 'Give Up'
    	}
    
    to create a document with a document id:

        c.put.albums(id='c3ea09f0-9758-480c-aa25-0f71a9caa446', Name='Transatlanticism', Band='Death Cab For Cutie')

    alternatively, to create a document without supplying the document id:

        c.post.albums(Name='In Ghost Colors', Band='Cut Copy')

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc