Code Monkey home page Code Monkey logo

latimes-statestyle's People

Contributors

ftobia avatar palewire avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

latimes-statestyle's Issues

Washington, DC is not a state

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.

Need an easier way to convert back to a dictionary

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.

Agate integration

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.