It shouldn't take 64 lines of code to do something really simple
onlinelabor.blogspot.com
onlinelabor.blogspot.com
And 64 lines of code... bfd? That's much better than the bad old days of custom binary data formats where you have to write a thousand line data loader in C, worrying about issues like lsb vs msb, whether the number storage is properly following IEEE 754, etc.
I guess I'm just...old, because my first response to 'I had to write 64 lines of Python code to get this data into shape' is to shake my head and think "Kids these days!".
FWIW, I find it ironic that the author is complaining about whitespace-implied structure in his source data, yet uses Python.
Also, I don't see how it's ironic that I used Python---it seems irrelevant. Whitespace in Python has a well-defined, commonly understood purpose; using tabs or spaces to indicate hierarchal data relationships is not at all standard, presumably because it creates messy dependencies across rows of data.
https://github.com/mattdeboard/python-usdol https://github.com/mattdeboard/clj-usdol
edit: A couple of the BLS's databases are available through the DOL API:
http://developer.dol.gov/BLS_Numbers-DATASET.htm
"This Dataset contains historic data (last 10 years) for the most common economic indicators. More information and details about the data provided can be found at http://bls.gov
http://developer.dol.gov/DOL-BLS2010-DATASET.htm
"The Bureau of Labor Statistics produces occupational employment and wage estimates for over 450 industry classifications at the national level."
That last one is actually a pretty interesting dataset. I pulled it to tinker with at work last week.
(This is mostly because they chose to represent dates as integers, and they have four possible date types: yearly, quarterly, monthly, and daily. 1901, in their exciting world, could mean "year 1901" or it could mean "month January 1919". That's nice work, Lou.)
Where do you work that uses Haskell in the office?
I used Haskell because I hate Windows, and Haskell lets me do all my work in a maximized Emacs session without having to install anything other than Emacs and the Haskell Platform. "When life gives you Windows, don't make lemonade. Use Haskell."
For example, if you look for the time series I was after on data.gov, the "Download CSV" button brings you to...the BLS page, with all the problems I discussed.
http://explore.data.gov/Labor-Force-Employment-and-Earnings/...
I was think something along the lines of, look at this stupid person who needs 64 lines of code to do a simple insert in a binary tree.
Although is a few years when there are a million new standards I guess I can keep my job :)