xn.client
A simple and pragmatic library of useful functions for querying and manipulating data via the [http://xnlogic.com](XN Logic) API
Usage
Ensure that you have [http://leiningen.org/](Leiningen 2) installed. Run
lein repl
(require '[xn.client :as xn])
(setup :url "https://production.url/v1" :token "yourapp token......")
(->> "/is/client" xn/get-vec (map :name) (take 10))
(->> "/is/client" (xn/get-map :id))
(def results (atom {}))
(xn/execute results 1
{:method :put
:url "/model/client"
:body {:name "John Doe"
:sales-rep 1
:products {:set [32 84]}}})
Data Extraction Pipeline
The extract function
TODO high level expl.
- :reader - (csv, json-file, json-lines, or a custom function that returns a collection of "raw" data records).
- :pre - A vector of functions that are composed in order, to operate on the raw file
- :rows - If the data is in a flat format like CSV. Specify field names for each column.
- :fields - Rename fields, remove them or copy them into multiple columns or set them up to merge multiple columns into one.
- :clean - Specify functions that will be used to clean any columns of raw data
- :merge-rules - Define the rules for merging data into a given field.
- :post-merge - Specify functions to clean any columns of data after the merge and copy operations have happened
- :mappings - Do any transformations necessary here in the context of a full resulting record
- :filters - Any functions that return false here will remove the record from the import
- :run - The function that will be given the resulting stream of transformed records: (fn [run-opts records])
- :run-opts - The first argument to the run function
LightMesh
Code designed for the LightMesh domain is under
the lm
namespace.
(require '[lm.import.ips :as ip])
(ip/import! "path/to/files")
License
Copyright © 2013 XN Logic