Python 3 CLI for interacting with Confluence API.
Wikipy's tree builder is useful for large Confluence instances which have grown past the point of reasonable maintence. While Atlassian supports HTML, XML, and PDF exports of Confluence, these exports exist only on a per-space or per-page basis. For organizations with hundreds of spaces (which is fairly common) there is no other tool which allows users to build a visual heirarchy of their own Confluence.
├── Meaty Meats
│ ├── Spicy jalapeno bacon ipsum dolor amet chicken doner corned beef sirloin
│ ├── Hamburger picanha cow pork chop chicken
│ ├── Porchetta tongue landjaeger doner salami pork loin
│ ├── Ribeye filet mignon capicola
│ ├── Kevin bacon ham hock meatball swine
│ ├── How-to recipes
│ │ ├── Ham hock ground round t-bone corned beef
│ │ ├── Shoulder frankfurter corned beef alcatra jerky beef
│ │ ├── Rump beef venison fatback chicken beef ribs brisket
│ │ ├── Meatball landjaeger short loin
│ │ ├── Capicola picanha meatloaf beef pork
│ │ ├── Bacon salami ham frankfurter
│ │ └── Strip steak rump
│ ├── Beefy Requirements
│ │ ├── Picanha tongue biltong brisket short loin
│ │ ├── Filet mignon kevin spare ribs
│ │ └── Pancetta shoulder ham
│ └── Beef sausage
├── Bacons
│ ├── Bacon salami ham frankfurter
│ ├── Kevin bacon ham
│ ├── ham hock pork loin
│ └── Porchetta tongue
└── Animals
└── Bresaola bacon corned beef
- Confluence Python CLI: https://github.com/RaymiiOrg/confluence-python-cli
- Pandas: https://pandas.pydata.org/
- Treelib: http://treelib.readthedocs.io/en/latest/install.html
- A user with access to the target Confluence instance
-
Use Confluence Python CLI to generate a CSV of pages from your Confluence instance":
python confluence.py --help
confluence.py [-h] -w WIKIURL -u USERNAME -p PASSWORD{addpage, updatepage, listpages, removepage, getpagecontent, getpagesummary, listspaces, addspace, removespace, adduser, removeuser, deactivateuser, reactivateuser, changeuserpassword, addgroup, removegroup, listgroups, listusers, getallpages, addusertogroup, removeusergromgroup, listusergroups}
-
Add labels to generated CSV
Ensure this follows the format: 'id', 'space', 'parent', 'name', 'url' NOTE: Check CSV to ensure data is not broken; commas in page titles will break the CSV.
-
Run 'python confTree.py'
As long as the generated CSV is formatted correctly and lives in the same directory as confTree.py, this should run as expected.
- Ensure that the contents of 'listpages' (from confluence.py) are saved as a file named confluence.csv (this should replace the example confluence.csv provided here)
- Confluence Hierarchy Builder builds four heirarchies deep into each space, but can be easily modified to include more
- A Confluence instance of 10,000 pages will take roughly 10-15 minutes to process
- Python 3 rewrite
- Documentation
- Dynamic level detection
- Extended API features