3 releases (breaking)
Uses new Rust 2024
new 0.3.0 | Apr 29, 2025 |
---|---|
0.2.0 | Apr 6, 2025 |
0.1.0 | Apr 5, 2025 |
#1029 in Parser implementations
247 downloads per month
15KB
267 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
~204K SLoC