Coder Social home page Coder Social logo

smashi's Introduction

Smashi

Smashi is a python3 library with some useful utilities.

  • cmd.py - Running commands from python
  • copy.py - Copy recursively for e.g.
  • file.py - Some file manipulation routines
  • gui.py - Terminal whiptail gui for things like install scripts
  • log.py - Some basic logging
  • module.py - Load modules from script files
  • net.py - Get your host ip, check internet
  • password.py - Generate passwords
  • proxmox.py - Provision proxmox lxc containers

Howto install

Install via pip3 using this git repo

pip3 install git+https://[email protected]/charlmert/smashi.git@master#egg=smashi

Howto use

Running shell commands

import smashi.cmd
smashi.cmd.output('ls -1')
# example output: (0, 'assets\nbuild\ndist\nreadme.md\nsetup.py\nsmashi\nsmashi.egg-info\n', '')

# You can also tail command output
smashi.cmd.tail('ls -1')

Generating passwords

import smashi.password
print(smashi.password.generate())
# example output: kb637a9QZvKQ

Converting bytes to string Avoiding UnicodeDecodeError and UnicodeEncodeError exceptions

import smashi.str
smashi.str.bytesToString(b'hello\xe5hi')
# example output: "b'hello\\xe5hi'"

Building and packaging

If you would like to fork this package and build your own based off it

sudo python3 -m pip install --upgrade pip setuptools wheel
sudo python3 -m pip install tqdm
sudo python3 -m pip install --user --upgrade twine

To build

python3 setup.py bdist_wheel

smashi's People

Contributors

charlmert avatar

Watchers

 avatar James Cloos 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.