clockwork 0.1.0__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {clockwork-0.1.0 → clockwork-0.1.2}/PKG-INFO +18 -2
- clockwork-0.1.2/README.md +17 -0
- clockwork-0.1.2/clockwork/__init__.py +4 -0
- clockwork-0.1.0/clockwork/clockwork.py → clockwork-0.1.2/clockwork/core.py +26 -36
- {clockwork-0.1.0 → clockwork-0.1.2}/clockwork/taskmaster.py +6 -6
- {clockwork-0.1.0 → clockwork-0.1.2}/pyproject.toml +1 -1
- clockwork-0.1.0/README.md +0 -2
- clockwork-0.1.0/clockwork/__init__.py +0 -4
- {clockwork-0.1.0 → clockwork-0.1.2}/LICENSE +0 -0
- {clockwork-0.1.0 → clockwork-0.1.2}/clockwork/chronicle.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: clockwork
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: Toolkit for time-related operations including scheduling, logging, date manipulation, and more.
|
|
5
5
|
Home-page: https://github.com/zteinck/clockwork
|
|
6
6
|
License: MIT
|
|
@@ -23,4 +23,20 @@ Project-URL: Repository, https://github.com/zteinck/clockwork
|
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
24
24
|
|
|
25
25
|
# clockwork
|
|
26
|
-
|
|
26
|
+
|
|
27
|
+
<div>
|
|
28
|
+
|
|
29
|
+
[](https://pypi.org/project/clockwork/)
|
|
30
|
+
[](https://github.com/zteinck/clockwork/blob/master/LICENSE)
|
|
31
|
+
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
`clockwork` is a Python package that provides a multitude of time-related functionalities, facilitating tasks such as scheduling, logging, date manipulation, and more.
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## Installation
|
|
39
|
+
```sh
|
|
40
|
+
pip install clockwork
|
|
41
|
+
```
|
|
42
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# clockwork
|
|
2
|
+
|
|
3
|
+
<div>
|
|
4
|
+
|
|
5
|
+
[](https://pypi.org/project/clockwork/)
|
|
6
|
+
[](https://github.com/zteinck/clockwork/blob/master/LICENSE)
|
|
7
|
+
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
`clockwork` is a Python package that provides a multitude of time-related functionalities, facilitating tasks such as scheduling, logging, date manipulation, and more.
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
```sh
|
|
16
|
+
pip install clockwork
|
|
17
|
+
```
|
|
@@ -427,17 +427,20 @@ class DateBase(object):
|
|
|
427
427
|
return wrapper
|
|
428
428
|
|
|
429
429
|
|
|
430
|
-
|
|
431
|
-
#+---------------------------------------------------------------------------+
|
|
432
|
-
# Class Methods
|
|
433
|
-
#+---------------------------------------------------------------------------+
|
|
434
|
-
# None
|
|
435
|
-
|
|
436
|
-
|
|
437
430
|
#+---------------------------------------------------------------------------+
|
|
438
431
|
# Properties
|
|
439
432
|
#+---------------------------------------------------------------------------+
|
|
440
433
|
|
|
434
|
+
@property
|
|
435
|
+
def date(self):
|
|
436
|
+
''' returns normalized instance '''
|
|
437
|
+
return self.normalize()
|
|
438
|
+
|
|
439
|
+
@property
|
|
440
|
+
def d(self):
|
|
441
|
+
''' converts datetime.datetime to datetime.date '''
|
|
442
|
+
return self.datetime.date()
|
|
443
|
+
|
|
441
444
|
@property
|
|
442
445
|
def dt(self):
|
|
443
446
|
''' datetime alias '''
|
|
@@ -449,14 +452,14 @@ class DateBase(object):
|
|
|
449
452
|
return pd.to_datetime(self.dt)
|
|
450
453
|
|
|
451
454
|
@property
|
|
452
|
-
def
|
|
455
|
+
def ymd(self):
|
|
453
456
|
''' string in YYYY-MM-DD format '''
|
|
454
457
|
return self.str('%Y-%m-%d')
|
|
455
458
|
|
|
456
459
|
@property
|
|
457
|
-
def
|
|
458
|
-
'''
|
|
459
|
-
return self.
|
|
460
|
+
def sql_server(self):
|
|
461
|
+
''' ymd alias '''
|
|
462
|
+
return self.ymd
|
|
460
463
|
|
|
461
464
|
@property
|
|
462
465
|
def oracle(self):
|
|
@@ -564,7 +567,6 @@ class DateBase(object):
|
|
|
564
567
|
return isinstance(Date(self.sqlsvr), MonthEnd)
|
|
565
568
|
|
|
566
569
|
|
|
567
|
-
|
|
568
570
|
#+---------------------------------------------------------------------------+
|
|
569
571
|
# Magic Methods
|
|
570
572
|
#+---------------------------------------------------------------------------+
|
|
@@ -703,16 +705,16 @@ class MonthEnd(DateBase):
|
|
|
703
705
|
super().__init__(dt.replace(day=n_days_in_month(dt.year, dt.month)))
|
|
704
706
|
|
|
705
707
|
@property
|
|
706
|
-
def
|
|
707
|
-
return self.str('%Y
|
|
708
|
+
def long(self):
|
|
709
|
+
return self.str('%Y-%m-%d')
|
|
708
710
|
|
|
709
711
|
@property
|
|
710
|
-
def
|
|
711
|
-
return self.str('%
|
|
712
|
+
def compact(self):
|
|
713
|
+
return self.str('%Y-%m')
|
|
712
714
|
|
|
713
715
|
@property
|
|
714
|
-
def
|
|
715
|
-
return self.str('%b
|
|
716
|
+
def short(self):
|
|
717
|
+
return self.str('%b')
|
|
716
718
|
|
|
717
719
|
@property
|
|
718
720
|
def last_quarter_end(self):
|
|
@@ -740,24 +742,20 @@ class QuarterEnd(MonthEnd):
|
|
|
740
742
|
self.qtr = qtr
|
|
741
743
|
|
|
742
744
|
@property
|
|
743
|
-
def
|
|
745
|
+
def long(self):
|
|
744
746
|
return f'{self.year}Q{self.qtr}'
|
|
745
747
|
|
|
746
748
|
@property
|
|
747
|
-
def
|
|
748
|
-
return self.
|
|
749
|
-
|
|
750
|
-
@property
|
|
751
|
-
def quarter(self):
|
|
752
|
-
return self.qtr
|
|
749
|
+
def compact(self):
|
|
750
|
+
return f'{self.qtr}Q' + self.str('%y')
|
|
753
751
|
|
|
754
752
|
@property
|
|
755
753
|
def short(self):
|
|
756
754
|
return f'Q{self.qtr}'
|
|
757
755
|
|
|
758
756
|
@property
|
|
759
|
-
def
|
|
760
|
-
return
|
|
757
|
+
def quarter(self):
|
|
758
|
+
return self.qtr
|
|
761
759
|
|
|
762
760
|
def to_month_end(self):
|
|
763
761
|
return MonthEnd(self.dt)
|
|
@@ -769,12 +767,4 @@ class QuarterEnd(MonthEnd):
|
|
|
769
767
|
if delta == 0: return self
|
|
770
768
|
dt = self.shift(months=delta * 3).dt
|
|
771
769
|
qtr = ((self.qtr - 1 + delta) % 4) + 1
|
|
772
|
-
return QuarterEnd(dt, qtr)
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
if __name__ == '__main__':
|
|
780
|
-
pass
|
|
770
|
+
return QuarterEnd(dt, qtr)
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
from clockwork import Date, elapsed_time
|
|
2
|
-
from iterlab import to_iter
|
|
3
|
-
from pathpilot import Folder
|
|
4
|
-
from clockwork.chronicle import Logger
|
|
5
|
-
from contextlib import redirect_stdout
|
|
6
|
-
from schedule import Scheduler, CancelJob
|
|
7
1
|
import datetime
|
|
8
2
|
import time
|
|
9
3
|
import uuid
|
|
10
4
|
import os
|
|
5
|
+
from contextlib import redirect_stdout
|
|
6
|
+
from schedule import Scheduler, CancelJob
|
|
7
|
+
from iterlab import to_iter
|
|
8
|
+
from pathpilot import Folder
|
|
11
9
|
|
|
10
|
+
from .core import Date, elapsed_time
|
|
11
|
+
from .chronicle import Logger
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
clockwork-0.1.0/README.md
DELETED
|
File without changes
|
|
File without changes
|