Permalink
Browse files

Added initial version

  • Loading branch information...
0 parents commit ea4de7b1ecff090363cbabf1bbcaae59db6c1eea @mitsuhiko committed May 7, 2012
@@ -0,0 +1,2 @@
+*.pyc
+.indexes
@@ -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
@@ -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
@@ -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()
@@ -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'
+)
Oops, something went wrong.

0 comments on commit ea4de7b

Please sign in to comment.