2 releases
0.5.1 | Jan 2, 2025 |
---|---|
0.5.0 | Jan 2, 2025 |
#602 in Encoding
289 downloads per month
14KB
132 lines
Simple cloudconvert package
This is a package for converting a file from one format to another using cloudconvert. This package is very minimal and uses Cloudconvert and file.io APIs in order to convert.
Usage
fn main(){
use dotenv::dotenv;
let _ = dotenv().ok();
let converter = Converter::new("YOUR CLOUDCONVER API KEY");
let link = converter.convert("path/to/file", // example: "C:\\Users\\user\\file.csv"
"file format", // the format of the input file. example: "csv". Find all valid formats here: https://api.cloudconvert.com/v2/convert/formats
"output format"); // the output format you want
println!("{}", link.unwrap()); // A link to the new file. example: https://eu-central.storage.cloudconvert.com/tasks/loremipsumloremipsum
}
Get Your cloudconvert API key from here (Requires a cloudconvert account)
Warnings
- Cloudconvert requires tokens, and uses 1 token per usage of
converter.convert
- Cloudconvert also has a rate limit of 500 requests.
- This request uses blocking requests from
request::blocking
, this could result in errors in async programs. - No Advanced error handling. If there's any error it is simply returned back to you.
- This package uses the file.io free tier. Meaning the file uploading has a limit of 2gb.
extra note
This package is NOT a cloudconvert API client. You can find that here
Dependencies
~4–16MB
~202K SLoC