Code Monkey home page Code Monkey logo

pyratchet's Introduction

pyratchet

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 [email protected]

pyratchet's People

Contributors

coryvirok avatar dmitry-mukhin avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.