Skip to main content

Write i2 Analyst's Notebook Exchange (.anx) files from Python, JSON, or YAML

Project description

anxwritter

Write i2 Analyst's Notebook Exchange (.anx) files from Python, JSON, or YAML.

Output files open directly in i2 ANB 9+ via File > Open — no import wizard, no intermediate CSV. The .anx file embeds the entire chart as XML.

This project is independent and not affiliated with, endorsed by, or sponsored by the makers of i2 Analyst's Notebook — past or present — including IBM, i2 Group Limited, i2 Limited, N.Harris Computer Corporation, Harris Computer Corporation, or Constellation Software Inc. — nor by Esri, Microsoft, or Google. "i2", "i2 Analyst's Notebook", "ANB", "Esri", "Esri Maps", "Microsoft", and "Google" are trademarks of their respective owners and are referenced here solely to identify the file format and the tools this library interoperates with (nominative use).

To produce structurally valid .anx files, this library embeds nine format identifiers: six abstract-root GUIDs required by the lcx:LibraryCatalogue schema and three geo-map property GUIDs required by ANB's Esri Maps subsystem. These are functional tokens (format anchors), not creative content, reproduced for interoperability purposes. The library ships nothing else from i2's type system — no standard-library types, no icon catalog, no palette definitions. All of that content stays in the user's licensed ANB installation and must be supplied by the user.

This design is intentional: organisations are free to define their own default semantic types, palettes, icon mappings, link types, and attribute classes.


Install

# As a library — import in your own code
pip install anxwritter

# With YAML support (optional)
pip install anxwritter[yaml]

# As a command-line tool only (isolated venv, no env conflicts)
pipx install anxwritter

With uv:

# Add to a uv-managed project
uv add anxwritter
uv add 'anxwritter[yaml]'           # with YAML support

# Install globally as a CLI tool
uv tool install anxwritter

# One-off run without installing
uvx anxwritter chart.yaml -o my_chart.anx

Requires Python 3.10+.

Want a standalone executable? pip install pyinstaller (or nuitka) and point it at anxwritter/cli.py. anxwritter does not ship pre-built binaries.


Quick example

from anxwritter import ANXChart

chart = ANXChart()

chart.add_icon(id='Alice', type='Person', color='Blue')
chart.add_icon(id='Bob',   type='Person', color='Red')

chart.add_link(
    from_id='Alice', to_id='Bob',
    type='Telephone Call', arrow='->',
    date='2024-01-15',
)

chart.to_anx('output/my_chart')

This writes output/my_chart.anx. Open it in ANB.

YAML + CLI

# chart.yaml
entities:
  icons:
    - { id: Alice, type: Person, color: Blue }
    - { id: Bob,   type: Person, color: Red }
links:
  - { from_id: Alice, to_id: Bob, type: Telephone Call, arrow: '->', date: '2024-01-15' }
anxwritter chart.yaml -o output/my_chart.anx

What's in the box

  • Typed dataclass APIIcon, Box, Circle, ThemeLine, EventFrame, TextBlock, Label, Link, Card
  • Three input forms — Python objects, JSON, or YAML; all paths produce identical output
  • Org-level config files — separate entity types, link types, attribute classes, palettes from per-chart data; layered configs supported
  • Auto-layout — circle, grid, or random placement; manual x/y always wins
  • Geographic positioning — map entity attributes to lat/lon for canvas layout and/or ANB Esri Maps
  • Auto-coloring — distribute HSV hues across entities; matching link colors
  • Validation — collects every error in one pass before writing the file
  • Semantic types — full lcx:LibraryCatalogue support with custom type extension
  • CLIanxwritter [--config org.yaml ...] data.{json,yaml} -o out.anx

Customize everything ANB exposes

No fixed catalog — every configurable surface in ANB is yours to define:

  • Entity types & link types — names, icons, colors, shading, semantic-type bindings
  • Attribute classes — type, prefix/suffix, decimals, font, merge behavior, icons, visibility
  • Palettes — your own "Insert from Palette" panels with grouped types and pre-filled attribute entries
  • Legend — 8 item types (icon, link, line, font, text, attribute, timezone, icon-frame) with full styling
  • Colors — 40 named, hex, COLORREF, or auto-distributed HSV with link colors that follow the entity
  • Strengths, grades, source types, datetime formats, semantic types — all configurable

Define your defaults once in config.yaml, layer overrides on top, reuse across every chart.


Documentation


License

MIT — see LICENSE. Copyright (c) 2024-2026 gustavo-gkmi.

Developed with the help of AI coding assistants.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anxwritter-1.2.0.tar.gz (248.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anxwritter-1.2.0-py3-none-any.whl (99.7 kB view details)

Uploaded Python 3

File details

Details for the file anxwritter-1.2.0.tar.gz.

File metadata

  • Download URL: anxwritter-1.2.0.tar.gz
  • Upload date:
  • Size: 248.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for anxwritter-1.2.0.tar.gz
Algorithm Hash digest
SHA256 f1ef881fad0c6606805ae1432887b07a0b4b4fb5ad523b9858ec90c98a71f3e9
MD5 4b2f91fd302803f80d59cf770b83a126
BLAKE2b-256 5f7dd7ef479e00d464e71a1a81b68d353c85ad3d97f08720f5d2e0dafc6434c5

See more details on using hashes here.

File details

Details for the file anxwritter-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: anxwritter-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 99.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for anxwritter-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 33cddc942a046956e1c7cfb3e8e704b03bcc3b6026b16c216e00b7ca3124de1f
MD5 d204adeffc8a9d65c865668d13ec2acd
BLAKE2b-256 f44dd4491efe34b235411484d0506e27dd0cfa9fe533c6c83e184634c2502373

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page