Python SNC (REST) API
Project description
ServiceNow Python API
What: PySnc is a python interface for the ServiceNow and the Table API. It is designed to mimic the familiar GlideRecord interface you know with pythonic support where applicable.
Why: Spawned from the desire to interact with ServiceNow data in a familiar and consistent manner
Install
pip install pysnc
Quick Start
from pysnc import ServiceNowClient
client = ServiceNowClient('https://dev0000.service-now.com', ('integration.user', password))
gr = client.GlideRecord('sys_user')
gr.add_query('user_name', 'admin')
gr.query()
for r in gr:
print(r.sys_id)
Or you can more traditionally:
while gr.next():
print(gr.sys_id);
It is recommended you use OAuth, however:
from pysnc import ServiceNowClient, ServiceNowOAuth2
client = ServiceNowClient('dev0000', ServiceNowOAuth2('integration.user', password))
Documentation
Full documentation currently available at https://servicenow.github.io/PySNC/
Or build them yourself:
cd docs && make html
Development Notes
The following functions are not (yet?) supported:
choose_window(first_row, last_row, force_count=True)
TODOget_class_display_value()
get_record_class_name()
get_unique_value()
is_valid()
TODOis_valid_record()
new_record()
set_new_guid_value(guid)
update_multiple()
TODO_next()
_query()
The following will not be implemented:
get_attribute(field_name)
Not Applicableget_ED()
Not Applicableget_label()
Not Applicableget_last_error_message()
Not Applicableset_workflow(enable)
Not Possibleoperation()
Not Applicableset_abort_action()
Not Applicableis_valid_field()
Not Possibleis_action_aborted()
Not Applicable
Further Reading
See the documentation.
Feature Wants and TODO
- GlideAggregate support (
/api/now/stats/{tableName}
)
And we want to:
- Improve documentation
- Refactor session abstraction
- Improve Attachment OO
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
Built Distribution
File details
Details for the file pysnc-1.0.6.tar.gz
.
File metadata
- Download URL: pysnc-1.0.6.tar.gz
- Upload date:
- Size: 21.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b23a4f5d288b81f028f8e0723ad021083f2e72a7b2960d269e7e57a3a707e98e |
|
MD5 | a508af79db46d49cba6771d99378f69f |
|
BLAKE2b-256 | f70ed3432e82298f1b17aeb44592e2f3348fc5d6b5f43d7eb34790d305a75eb5 |
File details
Details for the file pysnc-1.0.6-py2.py3-none-any.whl
.
File metadata
- Download URL: pysnc-1.0.6-py2.py3-none-any.whl
- Upload date:
- Size: 17.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d08072b7ab4cdd1e75be3f2c91642660d859133b566a30fcd1d328ca460bd3cb |
|
MD5 | 8e391a476c44e416c2beee91414c9f23 |
|
BLAKE2b-256 | 6bb66e6d50c32e86a3a8471117ed15cc197e21f6b569f0080e2792bfe5648c29 |