Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thesethrose/servicenow-kb-extractor
Extracts knowledge base articles from a ServiceNow instance and converts them to markdown format for easy reading and processing.
https://github.com/thesethrose/servicenow-kb-extractor
nowassist servicenow sndevs
Last synced: about 2 months ago
JSON representation
Extracts knowledge base articles from a ServiceNow instance and converts them to markdown format for easy reading and processing.
- Host: GitHub
- URL: https://github.com/thesethrose/servicenow-kb-extractor
- Owner: TheSethRose
- Created: 2024-11-20T18:13:03.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-11-22T16:22:00.000Z (about 2 months ago)
- Last Synced: 2024-11-22T17:19:23.605Z (about 2 months ago)
- Topics: nowassist, servicenow, sndevs
- Language: Python
- Homepage: https://www.sethrose.dev
- Size: 83 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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:
```bash
git clone
cd servicenow-kb-extractor
```2. Create and activate a virtual environment (recommended):
```bash
# Windows
python -m venv venv
venv\Scripts\activate# Linux/Mac
python -m venv venv
source venv/bin/activate
```3. Install required packages:
```bash
pip install -r requirements.txt
```## Configuration
1. Copy the example environment file:
```bash
cp .env.example .env
```2. Edit `.env` file with your ServiceNow instance details:
```ini
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:
```bash
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 metadataThe output structure will be:
```
articles/
├── IT/
│ ├── Security/
│ │ └── What-is-Spam.md
│ └── General/
│ └── About-Windows-10.md
└── HR/
└── Benefits/
└── Employee-Benefits.md
```