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

  • Home
  • SEARCH
  • 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 7037671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:34:24+00:00 2026-05-28T01:34:24+00:00

I often use Python to prototype ideas for other platforms, a scratch pad of

  • 0

I often use Python to prototype ideas for other platforms, a scratch pad of sorts. Right now I want to play with some ideas related to relational data in a database.

What is the best way to represent a database in Python? A set of tuples? Using a module like SQLite?

I’m looking for simple solutions in Python. If the solution is too “databasey” I mine as well do my prototyping in the database itself.

UPDATE: I wont actually be using Python with the database (I don’t even have a specific database in mind), I just want to think with codes about questions like “If I have X relational data, can I answer Y questions, and solve Z problems?”

  • 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-28T01:34:24+00:00Added an answer on May 28, 2026 at 1:34 am

    Either sqllite3 or an Object Relational Mapper such as SQLAlchemy.

    sqllite3 is very easy to set up and works just like a SQL database (for prototyping purposes, of course- not for production).

    SQLAlchemy is a great way to work with a real database engine (which can itself be sqllite3) as if it were a set of objects. Creating a table, for example, looks something like this (from this tutorial):

    from sqlalchemy import *
    
    db = create_engine('sqlite:///tutorial.db')
    metadata = BoundMetaData(db)
    
    users = Table('users', metadata,
        Column('user_id', Integer, primary_key=True),
        Column('name', String(40)),
        Column('age', Integer),
        Column('password', String),
    )
    users.create()
    

    Similarly, it has simple functions and classes that allow you to insert elements, create relationships, and everything else you can do in a database.

    ETA: I understand you won’t actually be using Python with the database. However, working with an ORM like SQLAlchemy lets you deal with relational data as objects. It is approximately as easy as any form of prototyping, with the added benefit that it is closer to what you’ll end up doing.

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

Sidebar

Related Questions

I use vim for coding and for python coding in particular. Often I want
I often use the execv() function in C++, but if some of the arguments
I often use this code pattern: while(true) { //do something if(<some condition>) { break;
I am writing a Django application, and I often use the Python backtick operator
I often do sorts in Python using lambda expressions, and although it works fine,
I often use the python interpreter for doing quick numerical calculations and would like
Right now, I am buffering bytes using strings, StringIO, or cStringIO. But, I often
In python code I often see the use of @property. If I understand correctly,
Often people say that it's not recommended to use recursive functions in python (recursion
My primary language is Python. Often when I need to do some cpu heavy

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.