Standart Library for elixs.dev
Project description
elixs.dev Standart Library
Librarys includes:
- Config File Loader
- MySQL interface
- Logger
- Color interface (based on color4console)
- SimpleArgParser
The library is public on GitHub and Licensed under GNU AGPLv3. Contact me via EMail: eliservices.server@gmail.com
Installation
pip install elixs
Version Note
The SimpleArgParser needs python 3.10 (included starting v0.1.3)! The other functions are the same in v0.1.1 which only requires python 3.8.
Usage
import elixs
color("Starting...", "info")
config_obj = ReadConfig("/path/to/dir", "project.conf")
conf_array = config_obj.getconfig("all")
color("I got all configs!", "success")
sql = mySQL(config_obj)
tables = sql.sendquery("SHOW TABLES;")
sql.sendquery("CREATE TABLE firsttable;")
sql.commit()
sql.close()
sqll = MySQLLogger(config_obj, "/path/to/dir")
sqll.create_table("people", [["name", "VARCHAR(10)"], ["age", "INTEGER"]])
sqll.write(beacon)
sqll.close()
color("Script is over", "error")
Usage of SimpleArgParse
file test.py:
import elixs
# option1 = {Name of option: [[4 synonyms to enable (filled up with 1)], [and 4 to disable], default value]}
option1 = {"Debug mode": [["+d", "enable_debug", "debug_on", 1], ["-d", "disable_debug", "debug_off", 1], True]}
# You can give up to 3 options
option2 = {"Django mode": [["+s", "enable_django", "django_on", 1], ["-s", "disable_django", "django_off", 1], False]}
ap = SimpleArgParser(option1, option2)
# The second argument is the amout of options you expect.
# It defines the number of elements in the tuple that is returned
debug, django = ap.parse(sys.argv, 2)
print(debug, django)
>>> python test.py +s -d
False True
>>> python test.py -d
False False
>>> python test.py
True False
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file elixs-0.1.3.tar.gz.
File metadata
- Download URL: elixs-0.1.3.tar.gz
- Upload date:
- Size: 19.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
405d5ebeaf3c7b122da13742cc411fe6310ecc97327ee7bc201303223f2070c8
|
|
| MD5 |
18dcdfbadedbe564f2ccdf741f290066
|
|
| BLAKE2b-256 |
d27d256b99d4375439e0d20615c6b8dc78e6c15f844e6581e2357bc1085cb72f
|
File details
Details for the file elixs-0.1.3-py3-none-any.whl.
File metadata
- Download URL: elixs-0.1.3-py3-none-any.whl
- Upload date:
- Size: 22.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0749fbac33c1676480438eab63afa503fcb6ee9378a58fc6abb43fc292b5691f
|
|
| MD5 |
ed363fc308f76ede754a67b216c4b009
|
|
| BLAKE2b-256 |
24d96f63d9431e7e1e317255807ce16f0f99a38512b89213b8889ece22e77d48
|