-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AccountStats Plugin #349
AccountStats Plugin #349
Conversation
Related to #240 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Robust, I like it!
docs/configuration.rst
Outdated
~~~~~~~~~~~~~~~~~~~ | ||
|
||
The AccountStats plugin fetches all your loan history and provides statistics based on it. | ||
Current implementation sends a earnings summery Notification (see Notifications sections) every 24hr. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: Summary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My classic typo. Thanks!
modules/Configuration.py
Outdated
def get_plugins_config(): | ||
active_plugins = [] | ||
if config.has_option("BOT", "plugins"): | ||
active_plugins = config.get("BOT", "plugins").split(',') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably also want to strip values in case user puts spaces between plugin names.
|
||
# noinspection PyAttributeOutsideInit | ||
def init_db(self): | ||
self.db = sqlite3.connect(r'market_data\loan_history.sqlite3') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That r
looks like a typo, can't find reference to it in the docs.
Unless it means "relative" to current directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it indicates a raw string - so \ don't need to be escaped. :)
https://docs.python.org/2.0/ref/strings.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should use /
as path separator (work on any system). Or os.path.join()
.
@Evanito did you run the notification, was the total earnings calculation correct? |
- Created Plugin system, allowing user to define which Plugins are loaded from config file - Started implementation of AccountStats (fetching history)
Split Plugin events to before and after lending
Added notify event (every cycle at the moment)
Typo in docs
It resorts to scientific notation if you only get a few satoshi in the past 24hrs, but otherwise worked like a charm. I was unable to install |
Shouldn't you add the |
I was thinking to stop adding optional setting to the example config, what do you think? |
Cool that this has now been merged! I have added the relevant line in the config file but am not getting the notification (have telegram enabled). Am I supposed to wait 24 hours? Anything else to enable? |
Place the plugins line under config [BOT], the implementation is spamming you'll notice it's working |
Description
Implemented a plugins structure, first plugin is AccountStats.
AccountStats fetches your loans history and provides a Daily Earnings Notification
TESTING STAGE
In progress, currently seeing mismatching results when compared to exported CSV data.
Types of changes
Checklist: