pyo3_special_method_derive 0.2.2

Automatically derive Python dunder methods for your Rust code
Documentation
use pyo3::pyclass;
use pyo3_special_method_derive::Dir;

#[pyclass]
#[derive(Dir)]
#[allow(dead_code)]
struct Person {
    pub name: String,
    pub address: String,
    location: String,
}

#[test]
fn test_with_dir_skip() {
    let dir = Person {
        name: "John Doe".to_string(),
        address: "Address".to_string(),
        location: "Earth".to_string(),
    }
    .__dir__();

    assert_eq!(dir, vec!["name".to_string(), "address".to_string(),]);
}