Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6958983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:12:43+00:00 2026-05-27T15:12:43+00:00

Question: How best* can I store and access fixed U.S. State attributes in my

  • 0

Question:

How best* can I store and access fixed U.S. State attributes in my python program?

* the most reasonable combination of clear, maintainable, quick and idiomatic

Background info:

I’m creating a python/flask app that regularly accesses U.S. State attributes for various displays and sorting. An example of the attributes:

State: South Carolina

  • Proper Name: South Carolina
  • Abbreviation: SC
  • url friendly slug: south_carolina
  • Region: southeast

Currently, I’m storing some of this information in dictionaries (SO question regarding this). However, it seem more unwieldy as more attributes are added.


Some options I’ve considered

  • Adding more dictionaries
    • Seems clumsy
  • Use a database
    • I’m new to databases. I’m happy to learn, but I’m not clear this is the best approach. Also, I’m concerned this would be overkill.
  • Add a State Class
    • Seems a little inelegant to create 50 State objects just to query a few attributes.

Thanks very much for your time.

Edit: Added explanation of what best means.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:12:44+00:00Added an answer on May 27, 2026 at 3:12 pm

    I ended up using a database to solve this problem. I considered a bunch of options and it seems to be the most reasonable in terms of effort, complexity and long-term maintenance.

    Trying to make some other solution solve my problem here would really only be a crude recreation of database functionality anyhow e.g. dictionaries on dictionaries on dictionaries…

    For those wondering, on this particular Flask app I went with Flask-SQLAlchemy on top of a sqlite3 database.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is the best way I can think of phrasing this question, given this
You can read this question where I ask about the best architecture for a
I can't really think of the best way to phrase this question, so I'll
I know it's really a subjective question, but for best-practices (and readability), I can't
There are two questions to this: How can I best spread the word about
Similar question: Best Resources for Learning AS3 I am interested in learning AS3 and
I have a two part question Best-Practice I have an algorithm that performs some
I just saw this mentioned in Stack Overflow question Best WYSIWYG CSS editor and
Building on what has been written in SO question Best Singleton Implementation In Java
My question is best phrase as: Remove a child with a specific attribute, in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.