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 - (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/SampleCollection/sample.txt",    "output":"sample.pdf",    "collection":"data://.algo/perm" }
 output "data://.algo/perm/sample.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.

(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'
View cURL Docs
algo auth
algo run algo://util/FileConverter/0.2.10 -d '{{input | formatInput:"cli"}}'
View CLI Docs
import (
  algorithmia ""

input := {{input | formatInput:"go"}}

var client = algorithmia.NewClient("YOUR_API_KEY", "")
algo, _ := client.Algo("algo://util/FileConverter/0.2.10")
resp, _ := algo.Pipe(input)
response := resp.(*algorithmia.AlgoResponse)
View Go 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.10");
AlgoResponse result = algo.pipeJson(input);
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.10")
val result = algo.pipeJson(input)
View Scala Docs
var input = {{input | formatInput:"javascript"}};
           .then(function(output) {
View Javascript Docs
using Algorithmia;

var input = "{{input | formatInput:"cs"}}";
var client = new Client("YOUR_API_KEY");
var algorithm = client.algo("algo://util/FileConverter/0.2.10");
var response = algorithm.pipe<object>(input);
View .NET/C# Docs
var input = {{input | formatInput:"javascript"}};
           .then(function(response) {
View NodeJS Docs
import Algorithmia

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

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

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

let input = {{input | formatInput:"rust"}};
let client = Algorithmia::client("YOUR_API_KEY");
let algo = client.algo("util/FileConverter/0.2.10");
let response = algo.pipe(input);
View Rust Docs
import Algorithmia

let input = "{{input | formatInput:"swift"}}";
let client = Algorithmia.client(simpleKey: "YOUR_API_KEY")
let algo = client.algo(algoUri: "util/FileConverter/0.2.10") { resp, error in
View Swift Docs
  • {{comment.username}}