Fork me on GitHub

Try PipeScript

You can try PipeScript online here. Paste whatever data you’d like to the box on the left, and the result of your transform will appear in the box on the right!

Go!

List of Transforms

The following is a list of all transforms built into PipeScript & ConnectorDB. Click on a transform to see details and examples of use.


NameDescription
$Identity transform - gives the current datapoint in sequence (or if given argument, a sub-object). Useful when performing comparisons ($ < 5)
alltrueReturns true if all datapoints seen have been true
anytrueReturns true if at least one of the datapoints seen was true
appendAppends data into one large string
applyApplies the given transform to each value of a JSON object
bottomTakes a json object, and returns the bottom n elements
bucketPuts numbers into custom-sized buckets. Useful for histograms.
changedReturns true if the datapoint has a different value from the previous one
containsReturns true if the given string is found in the datapoint string
countCounts the number of datapoints that have been seen.
dSame as $ - the data portion of a datapoint
dayReturns the number of days since Jan 1 1970 in the given time zone.
dayhourReturns the hour in a day during which the datapoint happened.
delAllows deleting object values
distanceReturns distance in meters from given latitude/longitude coordinates to datapoint
domainReturns the domain name/host that is used in the given url
dtReturns time difference between this and previous datapoint
filterTakes a json object, and considers each field to be a separate datapoint's data. It removes all elements for which its first argument returns true (filters).
firstReturns true if first datapoint of a sequence, and false otherwise
hourReturns the number of hours since Jan 1 1970 in the given time zone.
iEquivalent to the i in a loop over the sequence, starting from 0.
ifA datapoint filter - filters the datapoints where its argument is false.
ifelseA conditional. This is what an if statement would be in other languages.
imapSame as map, but returns all intermediate values (is one to one)
iwhileEquivalent to a while loop that runs while the first argument is true. Restarts the loop when the argument is false. The i version returns all intermediate results.
lastReturns true if last datapoint of a sequence, and false otherwise
lengthReturns the length of the given data (returns 0 on non-array-like)
mapSplits the script by the first argument's value, creating new instances of the second argument's script.
maxReturns the maximum datapoint seen thus far
meanReturns the average of all datapoints that have passed through it
minReturns the minimum datapoint seen thus far
monthReturns the number of months since Jan 1970 in the given time zone.
monthdayReturns the number of day in the datapoint's month (int)
newReturns true only when the given data was not yet seen.
nextReturns the datapoint that will be next in the sequence. If given an argument, can return the nth datapoint forward.
percentNormalizes the values of a JSON object
randReturns a random float in [0.0,1.0)
reduceTakes a json object, and considers each field to be a separate datapoint's data. It then hijacks its argument, and performs the given transform on all of the fields, returning the result.
regexReturns true if the given regular expression matches the data string
rememberBehaves as a single-datapoint memory cell, which is reset when its first argument is true.
sentimentReturns a value in [-1,1] as a simple measure of a text's sentiment
setAllows setting object values
sumAdds all of the values of the datapoints that pass through it
tThe current datapoint's timestamp in floating point unix seconds
tfalseThe time period for which a boolean stream is false before turning true
topTakes a json object, and returns the topn elements
tshiftShift the datapoint timestamp by a constant number of seconds
ttrueThe time period for which a boolean stream is true before turning false
wcReturns the number of words in the given text
weekReturns the number of weeks since Jan 5 1970 (First Monday after unix time) in the given time zone.
weekdayReturns the weekday during which the datapoint happened ('Monday','Tuesday'...)
whileEquivalent to a while loop that runs while the first argument is true. Restarts the loop when the argument is false.
yearReturns the year of the current timestamp
yeardayReturns the day of the year during which the datapoint happened [1,365] non-leap, and [1,366] for leap years.
yearmonthReturns the month name during which the datapoint happened ('January','February'...)

This Site

Contribute

ConnectorDB is a very new open-source project. If you are a designer/developer or ML enthusiast, head on over to the connectordb github, where you can choose which part of ConnectorDB you want to contribute towards! Pull requests or bug reports are welcome!