---
product: Chilkat
product_version: 11.7.0
language: ckpython
language_label: CkPython
document: language guide
---
> Chilkat 11.7.0 · language=ckpython · this file: `https://www.chilkatsoft.com/ai-docs/v/11.7.0/ckpython/guide.md`
> Class pages: `https://www.chilkatsoft.com/ai-docs/v/11.7.0/ckpython/classes/<Class>.md`

# Chilkat for CkPython — language guide — v11.7.0

## 1. Which Chilkat binding this is

This is **CkPython**, the original Chilkat Python module: `pip install chilkat`, `import chilkat`, classes `chilkat.CkHttp`, `chilkat.CkZip`, `chilkat.CkBinData`, …; properties through `get_Xxx()` / `put_Xxx(...)`; string-producing methods in two forms (uppercase with a `CkString` out-argument returning a bool, lowercase-initial returning the `str`). **For a new project Chilkat recommends the other binding, Chilkat2-Python** (`pip install chilkat2`, `import chilkat2`, classes `chilkat2.Http`, real properties, `str`/`memoryview` results) — its reference is `https://www.chilkatsoft.com/ai-docs/v/11.7.0/python/`. The two modules are the same library and are released together; do not mix them in one program. Comparison: [https://www.chilkatsoft.com/ckpython_vs_chilkat2_python.asp](https://www.chilkatsoft.com/ckpython_vs_chilkat2_python.asp).

## 2. Install and requirements

```
pip install chilkat
```

One wheel per OS/CPU works with every CPython 3.7 and later (stable ABI): Windows, Linux (glibc), Alpine, macOS. Details: [https://www.chilkatsoft.com/python.asp](https://www.chilkatsoft.com/python.asp).

## 3. Unlocking and object creation

```python
import chilkat

# Required once per process, before any other Chilkat object. Any string unlocks a 30-day trial.
glob = chilkat.CkGlobal()
success = glob.UnlockBundle("Anything for 30-day trial")
if (success != True):
    print(glob.lastErrorText())
    sys.exit()

http = chilkat.CkHttp()
```

- Unlocking only sets a flag in memory: no license files, no network call, so the call is repeated each time the program runs. Extra calls are harmless no-ops; the `Global` object can be discarded afterwards.
- If a program forgets to unlock, Chilkat runs in trial mode and stops working when the trial expires — always include the call, and use the purchased unlock code in production.
- `UnlockBundle` unlocks every class; per-class `UnlockComponent` methods exist only in old code.

## 4. Error model

Chilkat methods **never raise a Python exception for a Chilkat failure** (exceptions occur only for Python-level misuse, e.g. a wrong argument type). The note under each method on the class page says how it reports failure: a status method returns `False`; the lowercase-initial string form (`http.quickGetStr(url)`) returns **`None`** on failure (verified in the wrapper: a null C string becomes `None`), while the uppercase form `http.QuickGetStr(url, ckStr)` fills the `CkString` and returns `False`; object-returning methods return `None`; for an int result check `get_LastMethodSuccess()`. `lastErrorText()` holds the diagnostic in every case. (Chilkat2-Python differs here: its string methods return `""` on failure.)

Literals in CkPython: true is `True`, false is `False`, null/none is `None`.

## 5. Strings, bytes and encodings

- Strings are Python `str`; a `charset` argument names the encoding of the *bytes* being produced or read.
- Binary data: `bytes` in and out for the byte-array methods (`bd.AppendData(b, len(b))`, `bd.GetData()`), and `chilkat.CkByteData` in older code; `chilkat.CkBinData` for the `Bd` methods.
- Methods with `2`/`3` suffixes or `Quick*` prefixes are distinct members, not overloads; keyword arguments are not supported.

## 6. Object lifetime and threading

Objects are ordinary Python objects released by the garbage collector.

A Chilkat object may be used from any thread, but **one object must not be used by two threads at the same time**: create one object per thread or protect it with a lock. Objects are independent — there is no shared global state other than the unlock flag and the few `Global` settings.

## 7. Progress callbacks and async

Progress callbacks are supported in CkPython: subclass the class's progress class (e.g. `chilkat.CkHttpProgress`), override the event methods, and pass an instance to `put_EventCallbackObject(...)`; see the "Events and callbacks" section of a class page. `*Async` methods return a `chilkat.CkTask`; poll `get_Finished()` and read the result from the task. No new Async methods are added from 11.7.0 on.

## 8. Common mistakes an AI makes with this binding

1. Mixing in Chilkat2-Python spelling: `chilkat2.Http()`, `http.Port = 443`, `http.LastErrorText`. In CkPython it is `chilkat.CkHttp()`, `http.put_Port(443)`, `http.lastErrorText()`.
2. Wrapping Chilkat calls in `try/except` expecting a Chilkat failure to raise.
3. Omitting `Global.UnlockBundle` (the program runs in trial mode and stops working after 30 days).
4. Inventing members by analogy with other libraries. If a member is not on the class page, it does not exist — look it up rather than guessing.
5. Using deprecated members that older examples still show. The class page lists each one with its replacement; `deprecated.md` lists them all.
6. Ignoring the failure path. Every Chilkat method reports failure (see each method's note); `LastErrorText` says why, and printing it is the first debugging step.
7. Using one Chilkat object from two threads at the same time. Create one object per thread, or protect it with a lock.

## 9. Instructions block for coding agents

Paste into `CLAUDE.md`, `.cursor/rules`, or Copilot instructions:

```
This project uses Chilkat 11.7.0 from CkPython (pip install chilkat; import chilkat; classes chilkat.CkHttp, ...).
- Reference: https://www.chilkatsoft.com/ai-docs/v/11.7.0/ckpython/ — read guide.md once, then classes/<Class>.md for each class used.
- Call chilkat.CkGlobal().UnlockBundle(...) once at startup.
- Properties are methods: put_Xxx(v) to set, get_Xxx() to read; string getters are lowercase-initial (lastErrorText()).
- Chilkat methods never raise on failure: check the False/None result and print obj.lastErrorText().
- Never use a member that is not on the class page; never use members listed as deprecated.
```

## 10. Classes

[Class index for CkPython](https://www.chilkatsoft.com/ai-docs/v/11.7.0/ckpython/index.md)
