Will try this! Thank you. I have use the Spotify rest, but somehow I find their API super convoluted… getting sales and refunds by day is an industry 🤦♂️
Hi! Great video on scraping Shopify data into Pydantic Models! I'm considering using Pydantic with an API and SqlAlchemy for my project. Could you create a follow-up video on mapping Pydantic Models to SqlAlchemy models and then writing the data into a database? This would be incredibly helpful. Thanks!
just save your self tons of quality of life issues and use attrs and cattrs instead of pydantic + you get good performance while still keeping your project entirely python... the new pydantic uses rust to solve some problems that attrs already solved ages ago. And it's more reliable because NASA uses it on it's mars rover.
I have tried the same method using the dataclasses. I got issue that when declaring the `Product` dataclass, it requires to declare all the attributes in the JSON response, not just `ID` and `title` like in your example.
it's great, but it very slow, by an order of magnitude more than plain classes, simple namespace, named tuples, dataclasses, attrs, etc. So use it for parsing and validation for which it's made and great, but don't use it as a general purpose data structure.
I have tried the same method using the dataclasses. I got issue that when declaring the `Product` dataclass, it requires to declare all the attributes in the JSON response, not just `ID` and `title` like in your example.
Will try this! Thank you. I have use the Spotify rest, but somehow I find their API super convoluted… getting sales and refunds by day is an industry 🤦♂️
Hi! Great video on scraping Shopify data into Pydantic Models! I'm considering using Pydantic with an API and SqlAlchemy for my project. Could you create a follow-up video on mapping Pydantic Models to SqlAlchemy models and then writing the data into a database? This would be incredibly helpful. Thanks!
Great thanks! Sure i will do a follow up to include sqla!
Might be worth doing using fastAPI then ;)
just save your self tons of quality of life issues and use attrs and cattrs instead of pydantic + you get good performance while still keeping your project entirely python... the new pydantic uses rust to solve some problems that attrs already solved ages ago. And it's more reliable because NASA uses it on it's mars rover.
Good content as always. 👍👍👍
thanks mate i appreciate it
I have tried the same method using the dataclasses. I got issue that when declaring the `Product` dataclass, it requires to declare all the attributes in the JSON response, not just `ID` and `title` like in your example.
Hi John, great tutorial! Is there any reason to use Pydantic over Dataclasses?
Pydantic gives you powerful data validation and error messages.
Awesome content, concise and helpful. Thanks!
this is so good, thank you
excellent 👍
Hey! I'm just starting to work with Python. I know this is not directly related to this video, but how do you "pretty print" those values in terminal?
I use the package “rich” to print - pip install rich, then in your code from rich import print, and then print() as normal
@@JohnWatsonRooney thnx alot!!
it's great, but it very slow, by an order of magnitude more than plain classes, simple namespace, named tuples, dataclasses, attrs, etc.
So use it for parsing and validation for which it's made and great, but don't use it as a general purpose data structure.
What font do you use ? It looks so unique
brilliant example!
Sholdn't be the price mapped to a float instead of a string?
Can we do this with dataclasses instead?
Yes but you don’t get validation
@@JohnWatsonRooney is it like __post_init in dataclasses?
I have tried the same method using the dataclasses. I got issue that when declaring the `Product` dataclass, it requires to declare all the attributes in the JSON response, not just `ID` and `title` like in your example.
please do a Bet 305 odds and how to scrap it
I m not getting didi website data getting 501 response can u give me suggestions please
Neat!
pwerful yeh
upload the on your repo
Hall Larry Hernandez Gary Taylor Sandra