Pydantic is a Python library for serializing data into models that can be validated with a deep set of built in valit...
Posts tagged: python
All posts with the tag "python"
Playing Star Wars Text Adventure with a 10 yr old
The following is a playthrough of Star Wars Text Adventure with a 10 yr old.The following is a playthrough of StarThe following is a playthrough of Star
Pydantic and singledispatch
I was reading about pydantic-singledispatch from Giddeon’s blog and found it very intersting. I’m getting ready to implement pydantic on my static site generator markata, and I think there are so uses for this idea, so I want to try it out.
Let’s set up some pydantic settings. We will need separate Models for each environment that we want to support for this to work. The whole idea is to use functools.singledispatch and type hints to provide unique execution for each environment. We might want something like a path_prefix in prod for environments like GithubPages that deploy to /<name-of-repo> while keeping the root at / in dev.
Here is our model for our settings. We will create a CommonSettings model that will be used by all environments. We will also create a DevSettings model that will be used in dev and ProdSettings that will be used in prod. We will use env as the discriminator so pydantic knows which model to use.
...
I really like having global cli command installed with pipx. Since textual (the css release) is out I want to be able...
I am working through the textual tutorial, and I want to put it in a proper cli that I can pip install and run the co...
hugo puts it in the base url https://gohugo.io/getting-started/configuration/#baseurl * mkdocs uses a special cli bui...
Markata now allows you to create jinja extensions that will be loaded right in with nothing more than a .
In my adventure to learn django, I want to be able to setup REST api's to feed into dynamic front end sites. Potentia...
Markata now uses hatch as its build backend, and version bumping tool. , and are completely gone.
My next step into django made me realize that I do not have access to the admin panel, turns out that I need to creat...
I am continuing my journey into django, but today I am not at my workstation. I am ssh'd in remotely from a chromeboo...
I have no experience in django, and in my exploration to become a better python developer I am dipping my toe into on...
While updating my site to use Markata's new configurable head I ran into some escaping issues. Things like single quo...
Hatch allows you to specify direct references for dependencies in your file. This is useful when you want to depend o...
When I am developing python code I often have a repl open alongside of it running snippets ofcode as I go. Ipython is...
{.more-cinematic}
I'm really getting into using hatch as my go to build system, and I am really liking it so far. I am slowly finding n...