-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework get_usage. Add get_usage_range. (#25)
* Remove need for call to login * Add util get_past_date * Add constants for intervals * Bump major version * Add credentials.json to gitignore * Update README to match refactored code
- Loading branch information
1 parent
35f2400
commit 9420af6
Showing
5 changed files
with
61 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
__version__ = "1.1.1" | ||
__version__ = "2.0.0" | ||
|
||
from .evergy import Evergy | ||
from .evergy import (DAY_INTERVAL, FIFTEEN_MINUTE_INTERVAL, HOUR_INTERVAL, | ||
Evergy) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from datetime import date, timedelta | ||
|
||
|
||
def get_past_date(days_back: int = 1) -> date: | ||
""" | ||
Get a date based on a number of days back from today | ||
:rtype: date | ||
:param days_back: The number of days back to get the date for | ||
:return: The date in the past | ||
""" | ||
return date.today() - timedelta(days=days_back) |