agentsclimarketplace

Python

Skill cocart-headless/cocart-skills/skills/python

A collection of skills for AI coding agents. SDK setup and integration guidance for headless WooCommerce development.

Install
npx -y skills add cocart-headless/cocart-skills --skill python

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

CoCart Python SDK patterns for headless WooCommerce. Use when setting up CoCart in Python projects using Django, FastAPI, Flask, or standalone scripts.

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

3.5 KB, 688 tokens by cl100k_base, as published. Nobody here has run it

CoCart Python SDK Skill

You are an expert in the CoCart Python SDK (cocart-headless/cocart-python). When a user adds "use CoCart" to a prompt and their project is Python-based, apply this skill.

Note: The Python SDK is still in development and not yet production-ready. Mention this when relevant and encourage users to report bugs.

Installation

pip install cocart

# Optional: httpx adapter for async usage
pip install httpx

Requirements: Python 3.9+. requests library installed automatically.

Quick Start

from cocart import CoCart

client = CoCart("https://your-store.com")

# Browse products (no auth required)
products = client.products().all()
print(products.to_dict())

# Add item to cart (guest session created automatically)
response = client.cart().add_item(42, quantity=2)
print(f"Cart key: {response.get_cart_key()}")

# Get cart
cart = client.cart().get()
print(f"Items: {cart.get_item_count()}")
print(f"Total: {cart.get_totals().get('total')}")

Configuration

client = CoCart(
    "https://your-store.com",
    cart_key="existing_cart_key",
    username="[email protected]",
    password="password",
    jwt_token="your-jwt-token",
    consumer_key="ck_xxxxx",
    consumer_secret="cs_xxxxx",
    timeout=30,
    verify_ssl=True,
    max_retries=2,
    rest_prefix="wp-json",
    namespace="cocart",
    main_plugin="basic",
    etag=True,
)

Common Mistakes

  1. Using requests when you need async — The default HTTP adapter is synchronous (requests). Install httpx for async support in FastAPI or other async frameworks.
  2. Not persisting the cart key across requests — In web frameworks like Django or FastAPI, store the cart key in the user's session. The SDK doesn't do this automatically outside of scripts.
  3. Passing wrong types to add_item() — The first argument is product_id (int), second is quantity (int). Variations use variation_id=456 as a keyword argument.
  4. Forgetting to call .to_dict() — Response objects are not plain dicts. Use .to_dict() to serialize for JSON responses in web frameworks.

When to Load References

WordPress / WooCommerce Requirements

What ships with it: 3 files

4.2 KB alongside SKILL.md

references/

Keep looking

Skills are one crate of 326,984. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.