|
| 1 | +# AGENTS.md — AI / automation context |
| 2 | + |
| 3 | +## Project |
| 4 | + |
| 5 | +| | | |
| 6 | +|---|---| |
| 7 | +| **Name** | **Contentstack** (PyPI) — **Python Content Delivery SDK** | |
| 8 | +| **Purpose** | Python client for the **Content Delivery API (CDA)**: **Stack**, content types, entries, assets, queries, live preview, taxonomy, variants. Uses **`requests`** + **`urllib3.Retry`** via **`HTTPSConnection`**. | |
| 9 | +| **Repository** | [contentstack/contentstack-python](https://github.com/contentstack/contentstack-python.git) | |
| 10 | + |
| 11 | +## Tech stack |
| 12 | + |
| 13 | +| Area | Details | |
| 14 | +|------|---------| |
| 15 | +| **Language** | **Python** (see **`setup.py`** `python_requires`, classifiers) | |
| 16 | +| **HTTP** | **`requests`**, **`urllib3`** | |
| 17 | +| **Tests** | **pytest** + **`unittest.TestCase`** under **`tests/`** | |
| 18 | +| **Packaging** | **`setuptools`** / **`setup.py`**, package **`contentstack`** | |
| 19 | + |
| 20 | +## Source layout |
| 21 | + |
| 22 | +| Path | Role | |
| 23 | +|------|------| |
| 24 | +| `contentstack/stack.py` | **`Stack`**, **`ContentstackRegion`**, endpoint and **HTTPSConnection** wiring | |
| 25 | +| `contentstack/https_connection.py`, `contentstack/controller.py` | Session, retries, **`get_request`** | |
| 26 | +| `contentstack/query.py`, `contentstack/basequery.py` | Queries | |
| 27 | +| `contentstack/entry.py`, `asset.py`, `contenttype.py`, … | Domain modules | |
| 28 | +| `contentstack/__init__.py` | Public exports (**`Stack`**, **`Entry`**, **`Asset`**, …), **`__version__`** | |
| 29 | +| `config.py` (repo root) | Test credentials and UIDs — **must not commit secrets** | |
| 30 | +| `tests/*.py` | Integration-style tests importing **`config`** | |
| 31 | + |
| 32 | +## Common commands |
| 33 | + |
| 34 | +```bash |
| 35 | +pip install -r requirements.txt |
| 36 | +pip install -e . |
| 37 | +pytest tests/ |
| 38 | +``` |
| 39 | + |
| 40 | +## Environment / test configuration |
| 41 | + |
| 42 | +Tests load stack settings from root **`config.py`** (e.g. **HOST**, **APIKEY**, **DELIVERYTOKEN**, **ENVIRONMENT**). Use a local, gitignored file or sanitized values for CI. Do not commit secrets. |
| 43 | + |
| 44 | +## Further guidance |
| 45 | + |
| 46 | +- **Cursor rules:** [`.cursor/rules/README.md`](.cursor/rules/README.md) |
| 47 | +- **Skills:** [`skills/README.md`](skills/README.md) |
| 48 | + |
| 49 | +Product docs: [Content Delivery API](https://www.contentstack.com/docs/developers/apis/content-delivery-api/). |
0 commit comments