Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SheetParser: Infer sheet Model #118

Open
geoo89 opened this issue Jan 25, 2024 · 0 comments
Open

SheetParser: Infer sheet Model #118

geoo89 opened this issue Jan 25, 2024 · 0 comments

Comments

@geoo89
Copy link
Contributor

geoo89 commented Jan 25, 2024

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.

  • name:str; names:list[str]; translations:dict[str,str]; ...
  • If no type is provided, string is assumed by default, e.g. name; names:list; translations:dict; ...

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:

  • name.0 --> We infer that name is a list
  • name.0:str --> We infer that name is a list of strings
  • translations.eng --> we infer that translations is a dict
@geoo89 geoo89 moved this to Backlog in ParentText Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

1 participant