Skip to main content

Pysnow extension for Flask

Project description

https://coveralls.io/repos/github/rbw0/flask-snow/badge.svg?branch=master https://travis-ci.org/rbw0/flask-snow.svg?branch=master https://badge.fury.io/py/flask-snow.svg https://img.shields.io/badge/License-MIT-green.svg

flask-snow

Easily create apps on top of the ServiceNow REST API.

Documentation

The documentation can be found here

Installation

$ pip install flask-snow

Usage

Minimal example.

Reads config, sets up the snow extension and creates a route at /incidents, returning a single incident by number.

from flask import Flask, request, jsonify
from flask_snow import Snow

app = Flask(__name__)
app.config.from_object('settings')

snow = Snow(app)

@app.route('/incidents/<number>')
def incident(number):
    incident = snow.resource(api_path='/table/incident')
    data = incident.get(query={'number': number}).one()
    return jsonify(data)

if __name__ == '__main__':
    app.run()

Name it server.py and run with python server.py

Check out the /examples for more!

Compatibility

  • Python 2 and 3

  • Flask > 0.9

Author

Created by Robert Wikman <rbw@vault13.org> in 2018

JetBrains

Thank you Jetbrains for creating pycharm and for providing me with free licenses

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

flask-snow-0.2.4.tar.gz (4.3 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page