A data structure processing library - validation, response or message generation, etc.
It started life as a validation library for Clojure, born out of my experience trying to use other validation libraries.
For the latest release information, please see the Clojars entry
- Supported Clojure versions
- Developed with
1.5.1but should work down to
- Developed with
If you are using Maven, add the following repository
definition to your
<repository> <id>clojars.org</id> <url>http://clojars.org/repo</url> </repository>
The Most Recent Release
<dependency> <groupId>ohpauleez</groupId> <artifactId>themis</artifactId> <version>0.1.2</version> </dependency>
Themis aims to provide a way to process data structures and dispatch actions based on the data within a data structure.
Prismatic's graph offers a way to specify and structure computations. I am more often faced with a scenario that I'm handed a specifc piece of data (say, a hash-map), and need to perform specific actions with individual pieces of that data structure. Usually those actions are unrelated and I'd like to perform them in parallel.
One instance of this is validation. It is also sometimes the case that validation goes beyond syntactic checks (ie: a string is of a certain length), and pushes into semantic validation (ie: the address you are modeling is a real address). In many cases, semantic validation requires calling a third party service or library.
I wrote Themis first as a validation library, and later found it useful for generating response messages and data. I use the term "validation" very loosely throughout this README.
Why another validation library?
- The validation rule set should be expressed as data. Rule sets should be able to completely serialize to EDN.
- Validators should always resolve to something that supports IFn. The resolution of data to IFn-ables happens at validation time.
- Applying validation should be nothing more than applying functions and seq'ing the results together.
- Validation is often domain specific, and the library should be open for modification to easily adapt to different requirements.
- Validation results should not be conj'd/merge'd onto the original data (unless the user specifically did that).
- Validation rule sets should allow for proper namespacing of validators (symbols/functions/etc) and general data.
Assumptions and expectations
Themis attempts to make no assumptions about the data structure you're
validating, the results your validator functions return, or how
you want to package up the results of a full
When assumptions are made, there is always an escape hatch allowing you to modify the behavior to better suit your application needs.
Why the name Themis?
I was originally using
metis, a validation library named after Zeus'
first wife. So, I naturally named mine after Zeus' second wife.
Where can I find more documentation
See this project's guide
Also, see the embedded examples
Copyright © 2014 Paul deGrandis
Distributed under the Eclipse Public License, the same as Clojure.