Skip to content

Commit

Permalink
Added initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsuhiko committed May 7, 2012
0 parents commit ea4de7b
Show file tree
Hide file tree
Showing 6 changed files with 524 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
*.pyc
.indexes
4 changes: 4 additions & 0 deletions example/posts/2c341d9d-1527-4cd6-8b51-aa7ac7f786dc.yml
@@ -0,0 +1,4 @@
_id: 2c341d9d-1527-4cd6-8b51-aa7ac7f786dc
pub_date: 2011-02-01 12:30:00
slug: post2
title: This is the second post
4 changes: 4 additions & 0 deletions example/posts/80c972cf-f700-4733-814b-dc4fc76230f0.yml
@@ -0,0 +1,4 @@
_id: 80c972cf-f700-4733-814b-dc4fc76230f0
pub_date: 2011-01-01 17:23:00
slug: post1
title: This is the first post
15 changes: 15 additions & 0 deletions example/test.py
@@ -0,0 +1,15 @@
from datetime import datetime
from yamldb import Database, C


db = Database('.')
posts = db.declare_collection('posts', ['pub_date', 'slug'])

def create_posts():
posts.save({'slug': 'post1', 'title': "This is the first post",
'pub_date': datetime(2011, 1, 1, 17, 23)})
posts.save({'slug': 'post2', 'title': "This is the second post",
'pub_date': datetime(2011, 2, 1, 12, 30)})

def test_queries():
print posts.query.filter(C.pub_date.year == 2011).all()
21 changes: 21 additions & 0 deletions setup.py
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup


setup(
name='yamldb',
version='0.1',
url='http://github.com/mitsuhiko/yamldb',
license='BSD',
author='Armin Ronacher',
author_email='armin.ronacher@active-4.com',
description='Wrapper around YAML and SQLite',
py_modules=['yamldb'],
install_requires=['PyYAML>=3.0'],
include_package_data=True,
zip_safe=False,
platforms='any'
)

0 comments on commit ea4de7b

Please sign in to comment.