{"id":16370623,"url":"https://github.com/poshodev/loaf","last_synced_at":"2025-07-24T08:38:19.286Z","repository":{"id":68220639,"uuid":"418709655","full_name":"PoshoDev/Loaf","owner":"PoshoDev","description":"🍞 Effortless SQL server and procedures—plus other utilities—for people who really hate cursors!","archived":false,"fork":false,"pushed_at":"2023-11-09T04:39:41.000Z","size":117,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-31T16:55:24.226Z","etag":null,"topics":["bread","database","db","loaf","mariadb","mysql","python","sql"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/Loaf/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PoshoDev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-19T00:09:21.000Z","updated_at":"2023-04-11T15:41:17.000Z","dependencies_parsed_at":"2024-11-14T13:11:04.053Z","dependency_job_id":"5007222e-0d89-45bc-af2d-b2c02f50dd67","html_url":"https://github.com/PoshoDev/Loaf","commit_stats":{"total_commits":59,"total_committers":2,"mean_commits":29.5,"dds":"0.10169491525423724","last_synced_commit":"d2c814dca51f0a8ac24de22ea13ecd1572ec9442"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PoshoDev%2FLoaf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PoshoDev%2FLoaf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PoshoDev%2FLoaf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PoshoDev%2FLoaf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PoshoDev","download_url":"https://codeload.github.com/PoshoDev/Loaf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238284933,"owners_count":19446762,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bread","database","db","loaf","mariadb","mysql","python","sql"],"created_at":"2024-10-11T03:05:34.052Z","updated_at":"2025-02-11T11:31:53.693Z","avatar_url":"https://github.com/PoshoDev.png","language":"Python","readme":"# 🍞 Loaf\n### *So bland yet so good!™*\n\nEffortlessly access your SQL servers and procedures, plus some other utilities.\n\n\n\n## Install\n\n```\n$ pip install loaf\n```\n\n\n\n## Examples\n\n### Importing Into Your Project\n\n```python\nfrom loaf import Loaf\n```\n\n\n\n### Setting Up Credentials\n\n```python\n# Setup your credentials with a single line.\nloaf = Loaf(port=6969, db=\"pizzeria\")\n# Or load your credentials from a file.\nloaf = Loaf(file=\"creds.ini\")\n# Or use a local SQLite file instead.\nloaf = Loaf(file=\"pizzeria.db\")\n```\n\n\n\n### Executing Queries\n\n```python\n# Make queries easily.\ntoppings = loaf.query(\"SELECT * from toppings\")\n# Load your quieries directly from files.\nclients = loaf.query(file=\"getHappyClients.sql\")\n# Prevent disasters by executing multiple queries.\npepperoni_id, client_name = loaf.multi([\n    \"SELECT id FROM toppings WHERE name='Pepperoni'\",\n    \"SELECT name FROM clients WHERE id=6\"\n])\n```\n\n\n\n### Printing\n\n```python\n# Display info using built-in tables!\nloaf.print(pepperoni_id)\nloaf.print(client_name)\nloaf.print(toppings)\n```\n\n```powershell\n┏━━━━┓\n┃ id ┃\n┡━━━━┩\n│ 1  │\n└────┘\n┏━━━━━━━━━━━┓\n┃ name      ┃\n┡━━━━━━━━━━━┩\n│ 'Alfonso' │\n└───────────┘\n┏━━━━┳━━━━━━━━━━━━━┳━━━━━━━┓\n┃ id ┃ name        ┃ price ┃\n┡━━━━╇━━━━━━━━━━━━━╇━━━━━━━┩\n│ 1  │ 'Pepperoni' │ 1.49  │\n│ 2  │ 'Mushrooms' │ 1.99  │\n│ 3  │ 'Onions'    │ 0.99  │\n└────┴─────────────┴───────┘\n```\n\n\n\n### Data Manipulation\n\n```python\n# Manipulate your data with dictionaries, as God intended.\nfor topping in toppings:\n    print(topping['name'])\n```\n\n````powershell\nPepperoni\nMushrooms\nOnions\n````\n\n\n\n### Utilities\n\n```python\n# Not lazy enough? Try some of the pre-built queires.\n# Equivalent of: SELECT name FROM client WHERE name='Marco' LIMIT 1\nresult = loaf.select(\"name\", \"clients\", \"name='Marco'\", limit=1)\n# Get all values from a table.\nresult = loaf.all(\"toppings\")\n# Got stored procedures? No problemo!\nresult = loaf.call(\"ProcedureFindClient\", 1)\n```\n\n\n\n![](https://github.com/PoshoDev/Loaf/blob/main/loaf.png?raw=true)\n\n\n\n⚠️ Syntax for the package has changed heavily since version 0.2.0, if your project depends on Loaf and is using an inferior version, I heavily suggest that you use the previous stable version:\n```\n$ pip install loaf==0.1.30\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposhodev%2Floaf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposhodev%2Floaf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposhodev%2Floaf/lists"}