Skip to main content

Ratchet.io generic python library

Project description

pyratchet is a generic library for reporting exceptions and other messages to Ratchet.io:

import ratchet, sys
ratchet.init('YOUR_ACCESS_TOKEN', 'production')  # access_token, environment

try:
    main_app_loop()
except IOError:
    ratchet.report_message('Got an IOError in the main loop', 'warning')
except:
    # catch-all
    ratchet.report_exc_info(sys.exc_info())

Requirements

pyratchet requires:

  • Python 2.6 or 2.7

  • requests 0.12+

  • a Ratchet.io account

Installation

Install using pip:

pip install ratchet

Configuration

Somewhere in your initialization code, call ratchet.init() with your access_token:

ratchet.init('YOUR_ACCESS_TOKEN_HERE', environment='production')

Other options can be passed as keyword arguments. See the reference below for all options.

Usage

Call pyratchet.report_exc_info() to report an exception, or pyratchet.report_message() to report an arbitrary string message. See the docstrings for more info.

Configuration reference

access_token

Access token from your Ratchet.io project

handler

One of:

  • blocking – runs in main thread

  • thread – spawns a new thread

default: thread

environment

Environment name. Any string up to 255 chars is OK. For best results, use “production” for your production environment.

root

Absolute path to the root of your application, not including the final /.

branch

Name of the checked-out branch.

default: master

endpoint

URL items are posted to.

default: https://submit.ratchet.io/api/1/item/

Contributing

Contributions are welcome. The project is hosted on github at http://github.com/ratchetio/pyratchet

Additional Help

If you have any questions, feedback, etc., drop us a line at support@ratchet.io

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

ratchet-0.1.10.tar.gz (6.0 kB view details)

Uploaded Source

File details

Details for the file ratchet-0.1.10.tar.gz.

File metadata

  • Download URL: ratchet-0.1.10.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ratchet-0.1.10.tar.gz
Algorithm Hash digest
SHA256 410b3cb40f0cca0af59ac83a0c4fa8ba12e0d01774beffac29a7a939c8aef19a
MD5 28f289d1d2cda1a5c509df0dde071145
BLAKE2b-256 0f5d461e2b7e7d58bd71a3776cb235131713b684b600b0edfe58ed7a70722c3c

See more details on using hashes here.

Supported by

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