Giter Site home page Giter Site logo

egret's Introduction

Egret

A really minimal couchdb application building thingy. It consists of a single Python module which depends only on the Python Standard Library.

It works like you probably expected CouchApp to work, aside from not being a stupid furniture pun.

Usage:

egret create
- Create directory structure for a new couch app

egret push db_url
- push couch app in cwd to the couchdb server

egret pushdata db_url file
- upload documents to the couchdb server. file must contain a list of
  dictionaries, e.g. [{"_id": "foo", "bar": "baz"}, {...}]

  (caveat: this uses the couchdb bulk document api, so all features apply
  including not overwriting without the right _rev.)

egret createdb db_url
- create a database on the couchdb server. this is done automatically by
  push and pushdata if necessary

In all cases, the format of db_url is (bracketed means optional):

    [http(s)://][user:password@]server/dbname

Stuff goes here:

./shows: shows
./lists: lists
./views: views
./updates: updates

In all cases, directory structures get mapped directly to objects in the design doc. For example:

./lists/bar.js ==> "lists": {"bar": "<contents of bar.js>"}

and

./views/foo/map.js
--------------
function(doc) {
    if(doc.type == "thinger")
        emit(doc._id, doc);
}

design doc
----------
"views": {
    "foo": {
        "map": "function(doc) {\n  if(doc.type == \"thinger\")\n    emit(doc._id, doc);\n}"
     }
}

And so on.

Everything in ./attachments gets uploaded as an attachment.

egret's People

Contributors

henchan avatar mastbaum avatar seibert avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.