2 unstable releases
Uses new Rust 2024
new 0.2.0 | Apr 6, 2025 |
---|---|
0.1.0 | Apr 5, 2025 |
#961 in Parser implementations
219 downloads per month
14KB
219 lines
Erpnext Client
An async Rust client for interacting with ERPNext via their API.
Supports reading, inserting, and updating doctypes using basic authentication.
Todo
- search doctypes with filter
🚀 Usage
use erpnext_client::{Client, Settings};
use secrecy::SecretString;
use serde::Deserialize;
#[derive(Debug, Deserialize)]
struct Customer {
name: String,
customer_name: String,
}
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let settings = Settings {
url: "https://example.com".into(),
key: "your-api-key".into(),
secret: SecretString::new("your-secret-key".into()),
};
let client = Client::new(settings);
if let Some(customer) = client
.get_doctype_by_name::<Customer>("Customer", "CUST-0001")
.await?
{
println!("Customer: {:?}", customer);
}
Ok(())
}
Dependencies
~5–16MB
~202K SLoC