datadesk / latimes-statestyle Goto Github PK
View Code? Open in Web Editor NEWA Python library that standardizes the names of U.S. states
A Python library that standardizes the names of U.S. states
Doesn't have to be long, just a little more structured than what is currently in the README.
I know it's really not ๐ but it's common enough for someone to write "Washington, DC" instead of "District of Columbia." And yet this fails:
>>> statestyle.get('Washington, DC')
Special case, I know. And punctuation has to be accounted for. Still, worth handling, I think.
For serialization and such. Right now, I'm doing this awful thing:
>>> ca = statestyle.get('ca')
>>> ca.__dict__
Would be nice to have one of these (or something similar):
>>> ca = statestyle.get('ca')
>>> dict(ca)
>>> ca.to_dict()
Could actually make statestyle.State
a dict
subclass and just add __getattr__
and __setattr__
methods. Not sure if that's better.
What happens when Elon colonizes Mars and/or the State of Jefferson finally becomes a thing? Inquiring minds want to know ;)
Need a certain amount of generalizability a la: https://xkcd.com/974/
I just did a project where I had a CSV of states, which I was using agate
to muck about with, and I needed to add in FIPS codes to match it to a geojson collection (from mbostock/us-atlas). I ended up rolling an entire new CSV that joined state names to the other statestyle fields, which worked but was a bunch of boilerplate code I'd rather not write again.
Maybe there's a place for a statestyle.contrib.agate
module with a computation (or method, whatever) that adds statestyle fields to each row.
I thought about rolling this as its own module, but I think this is a better home.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.