Skip to main content

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

Checkout then:

python setup.py install

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://vetsin.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) TODO
  • get_class_display_value()
  • get_record_class_name()
  • get_unique_value()
  • is_valid() TODO
  • is_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 Applicable
  • get_ED() Not Applicable
  • get_label() Not Applicable
  • get_last_error_message() Not Applicable
  • set_workflow(enable) Not Possible
  • operation() Not Applicable
  • set_abort_action() Not Applicable
  • is_valid_field() Not Possible
  • is_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


Download files

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

Source Distribution

pysnc-1.0.2.tar.gz (19.3 kB view details)

Uploaded Source

Built Distributions

pysnc-1.0.2-py3.7.egg (38.1 kB view details)

Uploaded Source

pysnc-1.0.2-py2.py3-none-any.whl (16.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pysnc-1.0.2.tar.gz.

File metadata

  • Download URL: pysnc-1.0.2.tar.gz
  • Upload date:
  • Size: 19.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.2

File hashes

Hashes for pysnc-1.0.2.tar.gz
Algorithm Hash digest
SHA256 9cbc0f226f695b7cd12dca42e77dca0b8faa219e5d1b300a2068b58d42948347
MD5 5d73c93a2f0747b66bd56860e847bd4f
BLAKE2b-256 a3a5a5d2d3961d66456cf81dc48af52325be01e4a620d75095b20e3ad95181e7

See more details on using hashes here.

File details

Details for the file pysnc-1.0.2-py3.7.egg.

File metadata

  • Download URL: pysnc-1.0.2-py3.7.egg
  • Upload date:
  • Size: 38.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.2

File hashes

Hashes for pysnc-1.0.2-py3.7.egg
Algorithm Hash digest
SHA256 114e1c62c9c816efc437463b5dbb2d6f45d9c006ed767e3eb0d5090a3e35ea90
MD5 64e3a1fdaa430467e21f90bae655da9a
BLAKE2b-256 644a89e37ad9a45833feb825288c65987ed25670e0639552b082b07fac2f2cc6

See more details on using hashes here.

File details

Details for the file pysnc-1.0.2-py2.py3-none-any.whl.

File metadata

  • Download URL: pysnc-1.0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.2

File hashes

Hashes for pysnc-1.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3c501fe6b2d99923c2b58e287f1c1ca539af697de1c3ce10a47ca86986ee5fde
MD5 1bd08fde5db4feb1bd1f3e79c093cd6f
BLAKE2b-256 f998eb53dbffa1a1f78e26af02983ce3e552ac7080092bf8dfd36824397e9c00

See more details on using hashes here.

Supported by

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