Skip to main content

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


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)

Uploaded Source

Built Distribution

Zaraciccio-0.1.1-py3-none-any.whl (9.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page