https://github.com/servicenow/pysnc
Python API for ServiceNow
https://github.com/servicenow/pysnc
Last synced: 5 months ago
JSON representation
Python API for ServiceNow
- Host: GitHub
- URL: https://github.com/servicenow/pysnc
- Owner: ServiceNow
- License: mit
- Created: 2020-07-16T16:22:30.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-09-12T19:20:36.000Z (6 months ago)
- Last Synced: 2025-09-25T15:57:06.795Z (5 months ago)
- Language: Python
- Size: 1000 KB
- Stars: 110
- Watchers: 7
- Forks: 32
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```
If you also want to install the asyncio support, you can run:
```
pip install pysnc[asyncio]
```
## Quick Start
```python
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)
```
## Documentation
Full documentation currently available at [https://servicenow.github.io/PySNC/](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)` TODO
* `get_class_display_value()`
* `get_record_class_name()`
* `is_valid()` TODO
* `is_valid_record()`
* `new_record()`
* `_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
# Feature Wants and TODO
* GlideAggregate support (`/api/now/stats/{tableName}`)
And we want to:
* Improve documentation