Skip to main content

oiyshTerminal (otpips) - ot_my_libs

Set of function to speed up things like:

  • ArgsParse - to parse argument pass to app returns json

  • MyCalculate - trigonometry and other maths

  • db_helper - sqlite3 helper

  • myFastPlot - fast plot data with kivy

  • TimeHelper - to do operation on time

  • myLoger - logging unifide

  • XMLHelper

  • FileActions - file/dirs/path operations helper

  • myMqttClient

  • mysql_helper - mysql helper

  • PlugsHelper - to help with plugins loading and exploration

  • example - use case of:

    • benchmarking - from TimeHelper

    • sqlite3 - from db_helper

    important - some of subs will want more dependencies then default so look for logs if there is any pip missing ( myFastPlot )

check example

In directory of library in my case is /usr/lib/python3.8/site-packages

python3 ot_my_libs/example.py

this will run example use of bencharking uning ot_my_libs.TimeHelper and sqlite3 using ot_my_libs.db_helper from the example to get you going :)

or

xdocs - more in depth

example

TimeHelper use case as benchmarking tool

from ot_my_libs.TimeHelper import TimeHelper as thd
import time

def benchmarkTimer():
    th = thd()
    bKey = th.benStart()
    print("making test run ...")
    time.sleep(1)
    th.benDone(
        bKey,
        f"Result of benStart / benDone [run at:{th.getNiceShortDate()}]",
        printIt=True
        )

db_helper use case as fast sqlite3 init_table and CRUDish

from ot_my_libs.db_helper import db_helper as dbh

class mdb ( dbh ):
    ## set your structure of db / table
    def set_struct(self):
        self.struct = {
            'tableA' : { # your table name
                      'lat':     "float", # field 1 - name: lat type: float
                      'lon':     "float", # field 2 - name: lat type: float
                      }
            }

  db = mdb('/tmp/mdbTest1.db')

  # yes no initing strate to insert or ...
  print("inserting ....")
  insertRecordId = db.insert('tableA', {"lat":1.1,"lon":1.11} )

  print("select tableA ...")
  resA = db.select('tableA')
  print( resA )

  db.insert( 'tableA', {"lat":2.1,"lon":1.1} )
  print("select id,lat,lon from tableA where id=2 .....")
  # yes `id` column autoincremental is added automaticly
  resB = db.select('tableA','id,lat,lon', 'id=2')
  print( resB )

  print("delete all ...")
  db.query('delete from tableA where 1')
  print("after delete ... select tableA")
  resC = db.select('tableA')
  print( resC )

development of package - base line

In directory of project to deploy tree ot_my_libs

ot_my_libs
├── __init__.py
├── ArgsParse.py
├── example.py
├── db_helper.py
├── FileActions.py
├── MyCalculate.py
├── myFastPlot.py
├── myLoger.py
├── myMqttClient.py
├── mysql_helper.py
├── TimeHelper.py
├── PlugsHelper.py
├── PlugsHelperTest_plugXXX_a.py
└── XMLHelper.py

uninstalling it

pip3 uninstall ot_my_libs

TODO

  • more examples
  • more def xdoc descriptions

change log

  • 0.0.14

    • PlugsHelper in examples
    • Refine PlugsHelper can do custom filter and return preinit object if set so
  • 0.0.12

    • PlugsHelper
  • 0.0.11

    • fix some README errors parsing and ...
  • 0.0.10

    • ArgsParse to parse argument comming at start of app
    • myLoger have more colors to select and new defColor argument
    • add change log in README :)

If you see that this makes sense send me a ☕ | Master repository | About SvOiysh

Metadata

Release files for ot-my-libs 0.0.14

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ot-my-libs 0.0.14
File Size Uploaded
ot_my_libs-0.0.14.tar.gz 20.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ot-my-libs 0.0.14
File Interpreter ABI Platform
ot_my_libs-0.0.14-py3-none-any.whl Python 3 none any Details

Total release size: 43.1 kB

Release files / ot_my_libs-0.0.14.tar.gz

Download URL ot_my_libs-0.0.14.tar.gz
Size 20.3 kB
Tags Source
SHA-256 checksum
How to use checksums
560825bd4b739ba2e083d39461baffc3020b9fe606bc117d62a5244e05eb923d
BLAKE2b-256 checksum
How to use checksums
34ba373278bdb6d4b6058c4465965bd244072bd769164a08f8a7e72e5d2847fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.10

Release files / ot_my_libs-0.0.14-py3-none-any.whl

Download URL ot_my_libs-0.0.14-py3-none-any.whl
Size 22.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f19f182bb9c380014b3d4f62205f2069fec9517b8444b4bc7386979f193fec62
BLAKE2b-256 checksum
How to use checksums
7d7f0b2fc21216ba81943a51f8db70cee3773d680849f7972108b3acaf00971e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.0.14 This release

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page