HSPyLib is a Python library that will elevate your experience to another level.

Overview

HomeSetup Python Library - HSPyLib

Your mature python application

Tests License Release PyPi GitHub Gitter Donate

HSPyLib is a Python library that will elevate your experience to another level. It relies on well known principles as SOLID, DRY (Don't Repeat Yourself), KISS (Keep It Simple, Stupid) and YAGNI (You Ain’t Gonna Need It). It provides many frameworks and facilities to help you create mature python3 applications "PYCSNBASS" (Python Code Should Not Be A Simple Script).

HSPyLib is a part of the HomeSetup project.

Highlights

  • Easy installation.
  • Manager application that provides a helper to scaffold you applications.
  • Widgets application that provides running built-in and custom widgets.
  • Enhanced TUI helpers and input methods, to elevate you terminal UI applications.
  • Crud framework to help with databases, repositories and services.
  • HTTP Request helpers.
  • Python3 application framework.
  • HSPyLib widgets framework.
  • Enable Properties and AppConfigs using various syntax's like .properties, .ini and .yaml.
  • Well tested code and often pylint clean.
  • Gradle build system with many extensions.

A menu select example:

from hspylib.modules.cli.tui.extra.mselect import mselect

if __name__ == '__main__':
    it = [f"Item-{n}" for n in range(1, 21)]
    sel = mselect(it, max_rows=10)
    print(str(sel))

MenuSelect

A menu choose example:

from hspylib.modules.cli.tui.extra.mchoose import mchoose

if __name__ == '__main__':
    it = [f"Item-{n}" for n in range(1, 21)]
    sel = mchoose(it, max_rows=10)
    print(str(sel))

MenuChoose

A Dashboard example:

if __name__ == '__main__':
# @formatter:off
dashboard_items = MenuDashBoard.builder() \
    .item() \
        .icon(DashboardIcons.PLUS) \
        .tooltip('Add something') \
        .on_trigger(lambda: print('Add')) \
        .build() \
    .item() \
        .icon(DashboardIcons.MINUS) \
        .tooltip('Remove something') \
        .on_trigger(lambda: print('Del')) \
        .build() \
    .item() \
        .icon(DashboardIcons.EDIT) \
        .tooltip('Edit something') \
        .on_trigger(lambda: print('Edit')) \
        .build() \
    .item() \
        .icon(DashboardIcons.LIST) \
        .tooltip('List everything') \
        .on_trigger(lambda: print('List')) \
        .build() \
    .item() \
        .icon(DashboardIcons.DATABASE) \
        .tooltip('Database console') \
        .on_trigger(lambda: print('Database')) \
        .build() \
    .item() \
        .icon(DashboardIcons.EXIT) \
        .tooltip('Exit application') \
        .on_trigger(lambda: print('Exit')) \
        .build() \
    .build()
# @formatter:on
result = mdashboard(dashboard_items, 4)

MenuDashboard

A form input example

if __name__ == '__main__':
# @formatter:off
form_fields = MenuInput.builder() \
    .field() \
        .label('letters') \
        .validator(InputValidator.letters()) \
        .build() \
    .field() \
        .label('word') \
        .validator(InputValidator.words()) \
        .build() \
    .field() \
        .label('number') \
        .validator(InputValidator.numbers()) \
        .min_max_length(1, 2) \
        .build() \
    .field() \
        .label('masked') \
        .itype('masked') \
        .value('|##::##::## @@') \
        .build() \
    .field() \
        .label('selectable') \
        .itype('select') \
        .value('one|two|three') \
        .build() \
    .field() \
        .label('checkbox') \
        .itype('checkbox') \
    .build() \
    .field() \
        .label('password') \
        .itype('password') \
        .validator(InputValidator.anything()) \
        .min_max_length(4, 8) \
        .build() \
    .field() \
        .label('read-only') \
        .access_type('read-only') \
        .value('READ-ONLY') \
        .build() \
    .build()
# @formatter:on
result = minput(form_fields)
print(result.__dict__)

MenuInput

And many other cool features like repositories, Qt and CRUD helpers, etc...

Table of contents

Installation

Requirements

Operating Systems

  • Darwin
    • High Sierra and higher
  • Linux
    • Ubuntu 16 and higher
    • CentOS 7 and higher
    • Fedora 31 and higher

You may want to install HSPyLib on other OS's and it will probably work, but there are no guarantees that it WILL ACTUALLY WORK.

Required software

The following software are required:

  • Git (To clone the github repository)
  • Gradle (To build the HSPyLib project)
  • instantclient-basiclite-macos (To use oracle database repositories)

There are some python dependencies, but they will be automatically downloaded when the build runs.

PyPi

To install HSPyLib from PyPi issue the command:

# python3 -m pip install hspylib

To upgrade HSPyLib use the command:

# python3 -m pip install hspylib --upgrade

GitHub

To clone HSPyLib into your local machine issue the command:

# git clone https://github.com/yorevs/hspylib.git

Documentation

TBD

Contact

You can contact us using our Gitter community or using our Reddit.

Support HSPyLib

You can support HSPyLib by donating or coding. Fell free to contact me for details. When contributing with code change please take a look at our guidelines and code of conduct.

paypal

Links

Owner
Hugo Saporetti Junior
Changing paradigms is the key for evolution.
Hugo Saporetti Junior
Antchain-MPC is a library of MPC (Multi-Parties Computation)

Antchain-MPC Antchain-MPC is a library of MPC (Multi-Parties Computation). It include Morse-STF: A tool for machine learning using MPC. Others: Commin

Alipay 37 Nov 22, 2022
This is a vscode extension with a Virtual Assistant that you can play with when you are bored or you need help..

VS Code Virtual Assistant This is a vscode extension with a Virtual Assistant that you can play with when you are bored or you need help. Its currentl

Soham Ghugare 6 Aug 22, 2021
This is collection of Managementsystem programs: Hospital Management, Student Managemen, etc

Contribute in this repository and help other students with their assignment by adding python scripts for various management system programs.

GDSC BVP DET - Navi Mumbai 3 Mar 20, 2022
Sequence clustering and database creation using mmseqs, from local fasta files

Sequence clustering and database creation using mmseqs, from local fasta files

Ana Julia Velez Rueda 3 Oct 27, 2022
A simple PID tuner and simulator.

PIDtuner-V0.1 PlantPy PID tuner version 0.1 Features Supports first order and ramp process models. Supports Proportional action on PV or error or a sp

3 Jun 23, 2022
Code needed for hybrid land cover change analysis for NASA IDS project

Documentation for the NASA IDS change analysis Poley 10/21/2021 Required python packages: whitebox numpy rasterio rasterio.mask os glob math itertools

Andrew Poley 2 Nov 12, 2021
A simple calculator made with tkinter.

Simple Calculator A simple calculator made with tkinter. Requirements None, only you need to have windows 😉 ...Enjoy! Installation Clone this reposit

Abhyush 2 Jan 11, 2022
Implements a polyglot REPL which supports multiple languages and shared meta-object protocol scope between REPLs.

MetaCall Polyglot REPL Description This repository implements a Polyglot REPL which shares the state of the meta-object protocol between the REPLs. Us

MetaCall 10 Dec 28, 2022
Code emulator plugin for IDA Pro

emu_ida Code emulator plugin for IDA Pro (v 0.0.6) The plugin is designed for simple data decryption and getting stack strings. Requirements Emulator

Andrey Zhdanov 11 Jul 06, 2022
A light library to build tiny websites

A light library to build tiny websites

BT.Q 1 Dec 23, 2021
Todo-backend - Todo backend with python

Todo-backend - Todo backend with python

Julio C. Diaz 1 Jan 07, 2022
A few of my adventures with Devito.

Devito-playbox A few of my adventures with Devito. This repository contains a few notebooks and scripts that will lead me in the road of learning this

Átila Saraiva Quintela Soares 1 Feb 08, 2022
Runtime inspection utilities for Python typing module

Typing Inspect The typing_inspect module defines experimental API for runtime inspection of types defined in the Python standard typing module. Works

Ivan Levkivskyi 284 Dec 29, 2022
Identify and annotate mutations from genome editing assays.

CRISPR-detector Here we propose our CRISPR-detector to facilitate the CRISPR-edited amplicon and whole genome sequencing data analysis, with functions

hlcas 2 Feb 20, 2022
RangDev Notepad App With Python

RangDev Notepad-App-With-Python Take down quick and speedy notes! This is a small project of a notepad app built with Tkinter and SQLite3. Database cr

rangga.alrasya 1 Dec 01, 2021
A multi purpose password managing and generating tool called Kyper.

Kyper A multi purpose password managing and generating tool called Kyper. Setup The setup for Kyper is fairly simple only involving the command python

Jan Dorian Poczekaj 1 Feb 05, 2022
A dog facts python module

A dog facts python module

Fayas Noushad 3 Nov 28, 2021
peace-performance (Rust) binding for python. To calculate star ratings and performance points for all osu! gamemodes

peace-performance-python Fast, To calculate star ratings and performance points for all osu! gamemodes peace-performance (Rust) binding for python bas

9 Sep 19, 2022
A program to generate random numbers b/w 0 to 10 using time

random-num-using-time A program to generate random numbers b/w 0 to 10 using time it uses python's in-built module datetime and an equation which retu

Atul Kushwaha 1 Oct 01, 2022
Blender addon that simplifies access to useful operators and adds missing functionality

Quick Menu is a Blender addon that simplifies common tasks Compatible with Blender 3.x.x Install through Edit - Preferences - Addons - Install... -

passivestar 94 Dec 27, 2022