1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// SPDX-FileCopyrightText: 2026 Michael Jansen <ferroclass@michael-jansen.biz>
// SPDX-License-Identifier: MPL-2.0
//! Python bindings for ferroclass, exposed via PyO3.
//!
//! This module provides a `ferroclass` Python package with two primary
//! entry points matching the Salt external pillar and master tops interfaces:
//!
//! - [`ext_pillar`] — returns pillar data for a single Salt minion
//! - [`top`] — returns top data (environment → node → applications)
//!
//! It also exposes [`PyInventory`] and [`PyNode`] for direct programmatic use.
use *;
/// The `ferroclass` Python module.
///
/// Usage from Python:
///
/// ```python
/// import ferroclass
///
/// # Salt ext_pillar interface
/// pillar = ferroclass.ext_pillar(
/// "web01.example.com",
/// inventory_base_uri="/srv/reclass",
/// )
///
/// # Salt master_tops interface (single minion)
/// top_data = ferroclass.top(
/// minion_id="web01.example.com",
/// inventory_base_uri="/srv/reclass",
/// )
///
/// # Salt master_tops interface (full inventory)
/// top_data = ferroclass.top(
/// minion_id=None,
/// inventory_base_uri="/srv/reclass",
/// )
///
/// # Low-level inventory access
/// inv = ferroclass.load(inventory_base_uri="/srv/reclass")
/// node = inv.merge_node("web01.example.com")
/// ```