1 unstable release
0.1.0 | Jun 3, 2025 |
---|
#1220 in Web programming
170KB
4K
SLoC
boreholeio
A Rust library for interacting with borehole.io, a subsurface data management, delivery and visualisation platform developed by ALT.
[!CAUTION] This crate is not yet ready for general consumption. If you'd like more information or to get involved in the development, please get in touch.
Getting Started
Rust developers can install the boreholeio crate using Cargo. From the command line, run cargo install boreholeio
to install the crate directly, or add it to the dependencies section of the Cargo.toml
for your project.
[dependencies]
boreholeio = "0.1.0"
This crate contains an API client and functionality to interact with data using ndarray.
use boreholeio::client::{endpoints, BoreholeIoClient, BoreholeIoClientOptions};
use csv::Writer;
use std::error::Error;
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
// Connect to borehole.io.
let mut client = BoreholeIoClient::create(BoreholeIoClientOptions::default())?;
// Query all the boreholes filtered by site name. Specify that the `last_logged` field
// must be calculated additionally.
let boreholes = endpoints::borehole::list(
&mut client,
endpoints::borehole::Filters {
site: Some("Brockman BR1".into()),
..Default::default()
},
vec!["last_logged".to_string()],
)
.await?;
// Serialize the results to a CSV file.
let mut writer = Writer::from_path("./boreholes.csv")?;
for borehole in boreholes {
writer.serialize(borehole)?;
}
writer.flush()?;
Ok(())
}
Dependencies
~30–44MB
~683K SLoC