mindly.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Mindly.Social is an English speaking, friendly Mastodon instance created for people who want to use their brains and their hearts to make social networking more social. 🧠💖

Administered by:

Server stats:

1.2K
active users

I've got this data-complex astronomy project I'm working on (pro-bono).

I have a number of different backends I pull from (NASA, Unis,. etc) all who use diff field names for the same thing resulting in lots of tedious (and future error-prone) data parsing and checking code.

Was hoping to use something like pydantic as an in-between translator/mapper of thediff fields to the same schema(s).

Anyone seen something like that?

C.

@awws

I haven't looked for a PyPI module to do this, specifically. In the past, I've done simple functions with dict lookups to map keys from one source to a canonical value, or with Pydantic, use alternate constructors that you call depending on which source you're dealing with.

Example at pastebin.com/8Xt5EK6R .

PastebinPydantic adapter - Pastebin.comPastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

@cazabon This is really interesting.

Am gonna play around with it and see if I can bend it to my particular use case.

Thank you!

(the strange thing to me here is I am super surprised there is not a library that handles this already as I imagine it must be a ridiculously common use case across engineering.). Hmmmm... 🤔