opendate 0.1.8__tar.gz → 0.1.9__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.

Potentially problematic release.


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

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: opendate
3
- Version: 0.1.8
3
+ Version: 0.1.9
4
4
  Summary: Python business datetimes
5
5
  Home-page: https://github.com/bissli/opendate
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "opendate"
3
- version = "0.1.8"
3
+ version = "0.1.9"
4
4
  description = "Python business datetimes"
5
5
  authors = ["bissli <bissli.xyz@protonmail.com>"]
6
6
  readme = "README.md"
@@ -1,4 +1,4 @@
1
- __version__ = '0.1.8'
1
+ __version__ = '0.1.9'
2
2
 
3
3
  import datetime as _datetime
4
4
 
@@ -272,20 +272,22 @@ class NYSE(Entity):
272
272
  @staticmethod
273
273
  @lru_cache
274
274
  def business_days(begdate=BEGDATE, enddate=ENDDATE) -> set:
275
- return {d.date() for d in NYSE.calendar.valid_days(begdate, enddate)}
275
+ return {Date.instance(d.date())
276
+ for d in NYSE.calendar.valid_days(begdate, enddate)}
276
277
 
277
278
  @staticmethod
278
279
  @lru_cache
279
280
  def business_hours(begdate=BEGDATE, enddate=ENDDATE) -> dict:
280
281
  df = NYSE.calendar.schedule(begdate, enddate, tz=EST)
281
- open_close = [(o.to_pydatetime(), c.to_pydatetime())
282
+ open_close = [(DateTime.instance(o.to_pydatetime()),
283
+ DateTime.instance(c.to_pydatetime()))
282
284
  for o, c in zip(df.market_open, df.market_close)]
283
285
  return dict(zip(df.index.date, open_close))
284
286
 
285
287
  @staticmethod
286
288
  @lru_cache
287
289
  def business_holidays(begdate=BEGDATE, enddate=ENDDATE) -> set:
288
- return {d.date()
290
+ return {Date.instance(d.date())
289
291
  for d in map(pd.to_datetime, NYSE.calendar.holidays().holidays)
290
292
  if begdate <= d <= enddate}
291
293
 
File without changes
File without changes
File without changes