Zaraciccio's Library for Python
Project description
Zaraciccio's Library for Python
Installation
pip install Zaraciccio
Components
The SQL
Module helps you to connect to a SQLite, MySQL or PostgreSQL database.
To initialize it:
from Zaraciccio import SQL
# SQLite
db = SQL("sqlite:///database.db")
# MySQL
db = SQL("mysql://mysql@localhost/database")
# PostgreSQL
db = SQL("postgresql://postgresql@localhost/database")
The input
module contains three functions:
input_int(prompt)
, via wich you can prompt the user for an integer. If the user doesn't input an integer, is prompted to retry.input_float(prompt)
, via wich you can prompt the user for a floating point value. If the user doesn't input a floating point value, is prompted to retryinput_string(prompt)
, via wich you can prompt the user for a string.
The printer
module prints emphatised text.
An automatic \n
is added at the end of every row. Is possible to pass many arguments, wich will be printed separaed by a space.
To initialize it:
from Zaraciccio import printer
p = printer(text="black", style="italic", background="white")
p.print("Foo", "Bar", "Baz")
The locales
module formats values as an user-specified locale
from Zaraciccio import usd, eur, ?, locale
value = "1234.123"
precision = 3
l = locale(value, precision=precision)
print(usd(value, precision=precision))
print(eur(value, precision=precision))
print(gbp(value, precision=precision))
print(l.toUSD())
print(l.toEUR())
print(l.toGBP())
Development
Set up a Python virtual environment.
On Linux/MacOS:
python -m venv venv
source ./venv/bin/activate
On Windows:
py -3 -m venv venv
.\venv\Scripts\activate
Install required packages
pip install logging termcolor functools flask sqlalchemy sqlparse datetime
Please read the LICENSE file before using this software.
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
Zaraciccio-0.1.1.tar.gz
(9.1 kB
view hashes)
Built Distribution
Close
Hashes for Zaraciccio-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a33458ec02ccb7ff693933d83b63961d4bd3757cb5a0010813825ddba5a2acfe |
|
MD5 | 52c8efe4407bd24b918f0fb1c09296f6 |
|
BLAKE2b-256 | 18f04cbb340a1b86e8b2171721c3742e7a56110777c6928d16efc8eafeb0e845 |