Skip to main content

A minimal Python library scaffold for codex-python

Project description

codex-python

A minimal Python library scaffold using uv with Python 3.13+.

Quickstart

  • Requires Python 3.13+.
  • Package import name: codex.
  • Distribution name (PyPI): codex-python.

Repo

Usage

Basic non-interactive execution via Codex CLI:

from codex import run_exec

out = run_exec("explain this repo")
print(out)

Options:

  • Choose model: run_exec("...", model="gpt-4.1")
  • Full auto: run_exec("scaffold a cli", full_auto=True)
  • Run in another dir: run_exec("...", cd="/path/to/project")

Using a client with defaults:

from codex import CodexClient

client = CodexClient(model="gpt-4.1", full_auto=True)
print(client.run("explain this repo"))

Install uv

  • macOS (Homebrew): brew install uv
  • Or via install script:
    • Unix/macOS: curl -LsSf https://astral.sh/uv/install.sh | sh
    • Windows (PowerShell): iwr https://astral.sh/uv/install.ps1 -UseBasicParsing | iex

See: https://docs.astral.sh/uv/

Create a virtual env (optional)

uv python install 3.13
uv venv --python 3.13
. .venv/bin/activate  # or .venv\Scripts\activate on Windows

Build

uv build

Artifacts appear in dist/ (.whl and .tar.gz).

Publish to PyPI

  • Manual:
export PYPI_API_TOKEN="pypi-XXXX"  # create at https://pypi.org/manage/account/token/
uv publish --token "$PYPI_API_TOKEN"
  • GitHub Actions (Trusted Publishing): enable PyPI Trusted Publishing for gersmann/codex-python and push a tag like v0.1.0. No token is needed. The workflow at .github/workflows/publish.yml requests an OIDC token and runs uv publish --trusted-publishing=always on v* tags.

Dev tooling

  • Lint: make lint (ruff + mypy)
  • Tests: make test (pytest)
  • Format: make fmt (ruff formatter)
  • Pre-commit: uvx pre-commit install && uvx pre-commit run --all-files

Project Layout

.
├── codex/              # package root (import name: codex)
│   └── __init__.py     # version lives here
├── pyproject.toml      # PEP 621 metadata, hatchling build backend
├── README.md
└── .gitignore

Versioning

Version is managed via codex/__init__.py and exposed as __version__. The build uses Hatch’s version source.

Python Compatibility

  • Requires Python >=3.13.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codex_python-0.1.1.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codex_python-0.1.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file codex_python-0.1.1.tar.gz.

File metadata

  • Download URL: codex_python-0.1.1.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.16

File hashes

Hashes for codex_python-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b64f1acf1fe9cc8ee534cc2e76dcda53ff8cc9613b15f18eb53ce7b9a4edf8ee
MD5 b5962045da174d8f2c3833edf92c3c3f
BLAKE2b-256 8ba986e558a0c92458851043fba078ebc1413bc44791f9bade30c94d984d99a9

See more details on using hashes here.

File details

Details for the file codex_python-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for codex_python-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d2a85de1d8f4f3fdcd874579bd282011e6012f6fa999dde06f51159132f2c144
MD5 a86ae876a37fa0f1f3b583bcce9230ff
BLAKE2b-256 cbfc194db7201336fd6a954a8866b3679aef6deee497f611adc5ec3528f54052

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page