Skip to content

rafacv/cacilda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cacilda

A Python Wiki powered by Cassandra

Author: Rafael Valverde (rafael@codeazur.com.br)

About it

Cacilda’s a Python application of WSGI protocol that implements a web-based wiki software and is powered by the non-relational database Cassandra.
Out-of-box, it offers a simple wiki system, with no authentication, logging or caching engines. Those should be implemented as middleware software without great efforts.

Because the fashion Cacilda was thought and coded – being minimal and relying the less on third-party libraries – it was necessary to reinvent the wheel at some extent,
e.g., some boilerplate code was introduced like those needed to handle POST’s variables.

Versioning system was designed to accomplish minimal storage footprint and as so it was coded using difflib module to persists only modified lines and its contexts yet being totally reversible.
All previous versions from a particular article is saved as a delta, i.e., a text-based file that keeps track of every change made. The delta snippets are relative to the newer and most adjacent change so if you want to go three versions back, you need to gradually reverse one by one.
The reason for that is that reversing changes doesn’t occur very often as getting the current version of an article. The exchange seems to be worthwhile.
Update: In fact, using difflib to track down modifications turned out to be a bad decision since the library saves all data from the two versions that are being compared in order to be able to revert any changes.

The Template class is a very simple wrapper to the standard library string.Template. I opted not to make it a function to keep things namespaced.

As a general comment, I’d like to state Cacilda is a first attempt towards learning about Cassandra and was made in a rush between readings. Don’t expect too much from the code regarding modularization or general reuse principles.
Its main purpose is to provide a concise and ready to use wiki.

Cacilda relies on:

ToDo’s:

  • Make an exception from Cacilda.not_found method so it could be easily raised from anywhere (middleware apps);
  • Implement a verison control system – currently it’s only saving an article history, there’s no way to revert versions or something alike from interface;
  • Implement a simple auth middleware;
  • Abstract routing routines. Currently it’s tightly coupled to the app – actually, it’s hardcoded into Cacilda class;
  • Load database configuration from a file;
  • Document code and write down some tests.

Database schema

The following storage-conf.xml schema is assumed when you use Cacilda:

<Keyspaces>
  <Keyspace Name="Cacilda">
    <ColumnFamily CompareWith="UTF8Type"
                  Name="wiki"
                  FlushPeriodInMinutes="60"/>
    <ColumnFamily CompareWith="UTF8Type"
                  Name="wiki_history"
                  FlushPeriodInMinutes="60"/>
  </Keyspace>
</Keyspaces>

About

Cacilda: Python wiki powered by Cassandra

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages