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 6698559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:35:31+00:00 2026-05-26T06:35:31+00:00

I’m very new to Python and I’m trying to write a sort of recipe

  • 0

I’m very new to Python and I’m trying to write a sort of recipe organizer to get acquainted with the language. Basically, I am unsure how how I should be storing the recipes.
For now, the information I want to store is:

  • Recipe name
  • Ingredient names
  • Ingredient quantities
  • Preparation

I’ve been thinking about how to do this with the built-in sqlite3, but I know nothing about database architecture, and haven’t been able to find a good reference.
I suppose one table would contain recipe names and primary keys. Preparation could be in a different table with the primary key as well. Would each ingredient/quantity pair need its own table.

In other words, there would be a table for ingredientNumberOne, and each recipe’s first ingredient, with the quantity, would go in there. Then each time recipe comes along with more ingredients than there are tables, a new table would be created.

Am I even correct in assuming that sqlite3 is sufficient for this task?

  • 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-26T06:35:32+00:00Added an answer on May 26, 2026 at 6:35 am
    1. Yes, SQLite3 is sufficient for the task.
    2. Each ingredient/quantity pair does not need its own table.

    One quick way to pick up the basics of SQL is to fiddle with the Command Line Shell for SQLite and knock around some data interactively before you start writing Python. SQL isn’t too difficult. It can be difficult, when you really start flexing it, but I imagine you’ll be able to learn enough for your needs pretty quickly. IMHO the missing link in your understanding of modeling data with an RDBMS is grokking one-to-many and many-to-many relationships.

    Your approach would probably work, but it seems roundabout. There are a lot of solutions to modeling that sort of data. I’m thinking of something like:

    TABLE recipes
        name text primary key
        preparation text
    
    TABLE ingredients
        recipe foreign key
        name text
        quantity double
    

    If you want to interact with your DB in a Pythonic way, look at SQLalchemy or another ORM. (My opinion is that they’ve been more trouble than they’re worth on my own small projects.)

    Of course, you could also make each recipe document a dictionary object and then shelve them all. (Sorry, broad question – broad answer.) This should work very well; a lot of us just jump towards SQL because our first hobby projects were web apps.

    My final piece of advice (from the experience of a true non-expert) is to just start coding. The scale of the project isn’t so large that you couldn’t refactor in a different method of persistence, and when you hit a wall you’ll find it a lot easier to solve the real problem than a hypothetical one.

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm trying to create an if statement in PHP that prevents a single post
I am trying to render a haml file in a javascript response like so:

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.