# basicbaarutils
Under construction! Not ready for use yet! Currently experimenting and planning!
Developed by Pritam Sarkar from [BAAR Technologies](https://www.linkedin.com/company/baartech/mycompany/verification/) (c) 2023
## Examples of How To Use (Alpha Version + Buggy)
Creating A Progressbar
```python
from basicbaarutils import Progressbar
pb = ProgressBar(total=200)
for _ in range(200):
"""main code block"""
pb.update()
```
```
(venv) C:\***\***>python main.py
████████████████████████████████████████████████████████████████████████████████████████████████████|100.00%
```
```python
"""
Args:
total (int): The total number of items in the task.
progress (int, optional): The current progress value (default is 0).
counter (int, optional): The amount by which the progress increases in each update (default is 1).
color (str, optional): The color to use for the progress bar (default is colorama.Fore.YELLOW).
end_color (str, optional): The color to use for the progress bar when it reaches 100% (default is colorama.Fore.GREEN).
Returns:
A Progressbar instance
"""
```
Creating a quartz cron based trigger
```python
from basicbaarutils import Trigger
tr = Trigger("0 * 0 ? * * *", start_date=datetime.datetime.now())
print(Trigger.check_valid_cron_or_not("0 * 0 ? * * *"))
for _ in range(20):
"""next 20 triggers"""
print(tr.get_next())
```
```
(venv) C:\***\***>python main.py
True
2023-10-19 13:49:00
2023-10-19 13:50:00
2023-10-19 13:51:00
2023-10-19 13:52:00
2023-10-19 13:53:00
2023-10-19 13:54:00
2023-10-19 13:55:00
2023-10-19 13:56:00
2023-10-19 13:57:00
2023-10-19 13:58:00
2023-10-19 13:59:00
2027-10-14 13:49:00
2027-10-14 13:50:00
2027-10-14 13:51:00
2027-10-14 13:52:00
2027-10-14 13:53:00
2027-10-14 13:54:00
2027-10-14 13:55:00
2027-10-14 13:56:00
2027-10-14 13:57:00
```
```python
"""
Args:
quartz_expression (str): A Quartz Cron expression.
infinite (bool): Whether the trigger should run infinitely.
start_date (datetime.datetime, optional): The start date for the trigger.
end_date (datetime.datetime, optional): The end date for a finite run.
default_week_delta (int, optional): The default number of weeks to run.
Returns:
A Trigger instance
"""
```
Raw data
{
"_id": null,
"home_page": "",
"name": "basicbaarutil",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "python,basicbaarutil,quartz,quartzcron,quartz cron,cron,cron triggers,quartzcron triggers",
"author": "Pritam Sarkar (Baar Technologies)",
"author_email": "<pritamsarkar84028220@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/51/28/cac3c914c45f846b180173da9e220ea8aeb721812c3ae786ad5fe93d2480/basicbaarutil-0.0.2.tar.gz",
"platform": null,
"description": "\r\n# basicbaarutils\r\n\r\n\r\n\r\nUnder construction! Not ready for use yet! Currently experimenting and planning!\r\n\r\n\r\n\r\nDeveloped by Pritam Sarkar from [BAAR Technologies](https://www.linkedin.com/company/baartech/mycompany/verification/) (c) 2023\r\n\r\n\r\n\r\n## Examples of How To Use (Alpha Version + Buggy)\r\n\r\n\r\n\r\nCreating A Progressbar\r\n\r\n\r\n\r\n```python\r\n\r\nfrom basicbaarutils import Progressbar\r\n\r\n\r\n\r\npb = ProgressBar(total=200)\r\n\r\n\r\n\r\nfor _ in range(200):\r\n\r\n \"\"\"main code block\"\"\"\r\n\r\n pb.update()\r\n\r\n\r\n\r\n```\r\n\r\n\r\n\r\n```\r\n\r\n(venv) C:\\***\\***>python main.py\r\n\r\n\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588|100.00%\r\n\r\n```\r\n\r\n\r\n\r\n```python\r\n\r\n\"\"\"\r\n\r\n Args:\r\n\r\n total (int): The total number of items in the task.\r\n\r\n progress (int, optional): The current progress value (default is 0).\r\n\r\n counter (int, optional): The amount by which the progress increases in each update (default is 1).\r\n\r\n color (str, optional): The color to use for the progress bar (default is colorama.Fore.YELLOW).\r\n\r\n end_color (str, optional): The color to use for the progress bar when it reaches 100% (default is colorama.Fore.GREEN).\r\n\r\n Returns:\r\n\r\n A Progressbar instance\r\n\r\n\"\"\"\r\n\r\n```\r\n\r\n\r\n\r\nCreating a quartz cron based trigger\r\n\r\n\r\n\r\n```python\r\n\r\nfrom basicbaarutils import Trigger\r\n\r\ntr = Trigger(\"0 * 0 ? * * *\", start_date=datetime.datetime.now())\r\n\r\n\r\n\r\nprint(Trigger.check_valid_cron_or_not(\"0 * 0 ? * * *\"))\r\n\r\n\r\n\r\nfor _ in range(20):\r\n\r\n \"\"\"next 20 triggers\"\"\"\r\n\r\n print(tr.get_next())\r\n\r\n```\r\n\r\n\r\n\r\n```\r\n\r\n(venv) C:\\***\\***>python main.py\r\n\r\nTrue\r\n\r\n2023-10-19 13:49:00\r\n\r\n2023-10-19 13:50:00\r\n\r\n2023-10-19 13:51:00\r\n\r\n2023-10-19 13:52:00\r\n\r\n2023-10-19 13:53:00\r\n\r\n2023-10-19 13:54:00\r\n\r\n2023-10-19 13:55:00\r\n\r\n2023-10-19 13:56:00\r\n\r\n2023-10-19 13:57:00\r\n\r\n2023-10-19 13:58:00\r\n\r\n2023-10-19 13:59:00\r\n\r\n2027-10-14 13:49:00\r\n\r\n2027-10-14 13:50:00\r\n\r\n2027-10-14 13:51:00\r\n\r\n2027-10-14 13:52:00\r\n\r\n2027-10-14 13:53:00\r\n\r\n2027-10-14 13:54:00\r\n\r\n2027-10-14 13:55:00\r\n\r\n2027-10-14 13:56:00\r\n\r\n2027-10-14 13:57:00\r\n\r\n```\r\n\r\n\r\n\r\n```python\r\n\r\n\"\"\"\r\n\r\n Args:\r\n\r\n quartz_expression (str): A Quartz Cron expression.\r\n\r\n infinite (bool): Whether the trigger should run infinitely.\r\n\r\n start_date (datetime.datetime, optional): The start date for the trigger.\r\n\r\n end_date (datetime.datetime, optional): The end date for a finite run.\r\n\r\n default_week_delta (int, optional): The default number of weeks to run.\r\n\r\n\r\n\r\n Returns:\r\n\r\n A Trigger instance\r\n\r\n\"\"\"\r\n\r\n```\r\n\r\n",
"bugtrack_url": null,
"license": "",
"summary": "Basic util library for BAAR related operation",
"version": "0.0.2",
"project_urls": null,
"split_keywords": [
"python",
"basicbaarutil",
"quartz",
"quartzcron",
"quartz cron",
"cron",
"cron triggers",
"quartzcron triggers"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a2fdd76a8ff0e4e2c32255cb4a9684da3ad71496c1216bf97089294c70bf9bc5",
"md5": "edbdf25da376e48dcd7c877c03128135",
"sha256": "c5d8c1b82227ec897889557d7cbd96321a8aaa0d0abe2d85a55587dbd64872cd"
},
"downloads": -1,
"filename": "basicbaarutil-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "edbdf25da376e48dcd7c877c03128135",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 5419,
"upload_time": "2023-10-19T09:00:28",
"upload_time_iso_8601": "2023-10-19T09:00:28.769772Z",
"url": "https://files.pythonhosted.org/packages/a2/fd/d76a8ff0e4e2c32255cb4a9684da3ad71496c1216bf97089294c70bf9bc5/basicbaarutil-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5128cac3c914c45f846b180173da9e220ea8aeb721812c3ae786ad5fe93d2480",
"md5": "56be221c27aae196f8dd9ed686e4bc5f",
"sha256": "9f358b287f11bd6db5dc28700d024bf77c359a9974b2475e185a1ee8ed2e036c"
},
"downloads": -1,
"filename": "basicbaarutil-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "56be221c27aae196f8dd9ed686e4bc5f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 4850,
"upload_time": "2023-10-19T09:00:30",
"upload_time_iso_8601": "2023-10-19T09:00:30.723682Z",
"url": "https://files.pythonhosted.org/packages/51/28/cac3c914c45f846b180173da9e220ea8aeb721812c3ae786ad5fe93d2480/basicbaarutil-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-19 09:00:30",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "basicbaarutil"
}