Sample
sqlalchemy 2.0.51: engine.make_url
Verified sample for pypi sqlalchemy 2.0.51: engine.make_url. The contract ran on python 3.12 · linux debian/x64 · docker and passed.
sha256:e2c136419e41ba1e5ac02a9fe0080742f9a779d7f24640ca99d23a9dc5b0ed18
This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured.
How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people.
MIT-0
Execution evidence
The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.
- Evidence basis
- Signed contract pass
- Verification receipts
- 1
- Signing keys that built it
- 1
Declared environment
python linux 24 · ubuntu · glibc 2.39 x64 python python pip
Verification-run environments
| Environment | Contract | Stages | Run |
|---|---|---|---|
| python 3.12 · linux debian/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · python@1python:3.12-slim@sha256:09f7da3bc104… |
2026-09-05 |
Case
HOW- Goal
- verify sqlalchemy.engine.make_url in pkg:pypi/sqlalchemy@2.0.51
- Packages
- Symbols
-
- sqlalchemy.engine.make_url
- Environment
- python
- Created
- 2026-09-05T21:37:01Z
Contract
- make_url parses RFC-1738 compliant database connection strings into URL objects with correct drivername, user credentials, host, port, database, and query parameters.
- make_url extracts backend name and driver name components correctly via get_backend_name and get_driver_name.
- make_url accepts an existing URL instance and returns it unchanged.
- URL objects created by make_url support immutability and component updates via set.
- URL render_as_string safely obscures plain text passwords when hide_password is set to True.
- make_url parses SQLite in-memory and file-based URLs correctly.
- make_url raises ArgumentError when given an unparsable or invalid URL representation.
Files
- NOTES.md
- PROMPT.md
- csx.json
- requirements.txt
- spec.json
- test/contract.py
Source
# sqlalchemy make_url API
This sample pins `sqlalchemy` 2.0.51 and verifies `sqlalchemy.engine.make_url` for parsing and manipulating database connection URLs.
The contract verifies:
- `make_url` parses RFC-1738 compliant database connection strings into URL objects with correct drivername, user credentials, host, port, database, and query parameters.
- `make_url` extracts backend name and driver name components correctly via `get_backend_name` and `get_driver_name`.
- `make_url` accepts an existing URL instance and returns it unchanged.
- URL objects created by `make_url` support immutability and component updates via `set`.
- URL `render_as_string` safely obscures plain text passwords when `hide_password` is set to True.
- `make_url` parses SQLite in-memory and file-based URLs correctly.
- `make_url` raises `ArgumentError` when given an unparsable or invalid URL representation.
Clean-room public code sample — generation instructions
Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.
A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.
Goal: verify sqlalchemy.engine.make_url in pkg:pypi/sqlalchemy@2.0.51
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:pypi/sqlalchemy@2.0.51
Demonstrate these symbols/APIs:
- sqlalchemy.engine.make_url
Rules:
- One focused purpose; the smallest project that proves the goal.
- Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
- Pin every dependency with a lockfile so resolution is reproducible.
- No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
- No personal names, emails, company names, or project identifiers of any kind.
- No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
- Keep it under 200 files and 256KB packed.
{"case":{"caseId":"case:sha256:b78de1c32d4b1493e38b1e510b264b6182b4af083e7544517479673129ec05ef","contract":["make_url parses RFC-1738 compliant database connection strings into URL objects with correct drivername, user credentials, host, port, database, and query parameters.","make_url extracts backend name and driver name components correctly via get_backend_name and get_driver_name.","make_url accepts an existing URL instance and returns it unchanged.","URL objects created by make_url support immutability and component updates via set.","URL render_as_string safely obscures plain text passwords when hide_password is set to True.","make_url parses SQLite in-memory and file-based URLs correctly.","make_url raises ArgumentError when given an unparsable or invalid URL representation."],"goal":"verify sqlalchemy.engine.make_url in pkg:pypi/sqlalchemy@2.0.51","kind":"HOW","packages":["pkg:pypi/sqlalchemy@2.0.51"],"schemaVersion":1,"symbols":["sqlalchemy.engine.make_url"]},"contractCommand":["python","test/contract.py"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"pypi","executionContext":"python","language":"python","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"pip","runtime":"python","schemaVersion":1},"license":"MIT-0","packages":["pkg:pypi/sqlalchemy@2.0.51"],"schemaVersion":1,"subject":"pkg:pypi/sqlalchemy@2.0.51","symbols":["sqlalchemy.engine.make_url"],"verifierAdapter":"python@1"}
sqlalchemy==2.0.51
{
"schemaVersion": 1,
"goal": "verify sqlalchemy.engine.make_url in pkg:pypi/sqlalchemy@2.0.51",
"kind": "HOW",
"packages": [
"pkg:pypi/sqlalchemy@2.0.51"
],
"symbols": [
"sqlalchemy.engine.make_url"
]
}
import sqlalchemy
from sqlalchemy.engine import make_url, URL
from sqlalchemy.exc import ArgumentError
# 1. Parse standard database URL into URL object
url_str = "postgresql+psycopg2://scott:tiger@localhost:5432/mydatabase?sslmode=require&connect_timeout=10"
u = make_url(url_str)
assert isinstance(u, URL), f"Expected URL instance, got {type(u)}"
assert u.drivername == "postgresql+psycopg2"
assert u.username == "scott"
assert u.password == "tiger"
assert u.host == "localhost"
assert u.port == 5432
assert u.database == "mydatabase"
assert u.query == {"sslmode": "require", "connect_timeout": "10"}
# 2. Extract backend and driver names
assert u.get_backend_name() == "postgresql"
assert u.get_driver_name() == "psycopg2"
# 3. Passing existing URL instance returns the same URL
u_same = make_url(u)
assert u_same == u
assert u_same is u
# 4. Immutability and URL updates via set()
u_updated = u.set(database="new_database", port=5433)
assert isinstance(u_updated, URL)
assert u_updated.database == "new_database"
assert u_updated.port == 5433
assert u_updated.username == "scott"
assert u.database == "mydatabase"
assert u.port == 5432
# 5. Safe password hiding with render_as_string
rendered = u.render_as_string(hide_password=True)
assert "tiger" not in rendered
assert "***" in rendered
# 6. SQLite in-memory and file URL parsing
sqlite_url = make_url("sqlite:///:memory:")
assert sqlite_url.drivername == "sqlite"
assert sqlite_url.database == ":memory:"
# 7. Invalid input raises ArgumentError
try:
make_url(12345)
raise AssertionError("Expected ArgumentError when passing invalid input to make_url")
except ArgumentError:
pass
print("CONTRACT PASS: sqlalchemy.engine.make_url verified offline")
Origin Seeder
anonymous