#api-client #settings #deserialize #erpnext

erpnext_client

A simple API client for interacting with Frappe/ERPNext

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

Download history 199/week @ 2025-04-01 44/week @ 2025-04-08 4/week @ 2025-04-15

247 downloads per month

MIT license

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