Installation¶
Install CMX and verify it works.
Requirements¶
CMX requires Python 3.11 or later.
Install the core¶
pip install cmx
The core is dependency-free. import cmx pulls in zero third-party packages, so you get text, the @/|/call operators, doc.print, doc.pre, code capture, and doc.flush with nothing else installed.
Optional features¶
Richer blocks load their dependencies lazily. Install only the extras you use, or cmx[all] for everything.
Install |
Pulls |
Enables |
|---|---|---|
|
nothing |
core: text, operators, |
|
pandas |
|
|
pillow, numpy |
array images, |
|
matplotlib |
|
|
pyyaml |
|
|
all of the above |
everything |
Note
The default github table format is rendered by CMX’s own pure-Python renderer, so cmx[tables] needs only pandas. tabulate is a development-only dependency, required at runtime only for alternate format= values like pipe or grid.
Verify¶
Create a file called check.py:
from cmx import doc
doc.config(__file__)
with doc:
doc @ "# Installation check"
doc.print("CMX is working!")
doc.flush()
Run it:
python check.py
CMX prints a green File output at file://... line and writes check.md next to your script:
# Installation check
```python
doc.print("CMX is working!")
```
```
CMX is working!
```
doc.config(__file__) writes the Markdown beside the script and roots assets in the script’s directory. See Configuration for output and figure paths.
Next steps¶
Overview — learn the config, capture, flush workflow.
Configuration — control where Markdown and assets are written.
Tables — render DataFrames and CSV with
cmx[tables].Images — display arrays and files with
cmx[images].