Git Product home page Git Product logo

reusable's Introduction

reusable

Python reusable code, utility functions and time saver.

Overview

Python reusable library contains a handful of reusable functions and utility class

Install

pip install -U reusable

Usage

Loading Configuration files as class attributes

from reusable import AppConfig
config=AppConfig('config.json')
mykey=config.my_key

Load config file accessible via class methods

from reusable import Config
config=Config('config.json')
mykey=config.get('my_key')

Available functions

  • random_string() : return a random string of specified length and character set
  • print_table() : prints a data table provided as list
  • print_time_taken [decorator] : prints the time of execution of a parameter
  • groupby_count() : groups a given list according the number of times it appears
  • generate_all_datetime_regex : generate the regex for all possible datetime
  • download_file : download a file from the given url
  • is_python3() : check if the interpreter is python v3
  • is_python_above_or_equal() : check if the interpreter is above or equal to the given version
  • check_modules_installed() : check if the given modules are installed
  • random_useragent() : return a random useragent
  • is_valid_json() : checks if given string is valid json
  • headline() : return a formatted string in headline style
  • splash() : return a string with splash style
  • multiline_input() : takes multiline user input
  • get_datadir() : returns the app data folder
  • get_windows_appdata_dir() : similar to get_datadir() but windows only
  • slugify() : Makes slug text from given vlaue
  • float_range() : Returns a iterable of floating range

reusable's People

Contributors

ohidurbappy avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

reusable's Issues

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.