# Python Style

> Use for package layout under contentstack_management/, setup.py, pylint-friendly style, and imports.

- Skill: `contentstack/python-style` (Agent Skill)
- Install (CLI): `npx skillmds@latest add contentstack/python-style`
- Raw SKILL.md: https://api.skillmd.com/api/skills/contentstack/python-style/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: contentstack (https://skillmd.com/u/contentstack)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/contentstack/python-style

---


# Python style and repo layout – Contentstack Management Python

## When to use

- Editing any Python under **`contentstack_management/`**, **`setup.py`**, or **`requirements.txt`**.
- Adding modules or changing how the public package surface is exported.

## Instructions

### Layout

- **`contentstack_management/contentstack.py`** — **`Client`**, **`Region`**, **`user_agents`**, OAuth wiring.
- **`contentstack_management/_api_client.py`** — **`_APIClient`** (HTTP, retries).
- **`contentstack_management/stack/`** — stack-scoped API surface.
- **Domain modules** — **`entries/`**, **`assets/`**, **`webhooks/`**, **`oauth/`**, etc.

### Style

- Match existing modules: naming, docstrings, and patterns already used in the same directory.
- Prefer small, focused changes; keep **`__init__.py`** exports consistent with public API intent (**`README`**, **`contentstack_management.__all__`**).

### Imports

- Use **`requests`** (and **`requests-toolbelt`** where already used) through **`_APIClient`** patterns rather than ad-hoc clients in domain modules unless justified.

### Security

- Do not log **authtokens**, **management tokens**, **passwords**, or **API keys**; preserve existing header handling in **`Client`**.

