File Converter

No algorithm description given

message from the author: If you noticed a particular file conversion is missing that you'd like us to support, please leave a comment below and I'll be happy to add that to our growing list! Table of Contents Introduction I/O Examples Credits Algorithm Console Introduction This algorithm can convert a file to a bunch of other formats, allowing you to always have a file in the format you require! here are the currently available conversions: image(png, jpg, etc), html, csv, docx, odt, txt, md -> pdf
image(png, jpg, etc), pdf, html, txt -> img
html, md, txt -> docx, odt
txt, doc, docx, odt, md -> html
 The algorithm doesn't detect the input file by extension, but rather by liberal user of unix file , a rather versatile file detection tool. I/O Input { 
 "input":String,
 "output":String,
 "collection":"String
}
 input - (required) - The input file to convert, can be either hosted on the data API ( data:// , dropbox:// , or s3:// ), or as a public HTTP web resource. output - (required) - The file name & format you want to convert to, the extension of the filename determines how the conversion is performed. collection - (required) - the algorithmia data collection that you'd like to place your newly converted file into, can be data:// , dropbox:// or s3:// . Output "output":String
 output - the complete path to your newly converted file. Example input {      "input":"data://util/Temp/dogs_and_cats.csv",    "output":"dogs_and_cats.pdf",    "collection":"data://.algo/perm" }
 output "data://.algo/perm/dogs_and_cats.pdf"
 Credits most text conversions would be nearly impossible without the fantastic work done by the pandoc team! For some special conversions like html to pdf , we used wkhtmltoX , another fantastic open source conversion application. All image conversions were made possible by imagemagick and the wand python package.

Tags
(no tags)

Cost Breakdown

5 cr
royalty per call
1 cr
usage per second
avg duration

Cost Calculator

API call duration (sec)
×
API calls
=
Estimated cost
per calls
for large volume discounts
For additional details on how pricing works, see Algorithmia pricing.

Internet access

This algorithm has Internet access. This is necessary for algorithms that rely on external services, however it also implies that this algorithm is able to send your input data outside of the Algorithmia platform.


To understand more about how algorithm permissions work, see the permissions documentation.

1. Type your input

2. See the result

Running algorithm...

3. Use this algorithm

curl -X POST -d '{{input | formatInput:"curl"}}' -H 'Content-Type: application/json' -H 'Authorization: Simple YOUR_API_KEY' https://api.algorithmia.com/v1/algo/util/FileConverter/0.2.8
View cURL Docs
algo auth
# Enter API Key: YOUR_API_KEY
algo run algo://util/FileConverter/0.2.8 -d '{{input | formatInput:"cli"}}'
View CLI Docs
import com.algorithmia.*;
import com.algorithmia.algo.*;

String input = "{{input | formatInput:"java"}}";
AlgorithmiaClient client = Algorithmia.client("YOUR_API_KEY");
Algorithm algo = client.algo("algo://util/FileConverter/0.2.8");
AlgoResponse result = algo.pipeJson(input);
System.out.println(result.asJsonString());
View Java Docs
import com.algorithmia._
import com.algorithmia.algo._

val input = {{input | formatInput:"scala"}}
val client = Algorithmia.client("YOUR_API_KEY")
val algo = client.algo("algo://util/FileConverter/0.2.8")
val result = algo.pipeJson(input)
System.out.println(result.asJsonString)
View Scala Docs
var input = {{input | formatInput:"javascript"}};
Algorithmia.client("YOUR_API_KEY")
           .algo("algo://util/FileConverter/0.2.8")
           .pipe(input)
           .then(function(output) {
             console.log(output);
           });
View Javascript Docs
var input = {{input | formatInput:"javascript"}};
Algorithmia.client("YOUR_API_KEY")
           .algo("algo://util/FileConverter/0.2.8")
           .pipe(input)
           .then(function(response) {
             console.log(response.get());
           });
View NodeJS Docs
import Algorithmia

input = {{input | formatInput:"python"}}
client = Algorithmia.client('YOUR_API_KEY')
algo = client.algo('util/FileConverter/0.2.8')
print algo.pipe(input)
View Python Docs
library(algorithmia)

input <- {{input | formatInput:"r"}}
client <- getAlgorithmiaClient("YOUR_API_KEY")
algo <- client$algo("util/FileConverter/0.2.8")
result <- algo$pipe(input)$result
print(result)
View R Docs
require 'algorithmia'

input = {{input | formatInput:"ruby"}}
client = Algorithmia.client('YOUR_API_KEY')
algo = client.algo('util/FileConverter/0.2.8')
puts algo.pipe(input).result
View Ruby Docs
use algorithmia::*;

let input = {{input | formatInput:"rust"}};
let client = Algorithmia::client("YOUR_API_KEY");
let algo = client.algo('util/FileConverter/0.2.8');
let response = algo.pipe(input);
View Rust Docs
Discussion
  • {{comment.username}}