CodeSampleX

Sample

openpyxl 3.0.7: Workbook, load_workbook, styles.Font

Verified sample for pypi openpyxl 3.0.7: Workbook, load_workbook, styles.Font. The contract ran on python 3.12 · linux debian/x64 · docker and passed.

sha256:1160d8c2ee4d169a8cd2c8deb214653eac75c0cccb7495eac7019b7f2b156f49

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 linux 24 · ubuntu · glibc 2.39 x64 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-10-14

Case

HOW
Goal
verify pkg:pypi/openpyxl@3.0.7
Packages
Symbols
  • openpyxl.Workbook
  • openpyxl.load_workbook
  • openpyxl.styles.Font
Created
2026-10-14T05:51:20Z

Contract

  1. Workbook() creates an in-memory workbook whose active worksheet supports cell assignment, row appending via append(), and font styling via openpyxl.styles.Font
  2. Workbook.save() serializes the workbook to a binary stream and load_workbook() round-trips sheet names, cell values, formulas, and bold font attributes

Files

  • PROMPT.md
  • csx.json
  • requirements.txt
  • spec.json
  • test/contract.py

Download the source artifact (tar.gz)

Source

PROMPT.md
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 pkg:pypi/openpyxl@3.0.7
Kind: HOW

Use EXACTLY these public packages and versions:
  - pkg:pypi/openpyxl@3.0.7

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.
csx.json
{"case":{"caseId":"case:sha256:b49574457eb7ff9851f6c7e83655ddb9209eda707bc7cbf84292916b0a468932","contract":["Workbook() creates an in-memory workbook whose active worksheet supports cell assignment, row appending via append(), and font styling via openpyxl.styles.Font","Workbook.save() serializes the workbook to a binary stream and load_workbook() round-trips sheet names, cell values, formulas, and bold font attributes"],"goal":"verify pkg:pypi/openpyxl@3.0.7","kind":"HOW","packages":["pkg:pypi/openpyxl@3.0.7"],"schemaVersion":1,"symbols":["openpyxl.Workbook","openpyxl.load_workbook","openpyxl.styles.Font"]},"contractCommand":["python","test/contract.py"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"pypi","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"pip","schemaVersion":1},"license":"MIT-0","packages":["pkg:pypi/openpyxl@3.0.7"],"schemaVersion":1,"subject":"pkg:pypi/openpyxl@3.0.7","symbols":["openpyxl.Workbook","openpyxl.load_workbook","openpyxl.styles.Font"],"verifierAdapter":"python@1"}
requirements.txt
et-xmlfile==2.0.0
openpyxl==3.0.7
spec.json
{
  "schemaVersion": 1,
  "goal": "verify pkg:pypi/openpyxl@3.0.7",
  "kind": "HOW",
  "packages": [
    "pkg:pypi/openpyxl@3.0.7"
  ]
}
test/contract.py
import io
import openpyxl
from openpyxl import Workbook, load_workbook
from openpyxl.styles import Font


def test_openpyxl_contract() -> None:
    assert openpyxl.__version__ == "3.0.7"

    wb = Workbook()
    ws = wb.active
    ws.title = "Summary"

    ws["A1"] = "Item"
    ws["B1"] = "Value"
    ws["A1"].font = Font(bold=True)
    ws.append(["Alpha", 10])
    ws.append(["Beta", 25])
    ws["B4"] = "=SUM(B2:B3)"

    buf = io.BytesIO()
    wb.save(buf)
    buf.seek(0)

    loaded = load_workbook(buf)
    assert loaded.sheetnames == ["Summary"]
    sheet = loaded["Summary"]
    assert sheet["A1"].value == "Item"
    assert sheet["A1"].font.bold is True
    assert sheet["A2"].value == "Alpha"
    assert sheet["B2"].value == 10
    assert sheet["A3"].value == "Beta"
    assert sheet["B3"].value == 25
    assert sheet["B4"].value == "=SUM(B2:B3)"


if __name__ == "__main__":
    test_openpyxl_contract()

Origin Seeder

anonymous