Skip to main content

Asynchronous Python ServiceNow library

Project description

aiosnow: Asynchronous Python ServiceNow library

image image image image image

This is a simple and lightweight yet powerful and extensible library for interacting with ServiceNow that works with modern versions of Python and utilizes the stdlib asyncio library.

asyncio

In a nutshell, asyncio uses non-blocking sockets tracked by an event loop, and while adding some complexity, it allows for running large amounts of I/O operations simultaneously, and is typically a good choice for high-concurrency backend applications.

Scripting

The aiosnow library can, of course, be used in scripts - but requires an event loop to be created and coroutines to be written with the async/await syntax.

Example code

import asyncio

import aiosnow
from aiosnow.schemas.table import IncidentSchema as Incident

snow = aiosnow.Client("<instance>.service-now.com", basic_auth=("<username>", "<password>"))

async def main():
    # Make a TableModel object from the built-in Incident schema
    async with snow.get_table(Incident) as inc:
        # Get high-priority incidents
        for response in await inc.get(Incident.priority <= 3, limit=5):
            print(f"Number: {response['number']}, Priority: {response['priority'].text}")

asyncio.run(main())

Check out the examples directory for more.

Documentation

The aiosnow reference and more is available in the documentation.

Funding

The aiosnow code is permissively licensed, and can be incorporated into any type of application–commercial or otherwise–without costs or limitations. Its author believes it's in the commercial best-interest for users of the project to invest in its ongoing development.

Consider leaving a donation if you like this software, it will:

  • Directly contribute to faster releases, more features, and higher quality software.
  • Allow more time to be invested in documentation, issue triage, and community support.
  • Safeguard the future development of aiosnow.

Development status

The fundamental components (models, client code, error handling, documentation, etc) of the library is considered complete. However, automatic testing and real-world use is somewhat lacking, i.e. there are most likely bugs lurking about, and the software should be considered Alpha, shortly Beta.

Contributing

Check out the contributing guidelines if you want to help out with code or documentation.

Author

Robert Wikman <rbw@vault13.org>

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

aiosnow-0.4.2.tar.gz (22.9 kB view hashes)

Uploaded Source

Built Distribution

aiosnow-0.4.2-py3-none-any.whl (33.9 kB view hashes)

Uploaded Python 3

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