Giter Club home page Giter Club logo

butils's Introduction

butils

This is package of my python utils useful in debugging or for performing other tasks.

Installation

Normal:

pip install https://github.com/bunyk/butils/archive/master.zip

Development-mode: clone this repository somewhere, and then inside it's directory run:

python setup.py develop

Contents

  • butils.config_parser.config_to_dict(filename) - read config file and return it content as dictionary of dictionaries.
  • butils.whereis(object) - return location of object in code.
  • butils.from_where_called() - returns location in code from where function which calles this is called
  • butils.add_watched_attribute(name, watch_get=False) - when called in class (for example add_watched_attribute('name')) - instances of that class will log every change to the attribute. And log every access if watch_get is True.
  • butils.watch_for_output(condition=lambda x: True, stream='stdout') - log location in code where some output is performed.
  • butils.bpython_once() - First call starts bpython interactive session. Second - stops program`
  • butils.func_to_dict - converts function of one hashable argument to dictionary-like object which "contains" all it returning values.
  • butils.pprint - pprint values wrapped into frame. Also return first passed value unchanged (useful when debugging expressions).
  • butils.decorators.cached_for(seconds) - decorator which caches function results for seconds number of seconds.

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.