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
Hospitality app for ERPNext to manage hotels & restaurants.

Hospitality ERPNext Hospitality module is designed to handle workflows for Hotels and Restaurants. Manage Restaurants The Restaurant module in ERPNext

Frappe 19 Dec 26, 2022
A place where one-off ideas/partial projects can live comfortably

A place to post ideas, partial projects, or anything else that doesn't necessarily warrant its own repo, from my mind to the web.

Carson Scott 2 Feb 25, 2022
Repo created for the purpose of adding any kind of programs and projects

Programs and Project Repository A repository for adding programs and projects of any kind starting from beginners level to expert ones Contributing to

Unicorn Dev Community 3 Nov 02, 2022
A command line interface tool converting starknet warp transpiled outputs into readable cairo contracts.

warp-to-cairo warp-to-cairo is a simple tool converting starknet warp outputs (NethermindEth/warp) outputs into readable cairo contracts. The warp out

Michael K 5 Jun 10, 2022
Мой первый калькулятор!!!!!!

my_first_calculator Первый калькулятор созданный мною на питоне Версия калькулятора: 0.0.4 Как скачать? TERMUX Для скрипта нужен питон, скачиваем pkg

Lesha Russkiyov 2 Dec 29, 2021
This is an online course where you can learn and master the skill of low-level performance analysis and tuning.

Performance Ninja Class This is an online course where you can learn to find and fix low-level performance issues, for example CPU cache misses and br

Denis Bakhvalov 1.2k Dec 30, 2022
Simple yet flexible natural sorting in Python.

natsort Simple yet flexible natural sorting in Python. Source Code: https://github.com/SethMMorton/natsort Downloads: https://pypi.org/project/natsort

Seth Morton 712 Dec 23, 2022
A simple and easy to use Python's PIP configuration manager, similar to the Arch Linux's Java manager.

PIPCONF - The PIP configuration manager If you need to manage multiple configurations containing indexes and trusted hosts for PIP, this project was m

João Paulo Carvalho 11 Nov 30, 2022
Python DSL for writing PDDL

PDDL in Python – Python DSL for writing a PDDL A minimal implementation of a DSL which allows people to write PDDL in python. Based on parsing python’

International Business Machines 21 Nov 22, 2022
Source-o-grapher is a tool built with the aim to investigate software resilience aspects of Open Source Software (OSS) projects.

Source-o-grapher is a tool built with the aim to investigate software resilience aspects of Open Source Software (OSS) projects.

Aristotle University 5 Jun 28, 2022
This code extracts line width of phonons from specular energy density (SED) calculated with LAMMPS.

This code extracts line width of phonons from specular energy density (SED) calculated with LAMMPS.

Masato Ohnishi 3 Jun 15, 2022
Listen Surah, prepare for next and Endless life...

Al-Quran In this repository, I have linked up all Surah with Arabic-Bangla Audio From Youtube. So, you just need to choose and listen. and the ( surah

SpiderX 1 Sep 30, 2022
Voldemort's Python import helper

importmagician Voldemort's Python import helper pip install importmagician Import from uninstalled Python directories Say you have a directory (relat

Zhengyang Feng 4 Mar 09, 2022
Rename and categorize your DMOJ solutions

DMOJ Downloader What is this for? DMOJ lets you download the code for all your solutions, however the files are just named as numbers

Evan Wild 1 Dec 04, 2022
Regular Expressions - Use regular expressions to detect date format

A list of all the resources used https://regex101.com/ - To test regex https://w

Ravika Nagpal 1 Jan 04, 2022
Install packages with pip as if you were in the past!

A PyPI time machine Do you wish you could just install packages with pip as if you were at some fixed date in the past? If so, the PyPI time machine i

Thomas Robitaille 51 Jan 09, 2023
Hartree-Fock Workshop for the Han-sur-Lesse Winterschool of 2021

Hartree-Fock course for the Han-sur-Lesse Winterschool of 2021 Requirements For going through these exercises, please install the Anaconda suite. Next

Ivo Filot 2 Nov 16, 2022
In the works, creating a new Chess Board and way to Play...

sWJz4Chess date started on github.com 11-13-2021 In the works, creating a new Chess Board and way to Play... starting to write this in Pygame, any ind

Shawn 2 Nov 18, 2021
Rock 💎 Paper 📝 Scissors ✂️ Lizard 🦎 Spock 🖖

Rock 💎 Paper 📝 Scissors ✂️ Lizard 🦎 Spock 🖖 If you’ve seen The Big Bang Theory, you’ve heard of a game called “Rock, Paper, Scissors, Lizard, Spoc

AmirHossein Mohammadi 16 Jun 19, 2022
Weakly-Divisable - Takes an interger and seee if it is weakly divisible by seven

Weakly Divisble Project by Diana Arce-Hernandez, Ryan McAlpine, and Rommel Ravan

Diana Arce-Hernandez 1 Jan 12, 2022