My python libs to handle common tasks
Find a file
Benjamin Renard da63f533be
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
Abstract common DB methods in mysql.db.DB class and use it as base to implement PgDB, OracleDB and MyDB
2023-01-07 02:19:18 +01:00
docker Add the Dockerfile to build the docker brenard/mylib:dev-master image 2023-01-03 00:35:22 +01:00
mylib Abstract common DB methods in mysql.db.DB class and use it as base to implement PgDB, OracleDB and MyDB 2023-01-07 02:19:18 +01:00
tests Abstract common DB methods in mysql.db.DB class and use it as base to implement PgDB, OracleDB and MyDB 2023-01-07 02:19:18 +01:00
.gitignore Add build package and Woodpecker CI stuff 2022-04-27 17:12:00 +02:00
.pylintrc Code cleaning 2023-01-06 19:38:32 +01:00
.woodpecker.yml CI: fix path of deb files in publish-apt job 2022-08-02 01:42:04 +02:00
build.sh CI: fix release notes file path 2022-08-02 01:37:37 +02:00
HashMap.py Fix indents 2018-12-12 17:23:27 +01:00
README.md Add doc about pip install method 2023-01-06 19:38:39 +01:00
setup.cfg Code cleaning 2022-01-20 19:14:16 +01:00
setup.py CI now run pylint & flake8 2023-01-06 22:18:46 +01:00
tests.sh CI now run pylint & flake8 2023-01-06 22:18:46 +01:00

Python MyLib

Just a set of helpers small libs to make common tasks easier in my script development.

status-badge

Requirements

apt install \
    build-essential \
    python3 \
    python3-dev

# For LDAP:
apt install libldap2-dev libsasl2-dev

# For Config:
apt install pkg-config libsystemd-dev

# For PgSQL:
apt install libpq-dev

# For MySQL:
apt install libmariadb-dev

Installation

Using pip

Just run pip install git+https://gitea.zionetrix.net/bn8/python-mylib.git

From source

Just run python setup.py install

Note: This project could previously use as independent python files (not as module). This old version is keep in legacy git branch (not maintained).

Include libs

  • mylib.email.EmailClient: An email client to forge (eventually using template) and send email via a SMTP server
  • mylib.ldap.LdapServer: A small lib to make requesting LDAP server easier. It's also provide some helper functions to deal with LDAP date string.
  • mylib.mysql.MyDB: An extra small lib to remember me how to interact with MySQL/MariaDB database
  • mylib.pgsql.PgDB: An small lib to remember me how to interact with PostgreSQL database. Warning: The insert/update/delete/select methods demonstrate how to forge raw SQL request, but it's a bad idea: Prefer using prepared query.
  • mylib.opening_hours: A set of helper functions to deal with french opening hours (including normal opening hours, exceptional closure and nonworking public holidays).
  • mylib.pbar.Pbar: A small lib for progress bar
  • mylib.report.Report: A small lib to implement logging based email report send at exit

To know how to use these libs, you can take a look on mylib.scripts content or in tests directory.

Copyright (c) 2013-2021 Benjamin Renard brenard@zionetrix.net

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.