Skip to content
a simple python database
Python Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
alkali updated for v0.7.3 Mar 10, 2019
examples/pythonbytes add an rss example Mar 5, 2019
.travis.yml updated for v0.7.3 Mar 10, 2019 adding missing folk to Mar 10, 2019 rename to Mar 10, 2019
Makefile adding initial attempt at sphinx documentation Sep 3, 2016 updated docs, lots more work to do here Mar 5, 2019
req_tests.txt installing pytest-coverge instead of pytest_cov Jan 24, 2017
requirements.txt unpin dependency versions, make sure dateutil >= 2.8 Mar 5, 2019 include submodule '' in Mar 10, 2019


Alkali was featured on PythonBytes episode #119!

Alkali is a database engine, written in Python 3. It's raison d'être is to provide a Django-like ORM while controlling the on disk format. If you already have your data in a real database like Postgres then you'll want SQLAlchemy, if however, your data is in json/yaml/csv/other/etc files then Alkali might be exactly what you're looking for.

Full documentation at

For some examples, please go straight to the quickstart guide:

Here's a teaser to whet your appetite.

import os
from alkali import Database, Model, fields, tznow

class Entry(Model):

   date    = fields.DateTimeField(primary_key = True)
   title   = fields.StringField()
   body    = fields.StringField()
   created = fields.DateTimeField(auto_now_add=True)

db = Database(models=[Entry], save_on_exit=True)

e = Entry(date=tznow(), title="my first entry", body="alkali is pretty good")    # adds model instance to Entry.objects

title = Entry.objects.filter(date__le=tznow()).first().title
assert title == "my first entry"
assert os.path.getsize('Entry.json')


If you're reading this then you probably didn't install with pip install alkali and get on with your life. You probably want to be able edit the code and run tests and whatnot.

In that case run: pip install -e .[dev]


If you want to be able to build the docs then also run

pip install -e .[docs]
make html


During development pytest was the runner of choice but any unit test runner should work.


  • pytest run all tests
  • pytest -s to see stdout (any print statements)
  • pytest --cov to see test coverage
  • pytest -k test_1 to run all tests named test_1
  • pytest -k test_1 alkali/tests/ to run test_1 in
You can’t perform that action at this time.