A python SDL generator based on pydantic #3289
nathanschwarz
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey there community !
I've developed a small python module to generate SURQL SDL strings.
The module is based on pydantic and is very simple to use.
✅ it supports the following features
and the following types out of the box :
❌ what it doesn't support yet :
PRs are welcome 😉
installation
To install pydantic-surql run :
or with poetry :
basic usage
to convert a pydantic model to a surql SDL definition you can use a simple decorator :
All the models decorated with
@surql_collection
will be collected by theMetadata
object, which will be used to generate the SDL.To generate the SDL :
this will generate the following SDL :
You can check more on :
Beta Was this translation helpful? Give feedback.
All reactions