Skip to content

Extracts knowledge base articles from a ServiceNow instance and converts them to markdown format for easy reading and processing.

Notifications You must be signed in to change notification settings

TheSethRose/ServiceNow-KB-Extractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ServiceNow Knowledge Base Extractor

This tool extracts knowledge base articles from a ServiceNow instance and converts them to markdown format for easy reading and processing.

Features

  • Extracts articles from specified knowledge bases
  • Maintains folder structure (knowledge base > category > articles)
  • Converts HTML content to clean markdown
  • Preserves article metadata (author, dates, etc.)
  • Handles authentication securely
  • Supports filtering specific knowledge bases

Prerequisites

  • Python 3.8 or higher
  • Access to a ServiceNow instance
  • API credentials with access to knowledge bases

Installation

  1. Clone this repository:
git clone <repository-url>
cd servicenow-kb-extractor
  1. Create and activate a virtual environment (recommended):
# Windows
python -m venv venv
venv\Scripts\activate

# Linux/Mac
python -m venv venv
source venv/bin/activate
  1. Install required packages:
pip install -r requirements.txt

Configuration

  1. Copy the example environment file:
cp .env.example .env
  1. Edit .env file with your ServiceNow instance details:
SERVICENOW_INSTANCE=your-instance.service-now.com
SERVICENOW_USERNAME=your-username
SERVICENOW_PASSWORD=your-password
# Optional: Specify knowledge bases to extract (comma-separated)
SERVICENOW_KNOWLEDGE_BASES=IT,HR and Benefits

Usage

Run the script:

python extract-articles.py

The script will:

  1. Connect to your ServiceNow instance
  2. Extract specified knowledge bases (or all if none specified)
  3. Create an 'articles' folder in the script directory
  4. Save all articles as markdown files with metadata

The output structure will be:

articles/
├── IT/
│   ├── Security/
│   │   └── What-is-Spam.md
│   └── General/
│       └── About-Windows-10.md
└── HR/
    └── Benefits/
        └── Employee-Benefits.md

About

Extracts knowledge base articles from a ServiceNow instance and converts them to markdown format for easy reading and processing.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages