Name | SqlUts JSON |
Version |
0.1.3
JSON |
| download |
home_page | |
Summary | An orm package |
upload_time | 2023-12-01 18:05:05 |
maintainer | |
docs_url | None |
author | Melque Lima |
requires_python | |
license | MIT |
keywords |
sqluts
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Sql Uts
#
### Installation
```sh
pip install dateUts
```
### Usage
#
#### sqlToDate
```py
from dateUts import sqlToDate
result = sqlToDate('1991-12-23')
print(result)
```
```py
datetime.datetime(1991, 12, 23, 0, 0)
```
#### dateToSql
```py
from dateUts import dateToSql
from datetime import datetime
today = datetime.now()
result = dateToSql(today)
print(result)
```
```py
'2022-05-25'
```
#### now
```py
from dateUts import now
now1 = now()
now2 = now(fmt='%Y-%d-%m')
now3 = now(fmt='sql')
print(now1)
print(now2)
print(now3)
```
```py
datetime.datetime(2022, 5, 25, 18, 57, 5, 710329)
'2022-05-25'
'2022-25-05'
```
#### today
```py
from dateUts import today
today1 = today()
today2 = today(fmt='%Y-%d-%m')
today3 = today(fmt='sql')
today4 = today(fmt='sql',addDays=1)
today5 = today(fmt='sql',addDays=-1)
print(today1)
print(today2)
print(today3)
print(today4)
print(today5)
```
```py
datetime.datetime(2022, 5, 25, 18, 57, 5, 710329)
'2022-05-25'
'2022-25-05'
'2022-25-06'
'2022-25-04'
```
#### yesterday
```py
from dateUts import yesterday
ystd1 = yesterday()
ystd2 = yesterday(fmt='%Y-%d-%m')
ystd3 = yesterday(fmt='sql')
print(ystd1)
print(ystd2)
print(ystd3)
```
```py
datetime.datetime(2022, 5, 24, 18, 57, 5, 710329)
'2022-24-05'
'2022-05-24'
```
#### dateRange
```py
from dateUts import sqlToDate,dateRange
start = sqlToDate('2022-05-01')
end = sqlToDate('2022-05-03')
range1 = dateRange(start,end)
range2 = dateRange(start,end,fmt='sql')
print(range1)
print(range2)
```
```py
[datetime.datetime(2022, 5, 1, 0, 0), datetime.datetime(2022, 5, 2, 0, 0), datetime.datetime(2022, 5, 3, 0, 0)]
['2022-05-01', '2022-05-02', '2022-05-03']
```
#### dateAdd
```py
from dateUts import sqlToDate,dateToSql,dateAdd
mydate = sqlToDate('2022-05-02')
mydate_plus1_day = dateAdd(mydate,1,'day')
mydate_less1_day = dateAdd(mydate,-1,'day')
mydate_plus1_yer = dateAdd(mydate,1,'year')
print(dateToSql(mydate))
print(dateToSql(mydate_plus1_day))
print(dateToSql(mydate_less1_day))
print(dateToSql(mydate_plus1_yer))
```
```py
'2022-05-02'
'2022-05-03'
'2022-05-01'
'2023-05-02'
```
#### lastWorkingDate
```py
from dateUts import lastWorkingDate
#Assuming today as '2022-05-25'
dt = lastWorkingDate(fmt='sql')
print(dt)
#Assuming today as '2022-05-23'
dt = lastWorkingDate(fmt='sql')
print(dt)
```
```py
'2022-05-24'
'2022-05-20'
```
#### DateMatch
```py
from dateUts import dateMatch
dt = dateMatch('2022-01-01','sql')
print(dt)
dt = dateMatch('2022-01-01','%Y-%m-%d')
print(dt)
```
```py
True
True
```
Change Log
==========
0.0.1 (2022-06-10)
------------------
- First Release
0.0.2 (2022-06-10)
------------------
- Required libs
0.0.3 (2022-06-11)
------------------
- TblUts
0.0.4 (2022-07-20)
------------------
- Adjustment at sqlToDate function
0.0.5 (2022-05-25)
------------------
- Readme details
0.0.9 (2022-08-18)
------------------
- DateMatch
Raw data
{
"_id": null,
"home_page": "",
"name": "SqlUts",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "SqlUts",
"author": "Melque Lima",
"author_email": "melque_ex@yahoo.com.br",
"download_url": "https://files.pythonhosted.org/packages/be/fc/ad2279d7036f2b5323b68c233f4b290ee9287aba367ac9760e4b380145ac/SqlUts-0.1.3.tar.gz",
"platform": null,
"description": "# Sql Uts\r\n#\r\n### Installation\r\n\r\n```sh\r\npip install dateUts\r\n```\r\n\r\n### Usage\r\n#\r\n#### sqlToDate\r\n```py\r\nfrom dateUts import sqlToDate\r\nresult = sqlToDate('1991-12-23')\r\nprint(result)\r\n```\r\n```py\r\ndatetime.datetime(1991, 12, 23, 0, 0)\r\n```\r\n#### dateToSql\r\n```py\r\nfrom dateUts import dateToSql\r\nfrom datetime import datetime\r\n\r\ntoday = datetime.now()\r\nresult = dateToSql(today)\r\nprint(result)\r\n```\r\n```py\r\n'2022-05-25'\r\n```\r\n#### now\r\n```py\r\nfrom dateUts import now\r\n\r\nnow1 = now()\r\nnow2 = now(fmt='%Y-%d-%m')\r\nnow3 = now(fmt='sql')\r\nprint(now1)\r\nprint(now2)\r\nprint(now3)\r\n```\r\n```py\r\ndatetime.datetime(2022, 5, 25, 18, 57, 5, 710329)\r\n'2022-05-25'\r\n'2022-25-05'\r\n```\r\n#### today\r\n```py\r\nfrom dateUts import today\r\n\r\ntoday1 = today()\r\ntoday2 = today(fmt='%Y-%d-%m')\r\ntoday3 = today(fmt='sql')\r\ntoday4 = today(fmt='sql',addDays=1)\r\ntoday5 = today(fmt='sql',addDays=-1)\r\nprint(today1)\r\nprint(today2)\r\nprint(today3)\r\nprint(today4)\r\nprint(today5)\r\n```\r\n```py\r\ndatetime.datetime(2022, 5, 25, 18, 57, 5, 710329)\r\n'2022-05-25'\r\n'2022-25-05'\r\n'2022-25-06'\r\n'2022-25-04'\r\n```\r\n\r\n#### yesterday\r\n```py\r\nfrom dateUts import yesterday\r\n\r\nystd1 = yesterday()\r\nystd2 = yesterday(fmt='%Y-%d-%m')\r\nystd3 = yesterday(fmt='sql')\r\nprint(ystd1)\r\nprint(ystd2)\r\nprint(ystd3)\r\n```\r\n```py\r\ndatetime.datetime(2022, 5, 24, 18, 57, 5, 710329)\r\n'2022-24-05'\r\n'2022-05-24'\r\n```\r\n#### dateRange\r\n```py\r\nfrom dateUts import sqlToDate,dateRange\r\n\r\nstart = sqlToDate('2022-05-01')\r\nend = sqlToDate('2022-05-03')\r\n\r\nrange1 = dateRange(start,end)\r\nrange2 = dateRange(start,end,fmt='sql')\r\nprint(range1)\r\nprint(range2)\r\n```\r\n```py\r\n[datetime.datetime(2022, 5, 1, 0, 0), datetime.datetime(2022, 5, 2, 0, 0), datetime.datetime(2022, 5, 3, 0, 0)]\r\n['2022-05-01', '2022-05-02', '2022-05-03']\r\n```\r\n\r\n#### dateAdd\r\n```py\r\nfrom dateUts import sqlToDate,dateToSql,dateAdd\r\n\r\nmydate = sqlToDate('2022-05-02')\r\nmydate_plus1_day = dateAdd(mydate,1,'day')\r\nmydate_less1_day = dateAdd(mydate,-1,'day')\r\nmydate_plus1_yer = dateAdd(mydate,1,'year')\r\n\r\nprint(dateToSql(mydate))\r\nprint(dateToSql(mydate_plus1_day))\r\nprint(dateToSql(mydate_less1_day))\r\nprint(dateToSql(mydate_plus1_yer))\r\n```\r\n```py\r\n'2022-05-02'\r\n'2022-05-03'\r\n'2022-05-01'\r\n'2023-05-02'\r\n```\r\n\r\n#### lastWorkingDate\r\n```py\r\nfrom dateUts import lastWorkingDate\r\n\r\n#Assuming today as '2022-05-25'\r\ndt = lastWorkingDate(fmt='sql')\r\nprint(dt)\r\n\r\n#Assuming today as '2022-05-23'\r\ndt = lastWorkingDate(fmt='sql')\r\nprint(dt)\r\n```\r\n```py\r\n'2022-05-24'\r\n'2022-05-20'\r\n```\r\n\r\n#### DateMatch\r\n```py\r\nfrom dateUts import dateMatch\r\n\r\ndt = dateMatch('2022-01-01','sql')\r\nprint(dt)\r\n\r\ndt = dateMatch('2022-01-01','%Y-%m-%d')\r\nprint(dt)\r\n```\r\n```py\r\nTrue\r\nTrue\r\n```\r\n\r\nChange Log\r\n==========\r\n\r\n0.0.1 (2022-06-10)\r\n------------------\r\n- First Release\r\n\r\n0.0.2 (2022-06-10)\r\n------------------\r\n- Required libs\r\n\r\n0.0.3 (2022-06-11)\r\n------------------\r\n- TblUts\r\n\r\n0.0.4 (2022-07-20)\r\n------------------\r\n- Adjustment at sqlToDate function\r\n\r\n0.0.5 (2022-05-25)\r\n------------------\r\n- Readme details\r\n\r\n0.0.9 (2022-08-18)\r\n------------------\r\n- DateMatch\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "An orm package",
"version": "0.1.3",
"project_urls": null,
"split_keywords": [
"sqluts"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "befcad2279d7036f2b5323b68c233f4b290ee9287aba367ac9760e4b380145ac",
"md5": "4886e5bb3fc7e59e17920828e80cd912",
"sha256": "b740df511d025e7befe85cb3b17d07f0cb113f39de40c78940d89431500dc2f8"
},
"downloads": -1,
"filename": "SqlUts-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "4886e5bb3fc7e59e17920828e80cd912",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3699,
"upload_time": "2023-12-01T18:05:05",
"upload_time_iso_8601": "2023-12-01T18:05:05.920995Z",
"url": "https://files.pythonhosted.org/packages/be/fc/ad2279d7036f2b5323b68c233f4b290ee9287aba367ac9760e4b380145ac/SqlUts-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-01 18:05:05",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "sqluts"
}