Parse OData $metadata XML and explore entities, properties, and relationships from the terminal. Built for SAP SuccessFactors, but works on any OData service.
pip install csdl-explore
# Rich REPL
pip install csdl-explore[tui]
# + Textual TUI
╭─────────────────────────────────────────╮ │ CSDL Explorer │ │ Loaded 735 entities │ ╰─────────────────────────────────────────╯ csdl> search contract Type Entity Match Details PROP EmpJob .contractType Edm.String NAV EmpJob .contractTypeNav PROP PerPerson .contractEndDate Edm.DateTime csdl> tree EmpJob EmpJob ├── Keys │ ├── seqNumber Edm.Int64 │ ├── startDate Edm.DateTime │ └── userId Edm.String ├── Properties (45) │ ├── businessUnit Edm.String │ └── ... and 43 more ├── Custom Fields (24) │ ├── customString7 Edm.String │ └── ... and 23 more └── Navigation (8) ├── employmentNav → EmpEmployment └── ... and 7 morecsdl>
| Command | Description |
|---|---|
| entity <name> | Show all properties of an entity |
| tree <name> | Visual tree with keys, properties, navigation |
| search <term> | Search across entities, properties, labels |
| custom <entity> | Show custom fields (customStringXX) |
| diff <e1> <e2> | Compare two entities side by side |
| nav <entity> | Show navigation properties and targets |
| query <entity> | Execute OData query with filters |
| picklist <name> | Fetch picklist values from live API |
from csdl_explore import CSDLExplorer from pathlib import Path explorer = CSDLExplorer.from_file(Path("metadata.xml")) # Search across everything for r in explorer.search("worker"): print(f"{r.entity}.{r.property}: {r.prop_type}") # Entity details, custom fields, comparison entity = explorer.get_entity("EmpJob") fields = explorer.get_custom_fields("EmpJob") comp = explorer.compare_entities("EmpCompensation", "EmpPayCompRecurring")