IDEMSInternational / rapidpro-flow-toolkit

Toolkit for using spreadsheets to create and modify RapidPro flows
GNU Lesser General Public License v2.1
3 stars 1 forks source link

SheetParser: Infer sheet Model #118

Open geoo89 opened 8 months ago

geoo89 commented 8 months ago

Especially for data sheets, it is often inconvenient having to specify the model as a pydantic model in a dedicated python file.

Often, these models are simple, and could be constructed from the column headers.

Proposal:

Colon as optional type annotation: e.g.

As already implemented, the dot is used for (sub)attributes of a model. If a column header has dot attributes, we can use that information for type inference:

Examples: