The data-sift Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The data-sift Reference Manual

This is the data-sift Reference Manual, generated automatically by Declt version 2.3 "Robert April" on Wed Mar 14 03:47:30 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

DATA-SIFT is a Common Lisp data validation and transformation library.
Inspired by `cl-data-format-validation`_ and `WTForms validators`_.

Usage
-----

::

  CL-USER> (data-sift:sift '(integer :min-value 0 :max-value 20) "15")
  15
  CL-USER (funcall (data-sift:compile-rule '(number :min-value 0)) "123.456")
  123.456

Built-in validators
-------------------

* **string** (&key strip (min-length 0) max-length message)
* **integer** (&key min-value max-value message)
* **number** (&key min-value max-value message)
* **regexp** (&key regex message case-insensitive-mode multi-line-mode single-line-mode extended-mode)
* **email** (&key message)
* **ip-address** (&key message)

.. _WTForms validators: http://wtforms.simplecodes.com/docs/0.6.2/validators.html
.. _cl-data-format-validation: http://www.jarw.org.uk/lisp/cl-data-format-validation.html


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 data-sift

Dependencies
Source

data-sift.asd (file)

Component

src (module)


Next: , Previous: , Up: Top   [Contents][Index]

3 Modules

Modules are listed depth-first from the system components tree.


Previous: , Up: Modules   [Contents][Index]

3.1 data-sift/src

Parent

data-sift (system)

Location

src/

Components

Next: , Previous: , Up: Top   [Contents][Index]

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

4.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.1 data-sift.asd

Location

data-sift.asd

Systems

data-sift (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.2 data-sift/src/packages.lisp

Parent

src (module)

Location

src/packages.lisp

Packages

data-sift


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.3 data-sift/src/conditions.lisp

Dependency

packages.lisp (file)

Parent

src (module)

Location

src/conditions.lisp

Exported Definitions
Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

4.1.4 data-sift/src/sift.lisp

Dependency

conditions.lisp (file)

Parent

src (module)

Location

src/sift.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

5.1 data-sift

Source

packages.lisp (file)

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

6.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.1 Generic functions

Generic Function: compile-parse-rule RULE &key MESSAGE REGEX CASE-INSENSITIVE-MODE MULTI-LINE-MODE SINGLE-LINE-MODE EXTENDED-MODE MIN-VALUE MAX-VALUE STRIP MIN-LENGTH MAX-LENGTH &allow-other-keys

Compile a validator according to RULE

Package

data-sift

Source

sift.lisp (file)

Methods
Method: compile-parse-rule (RULE (eql required)) &key MESSAGE
Method: compile-parse-rule (RULE (eql email)) &key MESSAGE
Method: compile-parse-rule (RULE (eql regexp)) &key REGEX MESSAGE CASE-INSENSITIVE-MODE MULTI-LINE-MODE SINGLE-LINE-MODE EXTENDED-MODE
Method: compile-parse-rule (RULE (eql number)) &key MIN-VALUE MAX-VALUE MESSAGE
Method: compile-parse-rule (RULE (eql integer)) &key MIN-VALUE MAX-VALUE MESSAGE
Method: compile-parse-rule (RULE (eql string)) &key STRIP MIN-LENGTH MAX-LENGTH MESSAGE
Method: compile-parse-rule (RULE function) &key &allow-other-keys
Method: compile-parse-rule (SYMBOL symbol) &rest ARGS &key &allow-other-keys
Method: compile-parse-rule (RULE cons) &key
Generic Function: compile-render-rule RULE &key &allow-other-keys

Compile a renderer according to RULE

Package

data-sift

Source

sift.lisp (file)

Methods
Method: compile-render-rule RULE &key &allow-other-keys
Generic Function: validation-fail-message CONDITION
Package

data-sift

Methods
Method: validation-fail-message (CONDITION validation-fail)
Source

conditions.lisp (file)

Method: validation-fail-message (CONDITION invalid-rule)
Source

conditions.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

6.1.2 Conditions

Condition: invalid-rule ()
Package

data-sift

Source

conditions.lisp (file)

Direct superclasses

error (condition)

Direct methods
Direct slots
Slot: source
Initargs

:source

Initform

(quote nil)

Readers

invalid-rule-source (generic function)

Slot: message
Initargs

:message

Initform

(quote nil)

Readers

validation-fail-message (generic function)

Condition: stop-validation ()
Package

data-sift

Source

conditions.lisp (file)

Direct superclasses

condition (condition)

Direct methods
Direct slots
Slot: value
Initform

(quote nil)

Readers

stop-validation-value (generic function)

Slot: message
Initform

(quote nil)

Readers

stop-validation-message (generic function)

Condition: validation-fail ()
Package

data-sift

Source

conditions.lisp (file)

Direct superclasses

error (condition)

Direct methods

validation-fail-message (method)

Direct slots
Slot: message
Initargs

:message

Initform

(quote nil)

Readers

validation-fail-message (generic function)


Previous: , Up: Definitions   [Contents][Index]

6.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.1 Special variables

Special Variable: *re-email-check*
Package

data-sift

Source

sift.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.2 Functions

Function: default-renderer OBJ
Package

data-sift

Source

sift.lisp (file)

Function: strip STR
Package

data-sift

Source

sift.lisp (file)

Function: vfail MESSSAGE &rest ARGS
Package

data-sift

Source

conditions.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

6.2.3 Generic functions

Generic Function: compile-format-rule RULE &key &allow-other-keys
Package

data-sift

Methods
Method: compile-format-rule (SYMBOL symbol) &rest ARGS &key &allow-other-keys
Source

sift.lisp (file)

Method: compile-format-rule (RULE cons) &key
Source

sift.lisp (file)

Generic Function: invalid-rule-source CONDITION
Package

data-sift

Methods
Method: invalid-rule-source (CONDITION invalid-rule)
Source

conditions.lisp (file)

Generic Function: stop-validation-message CONDITION
Package

data-sift

Methods
Method: stop-validation-message (CONDITION stop-validation)
Source

conditions.lisp (file)

Generic Function: stop-validation-value CONDITION
Package

data-sift

Methods
Method: stop-validation-value (CONDITION stop-validation)
Source

conditions.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   D   F   L   M  
Index Entry  Section

D
data-sift.asd: The data-sift<dot>asd file
data-sift/src: The data-sift/src module
data-sift/src/conditions.lisp: The data-sift/src/conditions<dot>lisp file
data-sift/src/packages.lisp: The data-sift/src/packages<dot>lisp file
data-sift/src/sift.lisp: The data-sift/src/sift<dot>lisp file

F
File, Lisp, data-sift.asd: The data-sift<dot>asd file
File, Lisp, data-sift/src/conditions.lisp: The data-sift/src/conditions<dot>lisp file
File, Lisp, data-sift/src/packages.lisp: The data-sift/src/packages<dot>lisp file
File, Lisp, data-sift/src/sift.lisp: The data-sift/src/sift<dot>lisp file

L
Lisp File, data-sift.asd: The data-sift<dot>asd file
Lisp File, data-sift/src/conditions.lisp: The data-sift/src/conditions<dot>lisp file
Lisp File, data-sift/src/packages.lisp: The data-sift/src/packages<dot>lisp file
Lisp File, data-sift/src/sift.lisp: The data-sift/src/sift<dot>lisp file

M
Module, data-sift/src: The data-sift/src module

Jump to:   D   F   L   M  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   C   D   F   G   I   M   S   V  
Index Entry  Section

C
compile-format-rule: Internal generic functions
compile-format-rule: Internal generic functions
compile-format-rule: Internal generic functions
compile-parse-rule: Exported generic functions
compile-parse-rule: Exported generic functions
compile-parse-rule: Exported generic functions
compile-parse-rule: Exported generic functions
compile-parse-rule: Exported generic functions
compile-parse-rule: Exported generic functions
compile-parse-rule: Exported generic functions
compile-parse-rule: Exported generic functions
compile-parse-rule: Exported generic functions
compile-parse-rule: Exported generic functions
compile-render-rule: Exported generic functions
compile-render-rule: Exported generic functions

D
default-renderer: Internal functions

F
Function, default-renderer: Internal functions
Function, strip: Internal functions
Function, vfail: Internal functions

G
Generic Function, compile-format-rule: Internal generic functions
Generic Function, compile-parse-rule: Exported generic functions
Generic Function, compile-render-rule: Exported generic functions
Generic Function, invalid-rule-source: Internal generic functions
Generic Function, stop-validation-message: Internal generic functions
Generic Function, stop-validation-value: Internal generic functions
Generic Function, validation-fail-message: Exported generic functions

I
invalid-rule-source: Internal generic functions
invalid-rule-source: Internal generic functions

M
Method, compile-format-rule: Internal generic functions
Method, compile-format-rule: Internal generic functions
Method, compile-parse-rule: Exported generic functions
Method, compile-parse-rule: Exported generic functions
Method, compile-parse-rule: Exported generic functions
Method, compile-parse-rule: Exported generic functions
Method, compile-parse-rule: Exported generic functions
Method, compile-parse-rule: Exported generic functions
Method, compile-parse-rule: Exported generic functions
Method, compile-parse-rule: Exported generic functions
Method, compile-parse-rule: Exported generic functions
Method, compile-render-rule: Exported generic functions
Method, invalid-rule-source: Internal generic functions
Method, stop-validation-message: Internal generic functions
Method, stop-validation-value: Internal generic functions
Method, validation-fail-message: Exported generic functions
Method, validation-fail-message: Exported generic functions

S
stop-validation-message: Internal generic functions
stop-validation-message: Internal generic functions
stop-validation-value: Internal generic functions
stop-validation-value: Internal generic functions
strip: Internal functions

V
validation-fail-message: Exported generic functions
validation-fail-message: Exported generic functions
validation-fail-message: Exported generic functions
vfail: Internal functions

Jump to:   C   D   F   G   I   M   S   V  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
M   S   V  
Index Entry  Section

*
*re-email-check*: Internal special variables

M
message: Exported conditions
message: Exported conditions
message: Exported conditions

S
Slot, message: Exported conditions
Slot, message: Exported conditions
Slot, message: Exported conditions
Slot, source: Exported conditions
Slot, value: Exported conditions
source: Exported conditions
Special Variable, *re-email-check*: Internal special variables

V
value: Exported conditions

Jump to:   *  
M   S   V  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   D   I   P   S   V  
Index Entry  Section

C
Condition, invalid-rule: Exported conditions
Condition, stop-validation: Exported conditions
Condition, validation-fail: Exported conditions

D
data-sift: The data-sift system
data-sift: The data-sift package

I
invalid-rule: Exported conditions

P
Package, data-sift: The data-sift package

S
stop-validation: Exported conditions
System, data-sift: The data-sift system

V
validation-fail: Exported conditions

Jump to:   C   D   I   P   S   V