Live data from Hacker News

Pydantic-resolve, a hierarchical solution for data fetching and processing

github.com

11–16 of 16 posts

Re: Pydantic-resolve, a hierarchical solution for data fetching and processing

#11
post #9

Earlier quoted context omitted.

say you have a model with two attributes profile_image_url: str and profile_image: bytes it's expensive to fetch profile_image since it will involve a http call to profile_image_url. right now, i would resolve this by using the @property decorator this library offers an alternative method for populating profile_image by explicitly giving the user a hook for when they want to resolve this dependency. they might want t…

Thanks!

I too was confused. If the authors are reading this, the readme could do with a little bit more of an intro.

Re: Pydantic-resolve, a hierarchical solution for data fetching and processing

#12
post #5

I’ve used Pydantic with FastAPI, but can’t really get a solid feel for what this is doing. Can someone explain this to me like I’m 5?

say you have a model with two attributes profile_image_url: str and profile_image: bytes it's expensive to fetch profile_image since it will involve a http call to profile_image_url. right now, i would resolve this by using the @property decorator this library offers an alternative method for populating profile_image by explicitly giving the user a hook for when they want to resolve this dependency. they might want t…

That sounds pretty useful.

Anyone know of a library to do the same in Rust?

Re: Pydantic-resolve, a hierarchical solution for data fetching and processing

#13
post #11
post #9

Earlier quoted context omitted.

Thanks!

I too was confused. If the authors are reading this, the readme could do with a little bit more of an intro.

my fault lol.

here is a step by step tutorial, building various kinds of views data you need, and keep service layer simple and clear at the same time.

https://github.com/allmonday/composition-oriented-developmen...

code is ready, documents of english version is still wip.

Re: Pydantic-resolve, a hierarchical solution for data fetching and processing

#14
post #5

I’ve used Pydantic with FastAPI, but can’t really get a solid feel for what this is doing. Can someone explain this to me like I’m 5?

If you know Django, this looks like a more general version of how Django does foreign-key fields.

Re: Pydantic-resolve, a hierarchical solution for data fetching and processing

#15

inspired by graphql (define schema in declaretive way) however gql itself only walks from top to bottom, which lack the ability to change data after it's descdenants are resolved. pydantic-resolve is progressive, this means you don't need to introduce a big framework to build a nested view data, all you need to do is just: - simpilify your query of root data (no complex sql any more, then you can reuse it) - define t…

[deleted]
Post reply on HN