New account, so new #introduction. Let's do it again!

I have a
#MastersDegree in #ComputerScience and #ComputerEngineering. I went to #NMU for undergrad and #MSU for my graduate degree. I currently work at #UChicago for the #TMWCenter, which focuses on helping young children acquire language (and therefore other learning skills) faster.

In my spare time, I develop
#OpenSourceSoftware such as
- a
#SphinxDoc extension that embed #Fediverse comments on your page
- a library to talk to
#ManifoldMarkets from native #Python
- a
#PredictionMarket manager using the above
- a
#transpiler from a subset of Python to #OpenStreetMaps's #OverpassQL
- bug fixes to many other projects, including
#mypy, #base58, #attrs, #CPython, & more

I spend a fair bit of my time these days on
#MathResearch, specifically into the #ThueMorse Sequence and its extensions.

I'm also a hobbyist editor on OpenStreetMap.

#Demisexual, #transfem, and happily engaged to my #enby sweetheart.

We have two cats:
#OpheTheLoaf and #MayalaranTheCat (yes, from #StormlightArchive) See here for more on them!

I speak English fluently, Spanish haltingly, and am trying to learn Chinese

#queer #Chicago
Olivia A-C (@LivInTheLookingGlass)

These are our cats, #OpheTheLoaf and #MayalaranTheCat. Ophelia was originally my partner's, we live together full time now, and are an integrated family Fun facts about Ophelia: * She is missing a tooth, so her lip sometimes gets stuck open in a cute way * She has an "activation noise" that sounds kinda like a pigeon * She will often do 10/10 loafs, hence the nickname Some facts about Maya: * Her favorite hobby is judging the neighbors * She is very anxious * She has an incredibly dainty play style * She has a series of increasingly ridiculous nicknames: Mayalaran -> Maya -> Mayo -> Aioli -> Au Jus (Follow the hashtags if you want just my cats) #CatsOfMastodon #CatsOfFedi (📎8)

TransFem Space

How do you generate JSON schemas of your dataclasses' **inputs**? Any third-party library (something else than stdlib's dataclasses) allowing one to do that?

For example, input type is `int | str`, but final/output type is always `int` (coerced). I want to document the input type, not the output type.

#python #pydantic #dataclass #attrs #jsonschema

Oh dang, my #introduction post is waaay out of date now. Let's do it again!

I have a #MastersDegree in #ComputerScience and #ComputerEngineering. I went to #NMU for undergrad and #MSU for my graduate degree. I currently work at #UChicago for the #TMWCenter, which focuses on helping young children acquire language (and therefore other learning skills) faster.

In my spare time, I develop #OpenSourceSoftware such as

I spend a fair bit of my time these days on #MathResearch, specifically into the #ThueMorse Sequence and its extensions.

I'm also a hobbyist editor on OpenStreetMap.

#Demisexual, #transfem, and happily engaged to my #enby sweetheart.

We have two cats: #OpheTheLoaf and #MayalaranTheCat (yes, from #StormlightArchive)

#queer #Chicago

Every time I read the #Pydantic docs, I come away feeling like I'm the problem because I just don't comprehend the reasoning behind some of their design decisions. Take, for instance, this section from the Settings Management page[1], about changing the settings sources used and their relative priorities:

> If the default order of priority doesn't match your needs, it's possible to change it by overriding the `settings_customise_sources` method of your `Settings`. `settings_customise_sources` takes four callables as arguments and returns any number of callables as a tuple.

... What?

Which callables? Why are there four of them, when I ultimately want to use a number of sources that isn't 4? Why are they callables, when custom sources are implemented as classes? Why can't I just return a set of sources with some sort of explicit priority attached?

I feel like the Pydantic documentation strategy is: "There's probably a thing you want to do, here's a full example of how to do it." That leaves me to enjoy the tasty sauce, without understanding how it was made or how to make it less salty.

In comparison, the documentation for #attrs[2] is a joy to read, dispensing the right amount of knowledge at the right times. It probably helps that the attrs API surface is also not as daunting.

#Python

[1] https://docs.pydantic.dev/latest/concepts/pydantic_settings/#field-value-priority
[2] https://www.attrs.org/en/stable/overview.html

Settings Management - Pydantic Validation

Support for loading a settings or config class from environment variables or secrets files.

Python - Attrs

YouTube

Another thing I've had to do is overhaul how uapi handles OpenAPI; make it more general.

I think in a couple of releases I'll be able to spin this out into a separate package.

Folks have been asking for jsonschema/openapi stuff for #attrs and cattrs for ages.
It's not there yet though.

@ossronny Support for dataclasses (and #Pydantic) has landed in #TypedSettingshttps://gitlab.com/sscherfke/typed-settings/-/merge_requests/23

Working on it showed me once again while I still prefer #attrs over them. 😬

Need to update the Readme and installation instrcution and can than merge it to main.

WIP: Make attrs optional and support dataclasses and Pydantic (!23) · Merge requests · Stefan Scherfke / typed-settings · GitLab

Manage typed settings with attrs classes – for server processes as well as click applications

GitLab

First post here 🚨

Recently I published my first blog post on how we used attrs and cattrs to model our API payloads.
Check it out here:

https://medium.com/klaviyo-engineering/powering-our-apis-using-attr-active-dtos-f88f2177d855

#attrs #cattrs #python #API #software #programming #django

With this MR (https://gitlab.com/sscherfke/typed-settings/-/merge_requests/22), #TypedSettings will get its own, built-in converter making #cattrs optional (but still recommended, because it's faster and more awesome).

But this reduces the list of mandatory requirements.

Next one on my list ist #attrs (I’m sorry, @hynek 🙈).

With modern Pythons, TS will than have zero mandatory dependencies (and only tomli on oder Pythons). This should make it more attractive for projects like #pytest to adopt it. 🙂

Add a built-in converter and make cattrs optional. (!22) · Merge requests · Stefan Scherfke / typed-settings · GitLab

Typed Settings now supports different converters. It uses cattrs by default (if it is installed) but falls back to the built-in converter automatically if not.

GitLab

Just in time for #PyConUS, here have an attrs 23.1.0: https://github.com/python-attrs/attrs/releases/tag/23.1.0 #python

If you're an #attrs user and are coming to SLC, come and say hi!

Release 23.1.0 · python-attrs/attrs

Highlights A lot of features and smaller bug fixes! But also with a heavy heart, we're leaving the last dataclass-less Python version (3.6) behind, but don't worry: the old versions aren't going an...

GitHub