med-mastodon.com is one of the many independent Mastodon servers you can use to participate in the fediverse.
Medical community on Mastodon

Administered by:

Server stats:

312
active users

#pydantic

0 posts0 participants0 posts today
Python Rennes<p>un tutoriel détaillé sur l'utilisation de <a href="https://social.breizhcamp.org/tags/pydantic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pydantic</span></a> dans vos projets <a href="https://social.breizhcamp.org/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> : <a href="https://machinelearningmastery.com/the-complete-guide-to-pydantic-for-python-developers/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">machinelearningmastery.com/the</span><span class="invisible">-complete-guide-to-pydantic-for-python-developers/</span></a><br>- typage des structures de données<br>- validation des valeurs<br>- gestion de l'arborescence des structures de données</p>
Borutzki<p>Finally, started working on a separate blog dedicated to technical stuff like <a href="https://mastodon.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a>, <a href="https://mastodon.social/tags/Django" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Django</span></a>, <a href="https://mastodon.social/tags/Pydantic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Pydantic</span></a>, <a href="https://mastodon.social/tags/GitLab" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>GitLab</span></a>, <a href="https://mastodon.social/tags/Docker" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Docker</span></a>, <a href="https://mastodon.social/tags/RobotFramework" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>RobotFramework</span></a> and so on.</p><p>In this first post I introduce myself and the purpose of the blog, then proceed to a bunch of quick examples of printing "hello world" in Python.</p><p>Even if you're not interested - come and see how to add padding to printed string in Python 🐍</p><p><a href="https://mastodon.social/tags/DailyPythonista" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>DailyPythonista</span></a></p><p><a href="https://borutzki.github.io/2025/10/03/hello-world.html" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">borutzki.github.io/2025/10/03/</span><span class="invisible">hello-world.html</span></a></p>
Kushal Das :python: :tor: 🇸🇪<p>I wrote some code in <a href="https://toots.dgplug.org/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> <a href="https://toots.dgplug.org/tags/pydantic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pydantic</span></a>. It works and I don't know why does it work!!</p>
scy<p>Did some benchmarking of how fast <a href="https://chaos.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> (3.13) w/ async <a href="https://chaos.social/tags/httpx" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>httpx</span></a> and <a href="https://chaos.social/tags/Pydantic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Pydantic</span></a> could query a JSON API vs. <a href="https://chaos.social/tags/GoLang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>GoLang</span></a> (both including unmarshalling to native types and some regex validation).</p><p>While Python could do about 2.5k requests per second against localhost when running singlecore, Go did 10k.</p><p>However, not only is Go "only" 4× as fast, these differences quickly shrink to 30&nbsp;% when you introduce an actual network between the hosts, and become irrelevant with rate limiting&nbsp;&amp; DDoS protection.</p>
multimeric<p>Looking for some examples of people using Pydantic in bioinformatics. First relevant result is... oh my own conference talk. How unhelpful.</p><p><a href="https://genomic.social/tags/pydantic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pydantic</span></a> <a href="https://genomic.social/tags/bioinformatics" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>bioinformatics</span></a></p>
spla<p>Un altre descobriment en aquest camí ha estat <a href="https://mastodont.cat/tags/Pydantic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Pydantic</span></a>. Com podia viure programàticament parlant sense Pydantic?<br>Pydantic és una biblioteca de Python que serveix per validar i gestionar dades amb tipus. Et permet definir models (com classes) on s’especifica el tipus de cada camp, i automàticament valida i converteix les dades rebudes. Integrat a la perfecció amb fastAPI.</p><p> <a href="https://mastodont.cat/tags/appy" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>appy</span></a> <a href="https://mastodont.cat/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://mastodont.cat/tags/fastAPI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fastAPI</span></a></p>
Olivier Mehani<p><strong>Pydantic for data validation and hydration</strong></p><p><a href="https://blog.narf.ssji.net/2025/03/30/pydantic-for-data-validation-and-hydration/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">blog.narf.ssji.net/2025/03/30/</span><span class="invisible">pydantic-for-data-validation-and-hydration/</span></a></p><p>When using Python in any serious way, one quickly encounters Pydantic. While I’ve run into it in many frameworks, up to now, I never took the time to sit down and work out what it was doing, beyond something like “data models and validation based on type annotations”.</p><p>I have so far used dataclasses for my data models and data transfer objects (DTO). But it finally happened, and I needed finer validation on the data within my model. So I decided to take Pydantic for a spin myself, and see what it was doing for real.</p><p>tl;dr:</p><p>Pydantic _is_ data models and validation based on type annotations (amongst other things)</p><p>It’s a (almost) drop-in replacement for dataclasses</p><p>Type resolution and validation does add one order of magnitude over dataclasses, but it’s quite acceptable as a tradeoff for not having to write any bespoke validation code</p><p>Not only can it validate data, but it can also construct nested Pydantic objects, with support for polymorphism.</p><p>The pydantic.TypeAdapter exposes some lower-level mechanisms allowing to compose Pydantic behaviours as needed </p><p> […]</p><p><a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://blog.narf.ssji.net/tag/pydantic/" target="_blank">#Pydantic</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://blog.narf.ssji.net/tag/python/" target="_blank">#Python</a></p>
spla<p>Ara millor, la línia de temps "home" necessita un token vàlid però la línia de temps "public" (federada) no.</p><p><a href="https://codeberg.org/spla/appy/commit/081cf661cc33d702cd0e53a74ab9030fbffd9311" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">codeberg.org/spla/appy/commit/</span><span class="invisible">081cf661cc33d702cd0e53a74ab9030fbffd9311</span></a></p><p>He tingut que crear un nou model <a href="https://mastodont.cat/tags/Pydantic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Pydantic</span></a> per els tuts de la línia de temps federada perquè no han de tenir "favourited", "reblogged", "muted", "bookmarked", "pinned" ni "filtered" </p><p><a href="https://mastodont.cat/tags/appy" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>appy</span></a> <a href="https://mastodont.cat/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://mastodont.cat/tags/fastAPI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fastAPI</span></a></p>
Jeff "web-Boo!-logy" Triplett<p>🤖 I wrote up some notes on Pydantic AI Agents yesterday and shared some projects that I'm using them in. </p><p><a href="https://mastodon.social/tags/pydantic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pydantic</span></a> <a href="https://mastodon.social/tags/pydanticai" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pydanticai</span></a> <a href="https://mastodon.social/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> <a href="https://mastodon.social/tags/django" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>django</span></a> </p><p><a href="https://mastodon.social/@webology/114094521675257805" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">mastodon.social/@webology/1140</span><span class="invisible">94521675257805</span></a></p>
gary<p><span class="h-card" translate="no"><a href="https://infosec.exchange/@da_667" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>da_667</span></a></span> do a midlife crisis virt ai cluster<br><a href="https://infosec.exchange/tags/pydantic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pydantic</span></a> <a href="https://infosec.exchange/tags/catte" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>catte</span></a> cluster <br><a href="https://www.youtube.com/watch?v=JWfNLF_g_V0&amp;t=912s" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://www.</span><span class="ellipsis">youtube.com/watch?v=JWfNLF_g_V</span><span class="invisible">0&amp;t=912s</span></a></p>
michabbb<p>💡 File API enables PDF processing with 20GB storage per project &amp; 2GB per file</p><p>🛠️ Integration with <a href="https://social.vivaldi.net/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://social.vivaldi.net/tags/Pydantic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Pydantic</span></a> enables structured data extraction through JSON schema validation</p>
Ni3dzwi3dz<p><a href="https://101010.pl/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> developerzy: mam model Pydanticowy, który jest tworzony na podstawie danych z pliku projektowego, tworzonego przez użytkownika. <br>Mam pole, którego użytkownik nie musi podawać, jego default value to "foo". Jaki typ pola podać?<br>foo_field: str - bo zawsze jest w nim string<br>foo_field: Optional[str] - co prawda nigdy nie będzie None, ale dzięki temu użytkownik wie, że nie musi podawać wartości w pliku<br><a href="https://101010.pl/tags/tech" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>tech</span></a> <a href="https://101010.pl/tags/it" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>it</span></a> <a href="https://101010.pl/tags/pydantic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pydantic</span></a> <a href="https://101010.pl/tags/rozbijanieGownaNaAtomy" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rozbijanieGownaNaAtomy</span></a></p>
multimeric<p>If you're a dev who uses <a href="https://genomic.social/tags/monday" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>monday</span></a>.com, you might be interested in mondantic, a library I just developed for generating and populating Python dataclasses from your boards.</p><p><a href="https://github.com/WEHI-ResearchComputing/mondantic" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/WEHI-ResearchComput</span><span class="invisible">ing/mondantic</span></a></p><p><a href="https://genomic.social/tags/monday" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>monday</span></a>.com <a href="https://genomic.social/tags/mondaycom" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>mondaycom</span></a> <a href="https://genomic.social/tags/pydantic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pydantic</span></a> <a href="https://genomic.social/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a></p>
michabbb<p>🔹 Integration with <a href="https://social.vivaldi.net/tags/Pydantic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Pydantic</span></a> &amp; <a href="https://social.vivaldi.net/tags/Zod" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Zod</span></a> for schema validation in respective languages</p><p>🔹 <a href="https://social.vivaldi.net/tags/OpenAI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>OpenAI</span></a> compatibility layer included for seamless integration</p><p>🔹 Performance tips: Use schema validation libraries, set temperature to 0, include JSON return instructions</p>
spla<p>He tocat una vora de <a href="https://mastodont.cat/tags/Pydantic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Pydantic</span></a> (quelcom que necessito però Pydantic encara no ho fa). Em cal excloure tres "Fields" del model Pydantic que no s'han d'enviar al fedivers quan el tut no conté una enquesta però no es pot fer tal cosa.</p><p><a href="https://mastodont.cat/tags/appy" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>appy</span></a></p>
Jeff "web-Boo!-logy" Triplett<p>I wrote about them earlier in the year: <a href="https://micro.webology.dev/2024/03/06/importing-data-with.html" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">micro.webology.dev/2024/03/06/</span><span class="invisible">importing-data-with.html</span></a> </p><p>Even changing the shape of a CSV or JSON file is so much easier with a ModelSchema. </p><p><span class="h-card" translate="no"><a href="https://hachyderm.io/@lacey" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>lacey</span></a></span> and I have a large data import project and I only had to change one line of python code (from a schema) to map out another source of data yesterday. </p><p><a href="https://mastodon.social/tags/Django" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Django</span></a> <a href="https://mastodon.social/tags/PyDantic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>PyDantic</span></a> <a href="https://mastodon.social/tags/DjangoNinja" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>DjangoNinja</span></a></p>
Jeff "web-Boo!-logy" Triplett<p>Even if you aren't writing much rest code these days, please do not sleep on Django Ninja's ModelSchemas. </p><p>They are the missing link for any data import or export project that you might face. They are built on <a href="https://mastodon.social/tags/PyDantic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>PyDantic</span></a>'s BaseModel and you get a really good data sanitization and cleanup for free. </p><p><a href="https://django-ninja.dev/guides/response/django-pydantic/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">django-ninja.dev/guides/respon</span><span class="invisible">se/django-pydantic/</span></a></p>
Osunderdog<p><span class="h-card" translate="no"><a href="https://mastodon.social/@borutzki" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>borutzki</span></a></span> I find pydantic very helpful for interface work because of the effort put into data typing. It has great mechanisms for field level and model level validation. </p><p>I have found issues with composite classes. Sometimes to the point that I had to roll out of BaseModel. So just proceed with care. Test!</p><p><a href="https://allthingstech.social/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> <a href="https://allthingstech.social/tags/pydantic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pydantic</span></a></p>
Borutzki<p><a href="https://mastodon.social/tags/TIL" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>TIL</span></a> that <a href="https://mastodon.social/tags/Pydantic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Pydantic</span></a> can make doing JSON-heavy stuff in <a href="https://mastodon.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> much more approachable and comprehensible. Stuff like data validation, modeling and overall handling - I wish I had the time to learn that way earlier. </p><p>Someday I want to learn how to connect that with <a href="https://mastodon.social/tags/Django" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Django</span></a> data model. But first, I probably need to learn Django. </p><p>But not everything at once. Life is not university, no need to cram everything in one week. </p><p><a href="https://mastodon.social/tags/DailyPythonista" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>DailyPythonista</span></a></p>
Timothée Mazzucotelli :python:<p>Next, griffe-pydantic, a <a href="https://fosstodon.org/tags/Griffe" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Griffe</span></a> extension for <a href="https://fosstodon.org/tags/Pydantic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Pydantic</span></a> models:</p><p><a href="https://mkdocstrings.github.io/griffe-pydantic/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">mkdocstrings.github.io/griffe-</span><span class="invisible">pydantic/</span></a></p>