Skip to main content

A utility module for retrieving incidents from ServiceNow

Project description

ServiceNow Incident Retrieval Module

This module provides utilities to retrieve incidents from ServiceNow within a specified date range.

Features

  • Fetch incidents from ServiceNow based on a date range.
  • Breaks down the retrieval into intervals for efficient fetching.
  • Converts incident data into a Pandas DataFrame for easy data manipulation.

Installation

pip install servicenow-utils

Usage

First, ensure you have the necessary dependencies:

pip install pandas requests

Then, use the module as follows:

from servicenow_utils import get_incidents

# Define your ServiceNow connection details
url = "YOUR_SERVICE_NOW_URL"
endpoint = "YOUR_ENDPOINT"
user_name = "YOUR_USERNAME"
password = "YOUR_PASSWORD"

df = get_incidents(
    current_day='2023-04-01', 
    end_day='2023-04-30',
    url=url,
    endpoint=endpoint,
    user_name=user_name,
    password=password
)

Functions

day_plus_one(day: str) -> str

Increments the given day by one.

day_string_to_dt(day: str) -> datetime

Converts a string representation of a day into a datetime object.

get_incidents(current_day, end_day, url, endpoint, user_name, password, start_hour=0, hour_interval=8, count_limit=2000) -> pd.DataFrame

Fetches incidents from ServiceNow within the given date range and returns them as a Pandas DataFrame.

Contributing

If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

servicenow-utils-0.20.tar.gz (3.5 kB view details)

Uploaded Source

File details

Details for the file servicenow-utils-0.20.tar.gz.

File metadata

  • Download URL: servicenow-utils-0.20.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for servicenow-utils-0.20.tar.gz
Algorithm Hash digest
SHA256 31dcce6bcdd610e8afa568f1bc3da337933d7aba3bbd949eea3734f5fd29a0ff
MD5 9a2be647a8e1d03eb8155b0e2a0fd65f
BLAKE2b-256 b4efdbb6c7ba4a9b47278c309208cf56c12912b951a66d7d523c46fc991526d4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page