
Security News
Meet the Socket Team at RSAC and BSidesSF 2025
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.
Effortlessly access your SQL servers and procedures, plus some other utilities.
$ pip install loaf
from loaf import Loaf
# Setup your credentials with a single line.
loaf = Loaf(port=6969, db="pizzeria")
# Or load your credentials from a file.
loaf = Loaf(file="creds.ini")
# Or use a local SQLite file instead.
loaf = Loaf(file="pizzeria.db")
# Make queries easily.
toppings = loaf.query("SELECT * from toppings")
# Load your quieries directly from files.
clients = loaf.query(file="getHappyClients.sql")
# Prevent disasters by executing multiple queries.
pepperoni_id, client_name = loaf.multi([
"SELECT id FROM toppings WHERE name='Pepperoni'",
"SELECT name FROM clients WHERE id=6"
])
# Display info using built-in tables!
loaf.print(pepperoni_id)
loaf.print(client_name)
loaf.print(toppings)
┏━━━━┓
┃ id ┃
┡━━━━┩
│ 1 │
└────┘
┏━━━━━━━━━━━┓
┃ name ┃
┡━━━━━━━━━━━┩
│ 'Alfonso' │
└───────────┘
┏━━━━┳━━━━━━━━━━━━━┳━━━━━━━┓
┃ id ┃ name ┃ price ┃
┡━━━━╇━━━━━━━━━━━━━╇━━━━━━━┩
│ 1 │ 'Pepperoni' │ 1.49 │
│ 2 │ 'Mushrooms' │ 1.99 │
│ 3 │ 'Onions' │ 0.99 │
└────┴─────────────┴───────┘
# Manipulate your data with dictionaries, as God intended.
for topping in toppings:
print(topping['name'])
Pepperoni
Mushrooms
Onions
# Not lazy enough? Try some of the pre-built queires.
# Equivalent of: SELECT name FROM client WHERE name='Marco' LIMIT 1
result = loaf.select("name", "clients", "name='Marco'", limit=1)
# Get all values from a table.
result = loaf.all("toppings")
# Got stored procedures? No problemo!
result = loaf.call("ProcedureFindClient", 1)
⚠️ 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:
$ pip install loaf==0.1.30
FAQs
Effortlessly access your SQL servers and procedures, plus some other utilities!
We found that loaf demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.
Security News
Biome's v2.0 beta introduces custom plugins, domain-specific linting, and type-aware rules while laying groundwork for HTML support and embedded language features in 2025.
Security News
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.