Skip to main content

HomeSetup python library

Project description

HomeSetup Python Library - HSPyLib

Your mature python application

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:

from hspylib.modules.cli.icons.font_awesome.dashboard_icons import DashboardIcons
from hspylib.modules.cli.icons.font_awesome.form_icons import FormIcons
from hspylib.modules.cli.tui.extra.mdashboard.mdashboard import MenuDashBoard, mdashboard

if __name__ == '__main__':
  # @formatter:off
  dashboard_items = MenuDashBoard.builder() \
      .item() \
          .icon(FormIcons.PLUS) \
          .tooltip('Add something') \
          .on_trigger(lambda: print('Add')) \
          .build() \
      .item() \
          .icon(FormIcons.MINUS) \
          .tooltip('Remove something') \
          .on_trigger(lambda: print('Del')) \
          .build() \
      .item() \
          .icon(FormIcons.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

from hspylib.modules.cli.tui.extra.minput.input_validator import InputValidator
from hspylib.modules.cli.tui.extra.minput.minput import MenuInput, minput

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

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hspylib-0.11.30.tar.gz (84.2 kB view details)

Uploaded Source

Built Distribution

hspylib-0.11.30-py3-none-any.whl (152.1 kB view details)

Uploaded Python 3

File details

Details for the file hspylib-0.11.30.tar.gz.

File metadata

  • Download URL: hspylib-0.11.30.tar.gz
  • Upload date:
  • Size: 84.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for hspylib-0.11.30.tar.gz
Algorithm Hash digest
SHA256 b53c7cb127df0e554fcf3aaf5aad8648112d41ac1c6be8f9dc15ca903f874e72
MD5 cda130becb70aa771972111c0903accb
BLAKE2b-256 7330d41c4694a69f6eaf1e860d38112f4cb9f8661612724a9c594e59cbe1350c

See more details on using hashes here.

File details

Details for the file hspylib-0.11.30-py3-none-any.whl.

File metadata

  • Download URL: hspylib-0.11.30-py3-none-any.whl
  • Upload date:
  • Size: 152.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for hspylib-0.11.30-py3-none-any.whl
Algorithm Hash digest
SHA256 e3ca12f4d42a10fc58b452c09554b40605f9c33f8c8b1468ce15b83f04f2b1c7
MD5 6e990cf2a4414a3f7dc1a8f2ad63ce70
BLAKE2b-256 2711335c2399ecf4ff574d059a60f392967cdf1494068ddda728ad8ea385f2e4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page