mblibs
Fast tools for programming
installation
$ pip install mblibs
Usage for settings
# Using settings
from mblibs.fast import FastSettings
settings = FastSettings("/path/to/yaml_or_json")
value = settings.get("/path/to/key", "default_value")
integer = settings.getInt("/path/to/keyInt", 12)
# => 18/07/2018
date = settings.getWithDateFormat("/path/to/current_date", "{dd}/{mm}/{yyyy}")
# => 19/07/2018
date = settings.getWithDateFormat("/path/to/tomorrow_date"
"{tomorrow_dd}/{tomorrow_mm}/{tomorrow_yyyy}")
# => 17/07/2018
date = settings.getWithDateFormat("/path/to/yesterday_date",
"{yesterday_dd}/{yesterday_mm}/{yesterday_yyyy}")
# sample
{'data': [{'ident': 'name1', 'rows': [{'key': 1}, {'key': 2}]},
{'ident': 'name2', 'rows': [{'key': 3}, {'key': 4}]}]}
settings.get("/data[1]/rows[0]/key") => 3
settings.get("/data[0]/rows") => [{'key': 1}, {'key': 2}]
Usage for email
# Using email object
from mblibs.fast import FastEmail
# email body
body = """
<p>Lorem <em><strong>ipsum</strong></em> dolor !</p>
<p>Ceci est un message de test de l'application</p>
<img class="picture" src="cid:graphic1" alt="Graphique en pièce jointe" />
<p>Merci pour le graphique <br />
Mick</p>
<img class="picture" src="cid:graphic2" alt="Graphique en pièce jointe" />
"""
# init email object
mailer = FastEmail()
mailer.mail_from = settings.get("/smtp/mail_from")
mailer.mail_subject = "A subject for the mail."
mailer.mail_text = 'Merci de lire le message depuis un lecteur acceptant le HTML.'
mailer.mail_html = body
mailer.smtp_host = "localhost"
mailer.smtp_port = 25
mailer.smtp_tls = False
mailer.smtp_login = ""
mailer.smtp_password = ""
# send email
To = ["mail1@mail.mx", "mail2@mail.mx"]
Cc = ["mail3@mail.mx"]
Bcc = ["mail4@mail.mx", "mail5@mail.mx"]
filename = "./ridev.png"
ret = mailer.send_mail(to=To, cc=Cc, bcc=Bcc, attachfiles=[filename],
embeddedimages_tag="graphic",
embeddedimages=["./python.png", filename])
Metadata
Release files for mblibs 1.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mblibs-1.1.3.tar.gz | 13.6 kB | Without provenance | Details for mblibs-1.1.3.tar.gz |
Release files / mblibs-1.1.3.tar.gz
| Download URL | mblibs-1.1.3.tar.gz |
|---|---|
| Size | 13.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f74a14e30d65019ad5c6f78823be99a3117676683f5198e86d11f929f9220b1c
|
|
BLAKE2b-256 checksum How to use checksums |
e2ab18437cbdd15a9b2bc39bb04b41f05a3a33219b76bb2f14dbdf46cdee3069
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.5
|
Security for mblibs 1.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.