Skip to main content

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

Project description

anxwritter

For law enforcement, OSINT practitioners, and intelligence analysts who need to generate i2 Analyst's Notebook charts programmatically from case data, scrapers, or ETL pipelines, with reusable organization-level defaults instead of dragging entities by hand.

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.

Independent project — not affiliated with IBM, i2 Group, N.Harris Computer Corporation, or any other vendor. "i2", "i2 Analyst's Notebook", and "ANB" are trademarks of their respective owners (nominative use). See NOTICE.md for the full interoperability, trademark, and attribution statement.

Status: active development. See CHANGELOG.md for breaking changes between releases. API stabilization targeted for 2.0.


Install

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

# 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

# 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

  • Geographic positioning — map entity attributes to lat/lon for canvas layout and/or ANB Esri Maps
  • Org-level config files — separate entity types, link types, attribute classes, and palettes from per-chart data; layered configs with append-and-dedup or wholesale-replace semantics
  • Semantic types — full lcx:LibraryCatalogue support with custom type extension; per-instance overrides
  • Auto-layout — geometric (circle, grid, radial, random) plus topology-aware force-directed: Fruchterman-Reingold, ForceAtlas2, tidy tree (Reingold-Tilford). Manual x/y always wins; pinned entities act as anchors
  • Auto-coloring — distribute HSV hues across entities; matching link colors that follow the target entity
  • CLIanxwritter [--config org.yaml ...] data.{json,yaml} -o out.anx, with --show-config provenance and --geo-data for external geo lookups
  • Three input forms — Python objects, JSON, or YAML; all paths produce identical output
  • Typed dataclass APIIcon, Box, Circle, ThemeLine, EventFrame, TextBlock, Label, Link, Card
  • Validation — collects every error in one pass before writing the file

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.7.1.tar.gz (284.1 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.7.1-py3-none-any.whl (113.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: anxwritter-1.7.1.tar.gz
  • Upload date:
  • Size: 284.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for anxwritter-1.7.1.tar.gz
Algorithm Hash digest
SHA256 2e0e68c59e472f52d0e9829472e6b7c95bd2cdf489cbae6cf0f571c63b8dfe53
MD5 13601e181d47e2bb95e628ae47483acd
BLAKE2b-256 70903498bfe7ae81d0416833f98096648073d5a6cc780ef4785b78588cfbdac8

See more details on using hashes here.

Provenance

The following attestation bundles were made for anxwritter-1.7.1.tar.gz:

Publisher: publish.yml on gustavo-gkmi/anxwritter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: anxwritter-1.7.1-py3-none-any.whl
  • Upload date:
  • Size: 113.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for anxwritter-1.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f28b615f70fa19e0079cb9ccf303bfe3b9c9bbfc5f0ae7b6b07fe73d065e0eb0
MD5 342e35df0ad58db3e0e1c6833dd1ed2e
BLAKE2b-256 9407f65f0b903b8bd3b406c5db938ce31db755b7fe5afc390b1b274d15ea6d2e

See more details on using hashes here.

Provenance

The following attestation bundles were made for anxwritter-1.7.1-py3-none-any.whl:

Publisher: publish.yml on gustavo-gkmi/anxwritter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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