squirrels 0.5.0b2__py3-none-any.whl → 0.5.0b4__py3-none-any.whl

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.

Potentially problematic release.


This version of squirrels might be problematic. Click here for more details.

Files changed (96) hide show
  1. dateutils/__init__.py +6 -460
  2. dateutils/_enums.py +25 -0
  3. dateutils/_implementation.py +409 -0
  4. dateutils/types.py +6 -0
  5. squirrels/__init__.py +9 -13
  6. squirrels/_api_routes/__init__.py +5 -0
  7. squirrels/_api_routes/auth.py +262 -0
  8. squirrels/_api_routes/base.py +154 -0
  9. squirrels/_api_routes/dashboards.py +142 -0
  10. squirrels/_api_routes/data_management.py +103 -0
  11. squirrels/_api_routes/datasets.py +242 -0
  12. squirrels/_api_routes/oauth2.py +300 -0
  13. squirrels/_api_routes/project.py +214 -0
  14. squirrels/_api_server.py +145 -748
  15. squirrels/_arguments/__init__.py +0 -0
  16. squirrels/{arguments → _arguments}/init_time_args.py +7 -2
  17. squirrels/{arguments → _arguments}/run_time_args.py +4 -26
  18. squirrels/_auth.py +646 -93
  19. squirrels/_connection_set.py +5 -5
  20. squirrels/_constants.py +7 -1
  21. squirrels/{_dashboards_io.py → _dashboards.py} +87 -6
  22. squirrels/_data_sources.py +564 -0
  23. squirrels/_exceptions.py +9 -37
  24. squirrels/_initializer.py +31 -26
  25. squirrels/_manifest.py +5 -5
  26. squirrels/_model_builder.py +1 -1
  27. squirrels/_model_configs.py +2 -2
  28. squirrels/_model_queries.py +1 -1
  29. squirrels/_models.py +40 -27
  30. squirrels/{package_data → _package_data}/base_project/.env +1 -0
  31. squirrels/{package_data → _package_data}/base_project/.env.example +1 -0
  32. squirrels/{package_data → _package_data}/base_project/dashboards/dashboard_example.py +4 -4
  33. squirrels/{package_data → _package_data}/base_project/dashboards/dashboard_example.yml +2 -2
  34. squirrels/_package_data/base_project/macros/macros_example.sql +17 -0
  35. squirrels/{package_data → _package_data}/base_project/models/builds/build_example.py +2 -2
  36. squirrels/{package_data → _package_data}/base_project/models/builds/build_example.sql +1 -1
  37. squirrels/{package_data → _package_data}/base_project/models/dbviews/dbview_example.sql +1 -1
  38. squirrels/_package_data/base_project/models/federates/federate_example.py +41 -0
  39. squirrels/_package_data/base_project/models/federates/federate_example.sql +25 -0
  40. squirrels/{package_data → _package_data}/base_project/models/federates/federate_example.yml +6 -6
  41. squirrels/{package_data → _package_data}/base_project/parameters.yml +9 -8
  42. squirrels/_package_data/base_project/pyconfigs/connections.py +14 -0
  43. squirrels/{package_data → _package_data}/base_project/pyconfigs/context.py +14 -16
  44. squirrels/_package_data/base_project/pyconfigs/parameters.py +106 -0
  45. squirrels/_package_data/base_project/pyconfigs/user.py +51 -0
  46. squirrels/_package_data/templates/dataset_results.html +112 -0
  47. squirrels/_package_data/templates/oauth_login.html +271 -0
  48. squirrels/_parameter_configs.py +35 -35
  49. squirrels/_parameter_options.py +348 -0
  50. squirrels/_parameter_sets.py +47 -37
  51. squirrels/_parameters.py +1664 -0
  52. squirrels/_project.py +76 -32
  53. squirrels/_py_module.py +3 -2
  54. squirrels/_schemas/__init__.py +0 -0
  55. squirrels/_schemas/auth_models.py +144 -0
  56. squirrels/_schemas/query_param_models.py +67 -0
  57. squirrels/{_api_response_models.py → _schemas/response_models.py} +12 -8
  58. squirrels/_utils.py +38 -4
  59. squirrels/arguments.py +2 -0
  60. squirrels/auth.py +1 -0
  61. squirrels/connections.py +1 -0
  62. squirrels/dashboards.py +1 -82
  63. squirrels/data_sources.py +8 -563
  64. squirrels/parameter_options.py +8 -348
  65. squirrels/parameters.py +9 -1266
  66. squirrels/types.py +11 -0
  67. {squirrels-0.5.0b2.dist-info → squirrels-0.5.0b4.dist-info}/METADATA +4 -1
  68. squirrels-0.5.0b4.dist-info/RECORD +94 -0
  69. squirrels/package_data/base_project/macros/macros_example.sql +0 -15
  70. squirrels/package_data/base_project/models/federates/federate_example.py +0 -44
  71. squirrels/package_data/base_project/models/federates/federate_example.sql +0 -17
  72. squirrels/package_data/base_project/pyconfigs/connections.py +0 -14
  73. squirrels/package_data/base_project/pyconfigs/parameters.py +0 -93
  74. squirrels/package_data/base_project/pyconfigs/user.py +0 -23
  75. squirrels-0.5.0b2.dist-info/RECORD +0 -70
  76. /squirrels/{dataset_result.py → _dataset_types.py} +0 -0
  77. /squirrels/{package_data → _package_data}/base_project/assets/expenses.db +0 -0
  78. /squirrels/{package_data → _package_data}/base_project/assets/weather.db +0 -0
  79. /squirrels/{package_data → _package_data}/base_project/connections.yml +0 -0
  80. /squirrels/{package_data → _package_data}/base_project/docker/.dockerignore +0 -0
  81. /squirrels/{package_data → _package_data}/base_project/docker/Dockerfile +0 -0
  82. /squirrels/{package_data → _package_data}/base_project/docker/compose.yml +0 -0
  83. /squirrels/{package_data → _package_data}/base_project/duckdb_init.sql +0 -0
  84. /squirrels/{package_data/base_project/.gitignore → _package_data/base_project/gitignore} +0 -0
  85. /squirrels/{package_data → _package_data}/base_project/models/builds/build_example.yml +0 -0
  86. /squirrels/{package_data → _package_data}/base_project/models/dbviews/dbview_example.yml +0 -0
  87. /squirrels/{package_data → _package_data}/base_project/models/sources.yml +0 -0
  88. /squirrels/{package_data → _package_data}/base_project/seeds/seed_categories.csv +0 -0
  89. /squirrels/{package_data → _package_data}/base_project/seeds/seed_categories.yml +0 -0
  90. /squirrels/{package_data → _package_data}/base_project/seeds/seed_subcategories.csv +0 -0
  91. /squirrels/{package_data → _package_data}/base_project/seeds/seed_subcategories.yml +0 -0
  92. /squirrels/{package_data → _package_data}/base_project/squirrels.yml.j2 +0 -0
  93. /squirrels/{package_data → _package_data}/base_project/tmp/.gitignore +0 -0
  94. {squirrels-0.5.0b2.dist-info → squirrels-0.5.0b4.dist-info}/WHEEL +0 -0
  95. {squirrels-0.5.0b2.dist-info → squirrels-0.5.0b4.dist-info}/entry_points.txt +0 -0
  96. {squirrels-0.5.0b2.dist-info → squirrels-0.5.0b4.dist-info}/licenses/LICENSE +0 -0
dateutils/__init__.py CHANGED
@@ -1,460 +1,6 @@
1
- from typing import Sequence, Type
2
- from dataclasses import dataclass
3
- from datetime import date as Date, datetime
4
- from dateutil.relativedelta import relativedelta
5
- from abc import ABCMeta, abstractmethod
6
- from enum import Enum
7
-
8
-
9
- class DayOfWeek(Enum):
10
- Sunday = 0
11
- Monday = 1
12
- Tuesday = 2
13
- Wednesday = 3
14
- Thursday = 4
15
- Friday = 5
16
- Saturday = 6
17
-
18
- class Month(Enum):
19
- January = 1
20
- February = 2
21
- March = 3
22
- April = 4
23
- May = 5
24
- June = 6
25
- July = 7
26
- August = 8
27
- September = 9
28
- October = 10
29
- November = 11
30
- December = 12
31
-
32
-
33
- class DateModifier(metaclass=ABCMeta):
34
- """
35
- Interface for all Date modification classes, and declares a "modify" method
36
- """
37
-
38
- @abstractmethod
39
- def modify(self, date: Date) -> Date:
40
- """
41
- Method to be overwritten, modifies the input date
42
-
43
- Arguments:
44
- date: The input date to modify.
45
-
46
- Returns:
47
- The modified date.
48
- """
49
- pass
50
-
51
- def _get_date(self, datetype: Type, year: int, month: int, day: int) -> Date:
52
- return datetype(year, month, day)
53
-
54
-
55
- class _DayIdxOfCalendarUnit(DateModifier):
56
- """
57
- Interface for adjusting a date to some day of calendar unit
58
- """
59
- def __init__(self, idx: int) -> None:
60
- super().__init__()
61
- self.idx = idx
62
- if self.idx == 0:
63
- raise ValueError(f"For constructors of class names that start with DayIdxOf_, idx cannot be zero")
64
- self.incr = self.idx - 1 if self.idx > 0 else self.idx
65
-
66
-
67
- @dataclass
68
- class DayIdxOfMonthsCycle(_DayIdxOfCalendarUnit):
69
- """
70
- DateModifier class to get the idx-th day of a cycle of months for an input date
71
-
72
- Attributes:
73
- idx: 1 for first, 2 for second, etc. Or, -1 for last, -2 for second last, etc. Must not be 0
74
- num_months_in_cycle: 2 for one 6th of year, 3 for Quarter, 4 for one 3rd of year, 6 for half year, 12 for full year. Must fit evenly in 12
75
- first_month_of_cycle: The first month of months cycle of year. Default is January
76
- """
77
- _num_months_in_cycle: int
78
- _first_month_of_cycle: Month
79
-
80
- def __init__(self, idx: int, num_months_in_cycle: int, first_month_of_cycle: Month = Month.January) -> None:
81
- super().__init__(idx)
82
- self._num_months_in_cycle = num_months_in_cycle
83
- self._first_month_of_cycle = first_month_of_cycle
84
- if 12 % self._num_months_in_cycle != 0:
85
- raise ValueError(f"Value X must fit evenly in 12")
86
- self.first_month_of_first_cycle = (self._first_month_of_cycle.value - 1) % self._num_months_in_cycle + 1
87
-
88
- def modify(self, date: Date) -> Date:
89
- current_cycle = (date.month - self.first_month_of_first_cycle) % 12 // self._num_months_in_cycle
90
- first_month_of_curr_cycle = current_cycle * self._num_months_in_cycle + self.first_month_of_first_cycle
91
- year = date.year if date.month >= first_month_of_curr_cycle else date.year - 1
92
- first_day = self._get_date(type(date), year, first_month_of_curr_cycle, 1)
93
- ref_date = first_day if self.idx > 0 else first_day + relativedelta(months=self._num_months_in_cycle)
94
- return ref_date + relativedelta(days=self.incr)
95
-
96
-
97
- @dataclass
98
- class DayIdxOfYear(DayIdxOfMonthsCycle):
99
- """
100
- DateModifier class to get the idx-th day of year of an input date
101
-
102
- Attributes:
103
- idx: 1 for first, 2 for second, etc. Or, -1 for last, -2 for second last, etc. Must not be 0
104
- first_month_of_year: The first month of year. Default is January
105
- """
106
-
107
- def __init__(self, idx: int, first_month_of_year: Month = Month.January):
108
- super().__init__(idx, num_months_in_cycle=12, first_month_of_cycle=first_month_of_year)
109
-
110
-
111
- @dataclass
112
- class DayIdxOfQuarter(DayIdxOfMonthsCycle):
113
- """
114
- DateModifier class to get the idx-th day of quarter of an input date
115
-
116
- Attributes:
117
- idx: 1 for first, 2 for second, etc. Or, -1 for last, -2 for second last, etc. Must not be 0
118
- first_month_of_quarter: The first month of first quarter. Default is January
119
- """
120
-
121
- def __init__(self, idx: int, first_month_of_quarter: Month = Month.January):
122
- super().__init__(idx, num_months_in_cycle=3, first_month_of_cycle=first_month_of_quarter)
123
-
124
-
125
- @dataclass
126
- class DayIdxOfMonth(_DayIdxOfCalendarUnit):
127
- """
128
- DateModifier class to get the idx-th day of month of an input date
129
-
130
- Attributes:
131
- idx: 1 for first, 2 for second, etc. Or, -1 for last, -2 for second last, etc. Must not be 0
132
- """
133
-
134
- def __init__(self, idx: int) -> None:
135
- super().__init__(idx)
136
-
137
- def modify(self, date: Date) -> Date:
138
- first_day = self._get_date(type(date), date.year, date.month, 1)
139
- ref_date = first_day if self.idx > 0 else first_day + relativedelta(months=1)
140
- return ref_date + relativedelta(days=self.incr)
141
-
142
-
143
- @dataclass
144
- class DayIdxOfWeek(_DayIdxOfCalendarUnit):
145
- """
146
- DateModifier class to get the idx-th day of week of an input date
147
-
148
- Attributes:
149
- idx: 1 for first, 2 for second, etc. Or, -1 for last, -2 for second last, etc. Must not be 0
150
- first_day_of_week: The day of week identified as the "first". Default is Monday
151
- """
152
- _first_day_of_week: DayOfWeek
153
-
154
- def __init__(self, idx: int, first_day_of_week: DayOfWeek = DayOfWeek.Monday) -> None:
155
- super().__init__(idx)
156
- self._first_day_of_week = first_day_of_week
157
- self.first_dow_num = self._first_day_of_week.value
158
-
159
- def modify(self, date: Date) -> Date:
160
- distance_from_first_day = (1 + date.weekday() - self.first_dow_num) % 7
161
- total_incr = -distance_from_first_day + (7 if self.idx < 0 else 0) + self.incr
162
- return date + relativedelta(days=total_incr)
163
-
164
-
165
- class _OffsetUnits(DateModifier):
166
- """
167
- Abstract DateModifier class to offset an input date by some number of some calendar unit
168
- """
169
- def __init__(self, offset: int) -> None:
170
- super().__init__()
171
- self.offset = offset
172
-
173
-
174
- @dataclass
175
- class OffsetYears(_OffsetUnits):
176
- """
177
- DateModifier class to offset an input date by some number of years
178
-
179
- Attributes:
180
- offset: The number of years to offset the input date.
181
- """
182
-
183
- def __init__(self, offset: int) -> None:
184
- super().__init__(offset)
185
-
186
- def modify(self, date: Date) -> Date:
187
- return date + relativedelta(years=self.offset)
188
-
189
-
190
- @dataclass
191
- class OffsetMonths(_OffsetUnits):
192
- """
193
- DateModifier class to offset an input date by some number of months
194
-
195
- Attributes:
196
- offset: The number of months to offset the input date.
197
- """
198
-
199
- def __init__(self, offset: int) -> None:
200
- super().__init__(offset)
201
-
202
- def modify(self, date: Date) -> Date:
203
- return date + relativedelta(months=self.offset)
204
-
205
-
206
- @dataclass
207
- class OffsetWeeks(_OffsetUnits):
208
- """
209
- DateModifier class to offset an input date by some number of weeks
210
-
211
- Attributes:
212
- offset: The number of weeks to offset the input date.
213
- """
214
-
215
- def __init__(self, offset: int) -> None:
216
- super().__init__(offset)
217
-
218
- def modify(self, date: Date) -> Date:
219
- return date + relativedelta(weeks=self.offset)
220
-
221
-
222
- @dataclass
223
- class OffsetDays(_OffsetUnits):
224
- """
225
- DateModifier class to offset an input date by some number of days
226
-
227
- Attributes:
228
- offset: The number of days to offset the input date.
229
- """
230
-
231
- def __init__(self, offset: int) -> None:
232
- super().__init__(offset)
233
-
234
- def modify(self, date: Date) -> Date:
235
- return date + relativedelta(days=self.offset)
236
-
237
-
238
- @dataclass
239
- class DateModPipeline(DateModifier):
240
- """
241
- DateModifier class to apply a list of date modifiers to an input date
242
-
243
- Attributes:
244
- modifiers: The list of DateModifier's to apply in sequence.
245
- """
246
- _date_modifiers: Sequence[DateModifier]
247
-
248
- def __init__(self, date_modifiers: Sequence[DateModifier]) -> None:
249
- super().__init__()
250
- self._date_modifiers = tuple(date_modifiers)
251
-
252
- def modify(self, date: Date) -> Date:
253
- for modifier in self._date_modifiers:
254
- date = modifier.modify(date)
255
- return date
256
-
257
- def get_joined_modifiers(self, date_modifiers: Sequence[DateModifier]) -> Sequence[DateModifier]:
258
- """
259
- Create a new sequence of DateModifier by joining the date modifiers in this class
260
- with the input date_modifiers
261
-
262
- Arguments:
263
- date_modifiers: The new date modifier sequence to join
264
-
265
- Returns:
266
- A new sequence of DateModifier
267
- """
268
- joined_modifiers = tuple(self._date_modifiers) + tuple(date_modifiers)
269
- return joined_modifiers
270
-
271
- def with_more_modifiers(self, date_modifiers: Sequence[DateModifier]):
272
- """
273
- Create a new DateModPipeline with more date modifiers
274
-
275
- Arguments:
276
- date_modifiers: The additional date modifiers to add
277
-
278
- Returns:
279
- A new DateModPipeline
280
- """
281
- joined_modifiers = self.get_joined_modifiers(date_modifiers)
282
- return DateModPipeline(joined_modifiers)
283
-
284
- def get_date_list(self, start_date: Date, step: DateModifier) -> Sequence[Date]:
285
- """
286
- This method modifies the input date, and returns all dates from the input date to the modified date,
287
- incremented by a DateModifier step.
288
-
289
- If the step is positive and start date is less than end date, then it'll return an increasing list of
290
- dates starting from the start date. If the step is negative and start date is greater than end date,
291
- then it'll return a decreasing list of dates starting from the start date. Otherwise, an empty list
292
- is returned.
293
-
294
- Arguments:
295
- start_date: The input date (it's the first date in the output list if step moves towards end date)
296
- step: The increment to take (specified as an offset DateModifier). Offset cannot be zero
297
-
298
- Returns:
299
- A list of datetime objects
300
- """
301
- assert isinstance(step, _OffsetUnits)
302
- if step.offset == 0:
303
- raise ValueError(f"The length of 'step' must not be zero")
304
-
305
- output: Sequence[Date] = []
306
- end_date = self.modify(start_date)
307
- curr_date = start_date
308
- is_not_done_positive_step = lambda: curr_date <= end_date and step.offset > 0
309
- is_not_done_negative_step = lambda: curr_date >= end_date and step.offset < 0
310
- while is_not_done_positive_step() or is_not_done_negative_step():
311
- output.append(curr_date)
312
- curr_date = step.modify(curr_date)
313
- return output
314
-
315
-
316
- class _DateRepresentationModifier(metaclass=ABCMeta):
317
- """
318
- Abstract class for modifying other representations of dates (such as string or unix timestemp)
319
- """
320
- def __init__(self, date_modifiers: Sequence[DateModifier]):
321
- self.date_modifier = DateModPipeline(date_modifiers)
322
-
323
- @abstractmethod
324
- def with_more_modifiers(self, date_modifiers: Sequence[DateModifier]):
325
- pass
326
-
327
-
328
- @dataclass
329
- class DateStringModifier(_DateRepresentationModifier):
330
- """
331
- Class to modify a string representation of a date given a DateModifier
332
-
333
- Attributes:
334
- date_modifier: The DateModifier to apply on datetime objects
335
- date_format: Format of the output date string. Default is '%Y-%m-%d'
336
- """
337
- _date_modifiers: Sequence[DateModifier]
338
- _date_format: str
339
-
340
- def __init__(self, date_modifiers: Sequence[DateModifier], date_format: str = '%Y-%m-%d'):
341
- super().__init__(date_modifiers)
342
- self._date_format = date_format
343
-
344
- def with_more_modifiers(self, date_modifiers: Sequence[DateModifier]):
345
- """
346
- Create a new DateStringModifier with more date modifiers
347
-
348
- Arguments:
349
- date_modifiers: The additional date modifiers to add
350
-
351
- Returns:
352
- A new DateStringModifier
353
- """
354
- joined_modifiers = self.date_modifier.get_joined_modifiers(date_modifiers)
355
- return DateStringModifier(joined_modifiers, self._date_format)
356
-
357
- def _get_input_date_obj(self, date_str: str, input_format: str | None = None) -> Date:
358
- input_format = self._date_format if input_format is None else input_format
359
- return datetime.strptime(date_str, input_format).date()
360
-
361
- def modify(self, date_str: str, input_format: str | None = None) -> str:
362
- """
363
- Modifies the input date string with the date modifiers
364
-
365
- Arguments:
366
- date_str: The input date string
367
- input_format: The input date format. Defaults to the same as output date format
368
-
369
- Returns:
370
- The resulting date string
371
- """
372
- date_obj = self._get_input_date_obj(date_str, input_format)
373
- return self.date_modifier.modify(date_obj).strftime(self._date_format)
374
-
375
- def get_date_list(self, start_date_str: str, step: DateModifier, input_format: str | None = None) -> Sequence[str]:
376
- """
377
- This method modifies the input date string, and returns all dates as strings from the input date
378
- to the modified date, incremented by a DateModifier step.
379
-
380
- If the step is positive and start date is less than end date, then it'll return an increasing list of
381
- dates starting from the start date. If the step is negative and start date is greater than end date,
382
- then it'll return a decreasing list of dates starting from the start date. Otherwise, an empty list
383
- is returned.
384
-
385
- Arguments:
386
- start_date_str: The input date string (it's the first date in the output list if step moves towards end date)
387
- step: The increment to take (specified as an offset DateModifier). Offset cannot be zero
388
- input_format: The input date format. Defaults to the same as output date format
389
-
390
- Returns:
391
- A list of date strings
392
- """
393
- assert isinstance(step, _OffsetUnits)
394
- curr_date = self._get_input_date_obj(start_date_str, input_format)
395
- output = self.date_modifier.get_date_list(curr_date, step)
396
- return [x.strftime(self._date_format) for x in output]
397
-
398
-
399
- @dataclass
400
- class TimestampModifier(_DateRepresentationModifier):
401
- """
402
- Class to modify a numeric representation of a date (as Unix/Epoch/POSIX timestamp) given a DateModifier
403
-
404
- Attributes:
405
- date_modifier: The DateModifier to apply on datetime objects
406
- date_format: Format of the date string. Default is '%Y-%m-%d'
407
- """
408
- _date_modifiers: Sequence[DateModifier]
409
-
410
- def __init__(self, date_modifiers: Sequence[DateModifier]):
411
- super().__init__(date_modifiers)
412
-
413
- def with_more_modifiers(self, date_modifiers: Sequence[DateModifier]):
414
- """
415
- Create a new TimestampModifier with more date modifiers
416
-
417
- Arguments:
418
- date_modifiers: The additional date modifiers to add
419
-
420
- Returns:
421
- A new TimestampModifier
422
- """
423
- joined_modifiers = self.date_modifier.get_joined_modifiers(date_modifiers)
424
- return TimestampModifier(joined_modifiers)
425
-
426
- def modify(self, timestamp: float) -> float:
427
- """
428
- Modifies the input timestamp with the date modifiers
429
-
430
- Arguments:
431
- timestamp: The input timestamp as float
432
-
433
- Returns:
434
- The resulting timestamp
435
- """
436
- date_obj = datetime.fromtimestamp(timestamp).date()
437
- modified_date = self.date_modifier.modify(date_obj)
438
- modified_datetime = datetime.combine(modified_date, datetime.min.time())
439
- return modified_datetime.timestamp()
440
-
441
- def get_date_list(self, start_timestamp: float, step: DateModifier) -> Sequence[float]:
442
- """
443
- This method modifies the input timestamp, and returns all dates as timestampes/floats from the input date
444
- to the modified date, incremented by a DateModifier step.
445
-
446
- If the step is positive and start date is less than end date, then it'll return an increasing list of
447
- dates starting from the start date. If the step is negative and start date is greater than end date,
448
- then it'll return a decreasing list of dates starting from the start date. Otherwise, an empty list
449
- is returned.
450
-
451
- Arguments:
452
- start_timestamp: The input timestamp as float (it's the first date in the output list if step moves towards end date)
453
- step: The increment to take (specified as an offset DateModifier). Offset cannot be zero
454
-
455
- Returns:
456
- A list of timestamp as floats
457
- """
458
- curr_date = datetime.fromtimestamp(start_timestamp).date()
459
- output = self.date_modifier.get_date_list(curr_date, step)
460
- return [datetime.combine(x, datetime.min.time()).timestamp() for x in output]
1
+ from ._enums import DayOfWeekEnum, MonthEnum
2
+ from ._implementation import (
3
+ DayIdxOfMonthsCycle, DayIdxOfYear, DayIdxOfQuarter, DayIdxOfMonth, DayIdxOfWeek,
4
+ OffsetYears, OffsetMonths, OffsetWeeks, OffsetDays,
5
+ DateModPipeline, DateStringModifier, TimestampModifier
6
+ )
dateutils/_enums.py ADDED
@@ -0,0 +1,25 @@
1
+ from enum import Enum
2
+
3
+
4
+ class DayOfWeekEnum(Enum):
5
+ Sunday = 0
6
+ Monday = 1
7
+ Tuesday = 2
8
+ Wednesday = 3
9
+ Thursday = 4
10
+ Friday = 5
11
+ Saturday = 6
12
+
13
+ class MonthEnum(Enum):
14
+ January = 1
15
+ February = 2
16
+ March = 3
17
+ April = 4
18
+ May = 5
19
+ June = 6
20
+ July = 7
21
+ August = 8
22
+ September = 9
23
+ October = 10
24
+ November = 11
25
+ December = 12