My python libs to handle common tasks
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Benjamin Renard 85d34b7b9a Config: allow access/setting config options as with a dict 3 weeks ago
mylib Config: allow access/setting config options as with a dict 3 weeks ago
tests tests: fix oracle test_truncate 7 months ago
.gitignore Add build package and Woodpecker CI stuff 7 months ago
.pylintrc Code cleaning 2 years ago
.woodpecker.yml CI: fix path of deb files in publish-apt job 4 months ago Fix indents 4 years ago README: add CI status badge 7 months ago CI: fix release notes file path 4 months ago
setup.cfg Code cleaning 10 months ago Add SFTP client 5 months ago Add again some quiet args to avoid pipeline step logs to exceed max size 7 months ago

Python MyLib

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



apt install \
    build-essential \
    python3 \

# 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


Just run python 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

  • 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
  • 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


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.