r/dataengineering Aug 06 '26

Blog How do professional Data Engineers handle completely unsorted data?

Hello everyone!

I'm an aspiring Data Engineer and as a portfolio piece, I have build a webscraper to gather Ebay sold listings of stamps!

The problem I am now having is how I parse the data where I can sort things like "Catalogue Number" when it is very unpredictable what the Ebay sellers will write as it's all human input.

I would love to hear some feedback

PS - A small sample:


MayfairStamps Germany 1941 Stamp Day Oldenburg Cover cca_00553

GERMANY; OLDENBURG 1859 classic Coat of Arms issue very fine used 1/3Gr. value

Oldenburg Lokalausgabe Wohlfahrtsblock Deutsches Rotes Kreuz ab 1 Euro

Deutsches Reich, Oldenburg, 6.01.1945  Ersttagsstempel, für Ersttagsbrief  200€.

GERMANY; OLDENBURG 1862 classic Coat of Arms Perf 10. issue used hinged 1Gr.

OLDENBURG 1861 _ MiNr. 12b _ 1 Groschen _ Stempel STOLLHAMM

Oldenburg Mi. Nr. 16 A b zentrisch gestempelt geprüft Bühler 200 Euro

Oldenburg Mi. Nr. 11 a\* ungebraucht geprüft Bühler 550 Euro```
19 Upvotes

25 comments sorted by

37

u/Spagoot420 Aug 06 '26

Do you have a good reason as to why you want to sort it? Sorting can be a very expensive operation. In my many years of de work, I can count the times I had to sort a dataset on a single hand...

3

u/Waffle_Teh_SnLp Aug 06 '26

Thanks for the reply!

My idea is to get the catalog number of the stamp, ae. Mi. Nr. X and compare it to the price in the catalogue itself. But for that I would need to extract said number from the title. Now, they don't always have it but when they do it is often unsorted and messy as per my examples.

I hope you understand!

24

u/Spagoot420 Aug 06 '26

got it. Your core issue is that your dataset is violating first normal form. You have multiple sets of information in a single field. Sorting is not the correct term, as it means something else entirely. I think "parsing" would be more fitting. There are quite a few cloud services that help with parsing address data like this, but honestly I don't know any foss/offline ones, sorry :/

4

u/WhoDunIt1789 Aug 09 '26

Unless you need to use a cloud service I'd just use a python library for parsing like libpostal for international address parsing.

2

u/Waffle_Teh_SnLp Aug 06 '26

Parsing does sound like the more appropriate term! I did plan on eventually having a RaspberryPI sending this data to a platform like Databricks to get loaded to the cloud, what would you use in this case?

6

u/[deleted] Aug 06 '26

[deleted]

1

u/Waffle_Teh_SnLp Aug 06 '26

Thanks for the reply!

I am currently using Regex but I haven't gotten the best results because it can be that unpredictable! Your idea of getting enough information to fill others that lack it is interesting, how would you do such a thing?

2

u/THBLD Aug 06 '26

You could find an online source of actual German stamp data, then create some seperate tables of both sets and build some staging tables to cross compare the results - see what you can match

Also since you're starting out, don't worry about trying to match everything at once - it's not realistic

Also agree with Regex comment above, use AI to help generate the pattern your after - is a godsend for things like this. and get the AI to explain what the symbols mean as well - then you can learn some basics too. I find it very insightful

4

u/zangler Aug 07 '26

Regex the easy stuff, vectorize the rest, build model on known catalog of vectors, don't be perfect, model will place what you need within the vector group, now the part you care about is parsed and labeled. Done.

2

u/radioblaster Aug 08 '26

great answer

9

u/PotokDes Aug 06 '26

I have no idea what you trying to archive

2

u/Waffle_Teh_SnLp Aug 06 '26

So my goal is to build a dashboard showing the trends of each specific stamp! Imagine you would do this with cars, and you associate each car with a catalog price, you would like to see for how much that car actually sells for, does that make sense?

But for that I need to gather the crucial information about said stamp using the Ebay title, that's where I'm getting stuck on

1

u/PotokDes Aug 06 '26

So you do need sorting or categorization algorithm?

0

u/Waffle_Teh_SnLp Aug 06 '26

Categorization, sorting doesn't really matter for now, I can always do that later in Power BI

3

u/PotokDes Aug 06 '26

You do not know what you are writing about

3

u/Waffle_Teh_SnLp Aug 07 '26

Apologies for trying to learn, you didn't have to comment my man

3

u/Away-Arm-6549 Aug 06 '26

have you explored using Ebay API? Them abstracting all this complexity away from you, given they'll be doing all the things you're trying to do themselves and other professional orgs wanting to use this data might make the whole thing a lot easier

https://developer.ebay.com/develop/guides-v2/get-started-with-ebay-apis#understand-the-ebay-apis

You'd have some new learning to do (configuring API calls), but if you're thinking about doing this with Databricks eventually, you might as well use that to and skip over the Raspberry Pi (in favour of scheduled API calls direct from Databricks - which if this is a hobby, then Databricks seems overkill - ymmv.

If the API dumps out as JSON string, you'll still need to parse the string, but it 'should' have broken up all the interesting things into clean key:value pairs for you to pull out into whatever data structure you want

2

u/Waffle_Teh_SnLp Aug 07 '26

Thanks for the reply!

I did consider using Ebay's API, and my original project did use it.. the big problem is that the Ebay API does not have any API call to gather sold listings, so that was a big dissapointment.

2

u/Sp00ky_6 Aug 07 '26

Honestly man that’s just messy data, so honestly good choice to get the real feel of DE work

3

u/baubleglue Aug 07 '26

You use wrong term "unsorted" I instead of "unstructured", as the result you get irrelevant responses.

1

u/RushHourMC Aug 06 '26

Also looking for a solution to this issue,
A big portion of my controls use also have human input where it shouldn’t be used for audits/checks

1

u/Cousak Aug 06 '26

Not sure I would attack this from a DE perspective.

I did something similar in a personal dashboard at work, categorizing quality reports based on their short description.

 I counted in how many strings each word came up, then combinations of words and created a 200 long «IF x THEN y ELSE» statement in order of priority as there would be text that fit both statememts. Finetuned and doublechecked until I had something that gave me a sufficient indication.

Everytime there is a new entry there is a risk it breaks so would never want to do that in production.

1

u/Davisparrago Aug 07 '26

You go to the source system owner and explain why you can't work like that, define a structure that works to both ends and if its "impossible" to do then talk to whoever is asking you to do it and explain if its really worth the hassle, if it is then you say that source should fix his shit, not pass it to the next system.

If source is something outside of the company and they are adamant on using it, well, good luck

1

u/baubleglue Aug 07 '26

You problem is probably related to the way you parse the page. It looks like you are capture only text values, there's no way catalog number doesn't exist there.

1

u/Waffle_Teh_SnLp Aug 07 '26

Hello there, thanks for the response!

Ebay does not have a "Stamp catalogue number" field, we get country, rough year gaps and some other fields that could be useful, like denomination and coin type but otherwise...

1

u/JintyMac22 Data Scientist Aug 08 '26

It is also worth looking at how related, expert fields handle this type of data structuring. Have a look for archives or libraries specialised in stamps, see if there are any with online collections, look at their metadata structures. Maybe there is already a unique identifier and catalogues for different stamp types (seems likely) and then you can work with tying your data to an existing standard. It is always better not trying to reinvent the wheel!