Skip to content

docs: add agent-readable documentation and repository metadata - #449

Open
const-cloudinary wants to merge 1 commit into
masterfrom
docs/agent-readable-documentation
Open

docs: add agent-readable documentation and repository metadata#449
const-cloudinary wants to merge 1 commit into
masterfrom
docs/agent-readable-documentation

Conversation

@const-cloudinary

Copy link
Copy Markdown
Member

Brings pycloudinary in line with the agent-readable documentation standard already shipped in cloudinary_npm.

What this adds

  • README.md restructured to the npm section layout (Install, Quick start, Common tasks, When to use this SDK, Status and compatibility, Documentation, For AI coding agents, Support, Security, License).
  • AGENTS.md (6 sections) plus CLAUDE.md@AGENTS.md, matching npm.
  • cloudinary/docs/ — 15 task pages shipped inside the PyPI package, so they are version-matched to the installed release. Wired up via MANIFEST.in and [tool.setuptools.package-data].
  • examples/ — 9 complete runnable scripts, repo-only (excluded from the wheel).
  • SECURITY.md, context7.json, canonical LICENSE at root.

Python-specific deviations from npm

  • Docs live at cloudinary/docs/, not root docs/ — only an in-package directory installs deterministically from a wheel. Maps 1:1 to npm's node_modules/cloudinary/docs/.
  • examples/ is not shipped in the wheel. Loose .py files inside the importable package risk import shadowing. Every doc page carries the complete runnable flow, so the agent read path is intact.
  • One extra page, use-with-django.md, covering CloudinaryField, the form fields, and migrations.

Verification

  • All 9 examples run green against a freshly provisioned test cloud.
  • Every doc snippet executed, not just read — 59 code blocks parse, all cloudinary.* calls resolve against the real SDK, and all arguments bind to actual signatures.
  • Error paths tested explicitly: with no CLOUDINARY_URL all examples print a friendly message and exit 1; with bad credentials all API examples surface the real error and exit 1.
  • Upload and URL parameters verified behaviourally against the SDK whitelists — a param that would be silently dropped fails the check.
  • Packaging proven: all 15 .md files present in both wheel and sdist; examples/ correctly absent.

Notes for review

  • CHANGELOG.md intentionally untouched — the npm reference PRs added no changelog entries for docs work.
  • No linter added and no unrelated files reformatted, per AGENTS.md.
  • Docs contain no version number; the version-matched guarantee comes from shipping inside the package.

🤖 Generated with Claude Code

Bring the repository up to the Cloudinary agent-readable documentation
standard established in cloudinary_npm (PRs #742, #744).

- Restructure README around the standard section order, with a runnable
  quick start and a stated read path for coding agents.
- Add 15 task docs under cloudinary/docs/, shipped inside the published
  package so they install to site-packages/cloudinary/docs/ and are
  version-matched with the code. Includes a Django page, which has no
  equivalent in the Node SDK.
- Add examples/ with 8 complete runnable files, one per "doing" task,
  cross-linked with their task docs.
- Add AGENTS.md, CLAUDE.md, SECURITY.md, and context7.json.
- Replace the three-line LICENSE.txt stub with canonical MIT text at
  LICENSE, preserving the vendored poster attribution. This is what
  GitHub and license scanners need to detect the license.
- Ship docs via MANIFEST.in plus package-data; keep examples/ repo-only.
- Set the PyPI summary to match the README one-liner.
- Correct stale facts in CONTRIBUTING.md (Travis, setup.py test, and the
  supported version matrix).

Every doc snippet and all 8 examples were executed against a live cloud.
Documented behavior that differs from a first reading of the code, and is
now stated in the docs: upload_large defaults to resource_type="raw" and
silently stores a video as an opaque blob; re-uploading to the same
public_id overwrites by default; the upload result exposes a moderation
list rather than a flat moderation_status; undefined structured-metadata
keys are rejected rather than ignored; the dict form of the video poster
option ignores secure=True; Search rejects leading wildcards.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant