elixs-0.1.3
توضیحات
Standart Library for elixs.dev
| ویژگی | مقدار |
|---|---|
| سیستم عامل | POSIX :: Linux |
| نام فایل | elixs-0.1.3 |
| نام | elixs |
| نسخه کتابخانه | 0.1.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Elias Kremer |
| ایمیل نویسنده | eliservices.server@gmail.com |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/elixs/ |
| مجوز | - |
# elixs.dev Standart Library
[](https://travis-ci.org/)
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
```sh
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
```python
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:
```python
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)
```
```sh
>>> python test.py +s -d
False True
>>> python test.py -d
False False
>>> python test.py
True False
```
نیازمندی
| مقدار | نام |
|---|---|
| - | color4console |
| - | mysql-connector-python |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.10 | Python |
نحوه نصب
نصب پکیج whl elixs-0.1.3:
pip install elixs-0.1.3.whl
نصب پکیج tar.gz elixs-0.1.3:
pip install elixs-0.1.3.tar.gz