Welcome to the Space Wrangler! This toolkit is designed to help you efficiently manage and maintain your Confluence spaces. Currently, it includes tools for exporting spaces its metadata, with more features planned.
Export all pages from a specified Confluence space in HTML, JSON, and plain text formats.
Output structure:
- Saves files in
output/<SPACE-KEY>/html
output/<SPACE-KEY>/json
, andoutput/<SPACE-KEY>/txt
directories. - Directory structure mirrors the hierarchy of Confluence pages.
- Customize the output directory with the
--output-dir
option.
Generate a CSV file with metadata about each space in your Confluence.
Output structure:
- CSV file
all-spaces.csv
saved in theoutput/
directory. - Customize the
output
directory with the--output-dir
option.
Generate a CSV file with metadata about each page in specified Confluence spaces.
Output structure:
- CSV file
pages-metadata.csv
saved in theoutput/<SPACE-KEY>/csv
directory. - Customize the
output
directory with the--output-dir
option.
Generate a CSV file with metadata about the owners of pages in specified Confluence spaces.
Output structure:
- CSV file
owners-metadata.csv
saved in theoutput/<SPACE-KEY>/csv
directory. - Customize the output directory with the
--output-dir
option.
What kind of things you need to install on your workstation to start:
Note
While this toolkit might hypothetically work with Python 3.9 or earlier versions, I have not tested it on those versions. As such, I cannot guarantee its functionality on these older versions of Python. Given the age of these versions, if issues arise, I do not plan to address them.
To install Confluence Space Management Toolkits, follow these steps:
- Clone the repository
- Set up the project
- Activate the virtual environment
- Install toolkit and all its dependencies
- Verify the installation
- Clone the repository:
git clone git@github.com:sergeyklay/space-wrangler.git cd space-wrangler
- Set up virtual environment:
python -m venv .venv
- Activate the virtual environment:
source .venv/bin/activate # On Windows use `venv\Scripts\activate`
- Install the toolkit and dependencies:
poetry install
- Verify the installation:
swrangler --version
Important
The command source .venv/bin/activate
activates the virtual
environment. This step is not only part of the installation process but also
mandatory for running the toolkit when using the Git way installation method.
Remember to activate the virtual environment once per terminal session.
More information about Python virtualenv can be found here: Python Virtualenv.
Before using the toolkit, provide your Confluence API credentials.
Set the following environment variables:
CONFLUENCE_API_USER
: Your Confluence email address.CONFLUENCE_API_TOKEN
: Your Confluence API token.CONFLUENCE_DOMAIN
: Your Confluence domain.
You can obtain an API token from Confluence API Tokens section. You cannot use your regular password for the API token.
Create a .confluenc
e file with your credentials in the current working
directory or home directory:
echo CONFLUENCE_API_USER="your-confluence-email" > .confluence
echo CONFLUENCE_API_TOKEN="your-confluence-api-token" >> .confluence
echo CONFLUENCE_DOMAIN="your-confluence-domain" >> .confluence
swrangler --help
To export all pages from specified Confluence spaces:
swrangler export-space --space-key SPACE_KEY1,SPACE_KEY2
To generate a CSV file with metadata about all Confluence spaces:
swrangler spaces-metadata
To generate a CSV file with metadata about each page in specified Confluence spaces:
swrangler pages-metadata --space-key SPACE_KEY1,SPACE_KEY2
To generate a CSV file with metadata about the owners of pages in specified Confluence spaces:
swrangler owners-metadata --space-key SPACE_KEY1,SPACE_KEY2
There are common options that can be used with all commands.
To specify the output directory:
swrangler COMMAND --space-key SPACE_KEY --output-dir OUTPUT_DIR
If the --output-dir
option is not specified, the output
directory in the
current working directory will be used.
To suppress informational messages, use the -q
, --quiet
or --silent
option:
swrangler -q <command> --space-key SPACE_KEY
Should you have any question, any remark, or if you find a bug, or if there is something you can't do with the Space Wrangler, please open an issue.
Space Wrangler is written and maintained by Serghei Iakovlev. Contributors are listed on GitHub's overview.
Space Wrangler is free software licensed under the GNU General Public Licence version 3. Copyright © 2024 Serghei Iakovlev.
In copyright notices where the copyright holder is Serghei Iakovlev, then where a range of years appears, this is an inclusive range that applies to every year in the range. For example: 2023-2025 represents the years 2023, 2024 and 2025.