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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file servicenow-utils-0.21.tar.gz.
File metadata
- Download URL: servicenow-utils-0.21.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a8b91f7d5a12a8a7f8e4cd1c0d9886093186c9962be3f8faaaef9cfb84e25c9
|
|
| MD5 |
2b2a5cfd8ba32775ee8cef1b727748a9
|
|
| BLAKE2b-256 |
954942cb6323ae05adc84c98502754f0ba16093f907e4d6f63562c0c840457ef
|