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.
Install
pip install ctorg
To work from a clone instead, install the requirements file:
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.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ctorg-0.1.1.tar.gz | 12.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ctorg-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.4 kB
Release files / ctorg-0.1.1.tar.gz
| Download URL | ctorg-0.1.1.tar.gz |
|---|---|
| Size | 12.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
70d46332d2518fa456abd923ffa9bd72d49881b6ccef1406ca2914df23208233
|
|
BLAKE2b-256 checksum How to use checksums |
95df5d77e0e4b42c531457d034069198edbaa13d3a4f5adf29376c87c40344b1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / ctorg-0.1.1-py3-none-any.whl
| Download URL | ctorg-0.1.1-py3-none-any.whl |
|---|---|
| Size | 15.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ca7e4ef7e178c8ff68c0ca151628d8b993e432b938e373fafe4c6b17afbc8b69
|
|
BLAKE2b-256 checksum How to use checksums |
d3d3ac075d8c3e971f99a0b19127dc2d23863ce0f9e71ac50ac76e6940e0f6ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for ctorg 0.1.1
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.