https://github.com/cbeer/trnsfrm
Transformation microservice
https://github.com/cbeer/trnsfrm
Last synced: 4 months ago
JSON representation
Transformation microservice
- Host: GitHub
- URL: https://github.com/cbeer/trnsfrm
- Owner: cbeer
- Created: 2011-11-20T15:35:46.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2011-11-21T13:17:02.000Z (over 13 years ago)
- Last Synced: 2025-01-23T02:54:56.422Z (5 months ago)
- Homepage:
- Size: 105 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Trnsfrm is a Sinatra-based application for taking an input file (from the filesystem, over http, or ftp) and running transformation scripts on it. Each transformation is represented by a Ruby class (see services/* for example transforms), which take the file and run services over it. The result is persisted to the file system and can be retrieved. All derivative output is represented in an Atom OAI-ORE resource map.
# Usage
Start the Sinatra server:
```bash
$ ruby trnsfrm.rb
```Use an HTTP POST (or GET) method:
```bash
$ curl http://localhost:8080/transform/identify?location=./Gemfile
```This page will send a `302 Redirect` to the Atom OAI-ORE resource map at
```bash
$ curl http://localhost:8080/retrieve/e4d9b5574772ddbea446e42fed6ec89a
``````xml
e4d9b5574772ddbea446e42fed6ec89a
2011-11-21T08:09:14-0500
2011-11-20T22:23:27-0500
```
Note the original input file is hashed (using MD5 here). For local
files, the requested file will by symlinked into the pairtree structure.
For HTTP/FTP requests, the file will be retrieved and placed in the Pairtree.
On subsequent requests with the same file, an existing file will be used
instead of re-fetching it. and stored in a Pairtree folder structure with
a Checkm manifest of all derivative files.Derivative files may be retrieved by following the links:
```bash
curl http://localhost:8080/retrieve/e4d9b5574772ddbea446e42fed6ec89a/identify
``````
./ORIGINAL: ASCII text
```More complex transformations can be implemented, including those that
require extensive background processing (due to long running times,
queueing, etc), one-to-many output, etc.