Skip to main content

CTOrg

Draw an org chart from a JSON file, in the terminal, as PNG, or as SVG. You can also list people and print counts.

Example org chart

Install

pip install -r requirements.txt

Requires Python 3 with click, Pillow and svgwrite. pytest is only needed to run the tests.

Data

The data is a JSON array of people:

[
  { "name": "Elena Marsh", "role": "Lead", "team": "Leadership", "manager": null },
  { "name": "Maya Okafor", "role": "Engineering Manager", "seniority": "Senior", "team": "Platform", "manager": "Elena Marsh" }
]
Field Required Notes
name yes Unique. Managers refer to people by this value.
role yes Free text, e.g. Developer, Tester.
seniority no One of Junior, Mid, Senior.
team no Free text. Used for colors and filters.
manager no A name from the file. Omit or set to null for the top.

The loader rejects duplicate names, unknown managers, invalid seniority, and manager cycles. See data.json for a full example.

Usage

Draw the chart. The bare form is the same as chart:

python ctorg.py chart [data.json] [--format {ascii,png,svg}] [-o OUTPUT]
Format Result
ascii Printed to the terminal (default). Colored by team on a TTY unless NO_COLOR is set.
png Image, orgchart.png by default.
svg Vector image, orgchart.svg by default.

-o sets the output path. With ascii, it writes plain text to that file instead of printing.

$ python ctorg.py
Elena Marsh — Lead (Leadership)
├── Maya Okafor — Senior Engineering Manager (Platform)
│   ├── Lukas Brandt — Senior Developer (Platform)
│   ├── Priya Raman — Mid Developer (Platform)
│   ├── Tomas Lindqvist — Junior Developer (Platform)
│   └── Sofia Rossi — Junior Developer (Platform)
├── Aiko Tanaka — Senior Product Manager (Product)
│   ├── Diego Herrera — Mid Designer (Product)
│   ├── Grace Mensah — Mid Developer (Product)
│   ├── Ethan Brooks — Developer (Product)
│   └── Hiro Sato — Mid Analyst (Product)
└── Nadia Petrova — Senior QA Lead (QA)
    ├── Kofi Asante — Mid Tester (QA)
    ├── Ines Moreau — Junior Tester (QA)
    └── Ravi Kumar — Tester (QA)

List people

python ctorg.py list [data.json] [--role ROLE] [--seniority {Junior,Mid,Senior}] [--team TEAM]

Prints one line per person, in file order. Filters combine: a person must match all of them. --role and --team are case-insensitive.

Stats

python ctorg.py stats [data.json]

Prints the number of people, top-level people, levels, managers, and span of control (average and maximum direct reports). It also prints counts by team, seniority, and role.

list and stats write no files.

Tests

pytest

License

Apache License 2.0. See LICENSE.

Metadata

Release files for ctorg 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ctorg 0.1.0
File Size Uploaded Provenance
ctorg-0.1.0.tar.gz 12.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ctorg 0.1.0
File Interpreter ABI Platform
ctorg-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 27.4 kB

Release files / ctorg-0.1.0.tar.gz

Download URL ctorg-0.1.0.tar.gz
Size 12.1 kB
Tags Source
SHA-256 checksum
How to use checksums
72ecc5dab0377207bf38ac5e8baf7ba3c739e7ea5a8b7faa260694ba9f1e75d3
BLAKE2b-256 checksum
How to use checksums
6aeeb078f94814569574a6280bf3e088d8eb88748b52f735c51ab521a84b6bf8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / ctorg-0.1.0-py3-none-any.whl

Download URL ctorg-0.1.0-py3-none-any.whl
Size 15.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
60d77c33e906415f4f67e1221950dc3df5c369cadd152288b57552b3fdcd4fa4
BLAKE2b-256 checksum
How to use checksums
34a42953b30e68feea18811b719272609829ac57c46abcff98db130ad237f35b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for ctorg 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page