Skip to content
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

Auto Generate API Documentation #2360

Merged
merged 19 commits into from
Sep 20, 2022
Merged

Auto Generate API Documentation #2360

merged 19 commits into from
Sep 20, 2022

Conversation

colin99d
Copy link
Contributor

@colin99d colin99d commented Aug 18, 2022

Description

Automatically created documentation. #2352 needs to be merged before this PR is merged.

Things to think about:

  • Should this auto-delete old-docs every time run?

How has this been tested?

  • Please describe the tests that you ran to verify your changes.
  • Provide instructions so we can reproduce.
  • Please also list any relevant details for your test configuration.

Checklist:

Others

  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • My code passes all the checks pylint, flake8, black, ... To speed up development you should run pre-commit install.
  • New and existing unit tests pass locally with my changes. You can test this locally using pytest tests/....

@colin99d colin99d added the enhancement Enhancement label Aug 18, 2022
@colin99d colin99d marked this pull request as draft August 18, 2022 20:39
@colin99d colin99d mentioned this pull request Aug 19, 2022
10 tasks
@minhhoang1023
Copy link
Contributor

minhhoang1023 commented Sep 12, 2022

@colin99d Was trying out with pandas doc yesterday and as a reflection, there are a few things I want to change with the current doc format.

  1. Adding the entire path with default values: This makes it easy for people to copy and paste to their notebook or applications
  2. Add the kwargs chart=True for the View documentation

So the updated one would look something like this.

common.behavioural_analysis.sentiment_stats

To obtain charts, make sure to add chart=True as the last parameter

Getting underlying data

common.behavioural_analysis.sentiment_stats(ticker: str) -> Dict

Get sentiment stats [Source: finnhub]

Parameters
----------
ticker : str
    Ticker to get sentiment stats

Returns
-------
Dict
    Get sentiment stats

Getting charts

common.behavioural_analysis.sentiment_stats(ticker: str, export: str = '', view=True)

Sentiment stats which displays buzz, news score, articles last week, articles weekly average,
bullish vs bearish percentages, sector average bullish percentage, and sector average news score

Parameters
----------
ticker : str
    Ticker to get sentiment stats
export : str
    Format to export data

@colin99d
Copy link
Contributor Author

@minhhoang1023 got your changes in, I really like this new format. Feel free to let me know if you want any other changes.

@JerBouma
Copy link
Contributor

Does this feature a proper introduction page like https://openbb-finance.github.io/OpenBBTerminal/. If not, this has to be included. @minhhoang1023 @colin99d

@minhhoang1023
Copy link
Contributor

@colin99d This looks great Colin! 🚀 Once the API PR is merged into main, let's merge this bad boy too.

For this introduction page, @JerBouma and I discussed we can make it a different PR. We still need to add in pip install documentation, and it's not ready yet. On the other hand, the new API is ready and needs its own documentation

@colin99d colin99d marked this pull request as ready for review September 20, 2022 17:27
Copy link
Contributor

@andrewkenreich andrewkenreich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much wow. Good Code.

@jose-donato
Copy link
Contributor

Nice one colin

@colin99d colin99d merged commit 8731fbd into main Sep 20, 2022
@colin99d colin99d deleted the autodocs branch September 20, 2022 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants