Skip to content
✂️ A little app that transforms and formats data.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
transformer Renamed 'string_to_line_items' files to 'line_itemizer' Feb 13, 2019
.gitignore Use port 8888 since 8080 is already used by zapier/zapier Dec 12, 2017
.travis.yml
LICENSE Rename LICENSE.md to LICENSE Jan 23, 2016
Procfile Add Newrelic monitoring Jan 28, 2016
README.md README tweaks Jan 8, 2018
requirements.txt
run_tests.sh
runtime.txt Specify runtime Dec 5, 2017

README.md

Transformer (by Zapier)

Transformer is a little web app that performs data transformations. You specify one of the pre-defined transforms to run, along with some input data, and the app will run the data through the transform and return the output.

Usage

GET / - Lists all the available transforms

GET /?category=<category_name> - Lists transforms in a category. Category can be one of: date, number, string, util

GET /fields?transform=<transform_name> - Tells you required data for the given transform. transform_name should be a key from the / endpoint

POST /transform - Run a transform. The request body will look something like this:

{
  "transform": "string.upper_case",
  "inputs": ["abc"],
}

Setup

virtualenv --python=python2.7 env27
. env27/bin/activate
pip install -r requirements.txt

Run Locally

. env27/bin/activate
DEBUG=true PORT=8888 python transformer/app.py

Test Locally

. env27/bin/activate
./run_tests.sh

Contributing

If you have a transform that you think would be useful, fork the repo, add the transform, and then make a pull request. To get started, check out the base class for the interface and the trim space transform an example.

When making changes, here are some style considerations to keep in mind:

  • We follow a modified version of PEP8. Essentially, keep your code looking like the rest of the codebase and you'll be fine
  • When naming a transform, separate the file name by words. i.e. "Trim space" lives in "trim_space.py"
You can’t perform that action at this time.