mayutils 1.2.3__tar.gz → 1.2.5__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.
- {mayutils-1.2.3 → mayutils-1.2.5}/PKG-INFO +1 -1
- {mayutils-1.2.3 → mayutils-1.2.5}/pyproject.toml +1 -1
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/objects/datetime.py +67 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/LICENSE +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/README.md +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/__init__.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/core/__init__.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/core/constants.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/data/__init__.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/data/analysis/__init__.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/data/cache/.gitkeep +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/data/live.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/data/local.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/data/queries/.gitkeep +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/data/queries/__init__.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/data/queries/examples/.gitkeep +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/data/read.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/environment/__init__.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/environment/benchmarking.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/environment/databases.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/environment/filesystem.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/environment/logging.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/environment/memoisation.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/environment/oauth.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/environment/webdrivers.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/export/__init__.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/export/images.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/export/pdf.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/export/slides.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/interfaces/__init__.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/interfaces/google.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/interfaces/microsoft.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/interfaces/streamlit.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/mathematics/__init__.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/mathematics/numba.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/mathematics/numpy.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/objects/__init__.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/objects/classes.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/objects/colours.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/objects/dataframes.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/objects/decorators.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/objects/dictionaries.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/objects/functions.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/objects/hashing.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/objects/numbers.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/objects/strings.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/objects/types.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/scripts/__init__.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/scripts/clear_cache.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/scripts/versioning.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/testing/__init__.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/visualisation/__init__.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/visualisation/console.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/visualisation/graphs/__init__.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/visualisation/graphs/combine.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/visualisation/graphs/matplotlib/__init__.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/visualisation/graphs/matplotlib/template.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/visualisation/graphs/plotly/__init__.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/visualisation/graphs/plotly/charts.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/visualisation/graphs/plotly/templates.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/visualisation/graphs/plotly/traces.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/visualisation/graphs/plotly/utilities.py +0 -0
- {mayutils-1.2.3 → mayutils-1.2.5}/src/mayutils/visualisation/notebook.py +0 -0
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
1
2
|
from contextlib import _GeneratorContextManager
|
|
2
3
|
from sqlite3 import register_adapter
|
|
3
4
|
from typing import Any, Optional, Self, Literal
|
|
4
5
|
import datetime as _datetime
|
|
6
|
+
import numpy as np
|
|
5
7
|
from pendulum import (
|
|
6
8
|
DateTime as BaseDateTime,
|
|
7
9
|
Date as BaseDate,
|
|
@@ -130,6 +132,26 @@ class Date(BaseDate):
|
|
|
130
132
|
|
|
131
133
|
return output
|
|
132
134
|
|
|
135
|
+
def to_datetime(
|
|
136
|
+
self,
|
|
137
|
+
tz: str | Timezone = UTC,
|
|
138
|
+
) -> DateTime:
|
|
139
|
+
return DateTime.create(
|
|
140
|
+
year=self.year,
|
|
141
|
+
month=self.month,
|
|
142
|
+
day=self.day,
|
|
143
|
+
hour=0,
|
|
144
|
+
minute=0,
|
|
145
|
+
second=0,
|
|
146
|
+
microsecond=0,
|
|
147
|
+
tz=tz,
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
def to_numpy(
|
|
151
|
+
self,
|
|
152
|
+
) -> np.datetime64:
|
|
153
|
+
return np.datetime64(self)
|
|
154
|
+
|
|
133
155
|
|
|
134
156
|
class Time(BaseTime):
|
|
135
157
|
@classmethod
|
|
@@ -168,6 +190,31 @@ class Time(BaseTime):
|
|
|
168
190
|
|
|
169
191
|
return output
|
|
170
192
|
|
|
193
|
+
def today(
|
|
194
|
+
self,
|
|
195
|
+
) -> DateTime:
|
|
196
|
+
return DateTime.now(tz=self.tzinfo).at(
|
|
197
|
+
hour=self.hour,
|
|
198
|
+
minute=self.minute,
|
|
199
|
+
second=self.second,
|
|
200
|
+
microsecond=self.microsecond,
|
|
201
|
+
)
|
|
202
|
+
|
|
203
|
+
def on(
|
|
204
|
+
self,
|
|
205
|
+
date: Date,
|
|
206
|
+
) -> DateTime:
|
|
207
|
+
return DateTime(
|
|
208
|
+
year=date.year,
|
|
209
|
+
month=date.month,
|
|
210
|
+
day=date.day,
|
|
211
|
+
hour=self.hour,
|
|
212
|
+
minute=self.minute,
|
|
213
|
+
second=self.second,
|
|
214
|
+
microsecond=self.microsecond,
|
|
215
|
+
tzinfo=self.tzinfo,
|
|
216
|
+
)
|
|
217
|
+
|
|
171
218
|
|
|
172
219
|
class DateTime(BaseDateTime):
|
|
173
220
|
@classmethod
|
|
@@ -350,6 +397,26 @@ class DateTime(BaseDateTime):
|
|
|
350
397
|
microsecond=self.microsecond,
|
|
351
398
|
)
|
|
352
399
|
|
|
400
|
+
def date(self) -> Date:
|
|
401
|
+
return Date(
|
|
402
|
+
year=self.year,
|
|
403
|
+
month=self.month,
|
|
404
|
+
day=self.day,
|
|
405
|
+
)
|
|
406
|
+
|
|
407
|
+
def time(self) -> Time:
|
|
408
|
+
return Time(
|
|
409
|
+
hour=self.hour,
|
|
410
|
+
minute=self.minute,
|
|
411
|
+
second=self.second,
|
|
412
|
+
microsecond=self.microsecond,
|
|
413
|
+
)
|
|
414
|
+
|
|
415
|
+
def to_numpy(
|
|
416
|
+
self,
|
|
417
|
+
) -> np.datetime64:
|
|
418
|
+
return np.datetime64(self)
|
|
419
|
+
|
|
353
420
|
|
|
354
421
|
# TODO: NewInterval for working with pandas? nah add to pandas accessor? Or maybe to convert to pandas indexable thing
|
|
355
422
|
class Interval(BaseInterval):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|