1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
//! An unofficial Rust client for BigML's REST API.
//!
//! BigML is an commercial machine-learning service. This unofficial library
//! allows you to talk to BigML from Rust.
//!
//! We focus on passing data to BigML and running WhizzML scripts, though it's
//! pretty easy to add support for new resource types and resource fields. See
//! our [GitHub repository][] for more information.
//!
//! ```no_run(
//! use bigml::{Client, resource::{execution, Id, Script}};
//! use futures::{executor::block_on, FutureExt, TryFutureExt};
//! use std::{path::Path, str::FromStr};
//!
//! # fn main() -> bigml::Result<()> {
//! #
//! let username = "username";
//! let api_key = "api_key";
//! let path = Path::new("sample.csv");
//! let script_id: Id<Script> = Id::from_str("script/123abc")?;
//!
//! // Create a BigML client.
//! let client = bigml::Client::new(username, api_key)?;
//!
//! // Create a source (actually, you should do this via S3 for now).
//! let source =
//! block_on(client.create_source_from_path_and_wait(path.to_owned()))?;
//! println!("{:?}", source);
//!
//! // Execute the script.
//! let mut args = execution::Args::default();
//! args.set_script(script_id);
//! args.add_input("source-id", &source.resource)?;
//! args.add_output("my-output");
//! let execution = block_on(client.create_and_wait(&args))?;
//! println!("{:?}", execution);
//! #
//! # Ok(())
//! # }
//! ```
//!
//! For more information, see the [BigML API][] and our [example code][].
//!
//! [GitHub repository]: https://github.com/faradayio/bigml-rs
//! [BigML API]: https://bigml.com/api
//! [example code]: https://github.com/faradayio/bigml-rs/tree/master/examples
#![warn(missing_docs)]
// We work with a lot of types that include floating point values, which support
// `PartialEq` but not `Eq`. Therefore, we don't need to be warned that certain
// types _could_ suppot `Eq` but don't implement it. In any case, some things
// which support `Eq` now might not in the future.
#![allow(clippy::derive_partial_eq_without_eq)]
#[macro_use]
extern crate bigml_derive;
pub use client::{Client, DEFAULT_BIGML_DOMAIN};
pub use errors::*;
pub use progress::{ProgressCallback, ProgressOptions};
pub use wait::WaitOptions;
#[macro_use]
pub mod wait;
mod client;
mod errors;
mod progress;
pub mod resource;