Commit Graph

4 Commits

Author SHA1 Message Date
Pratyush Shukla
540f578852 [Enhancement] ReferenceGenerator class in package_builder.py (#6179)
* fix docstrings in quantitative,technical,econometrics routers

* add reference generator class to create reference.json file in openbb/assets folder

* modify platform markdown generator script to not generate the reference.json file

* get properly formatted examples for the website

* modify get_field_type function

* remove TODO comment

* path change / to .

* remove extra '-' below 'Args' in function docstring

* get obbject extensions in extension_map.json

* skew in stats_router had extra . rip

* black

* extra space (sigh)

* modify get_provider_parameter_info func to use model_provider from provider interface

* update lock files

* black

* Revert "update lock files"

This reverts commit 13e7d8b280.

* add function to check all extensions are installed before the markdow generator runs

* better comment

* fix docstring

fix mypy

obbject description function

* black

* 'static

* remove duplicate standard params & data from reference data

add standard params & data fields while generating markdown files
2024-03-13 17:30:10 +00:00
montezdesousa
f328a45b95 [Feature] - refactor examples (#6154)
* remove auto examples and split python from api

* add missing exampels

* rebuild

* query params focstring

* black

* add scoped examples

* group model imports in the router

* unblock api

* fix

* classify examples

* fix package identation

* black sig

* fix indentation without linter

* fix python examples

* remove doc

* pylint

* again

* add model validators

* commodity, crypto, currency

* filter examples

* fix python examples

* fix filter and build

* undo toml change

* add comment

* oop

* comment

* typing

* lint

* Update router.py

* Update econometrics_router.py

* fix to_python

* to_python

* to_python

* black

* fix multiple line field descriptions

* remove circular import

* add missing import

* pass indent as object attr

* doc

* doc

* this looks better

* forgot this

* fix: new examples adapted

* fix prev commit

* avoid future problems

* Update ownership_router.py

* rebuild + remove todo

* make description mandatory for python examples

* simple indent

* append_examples func works for both website and docstring

* Add example unit tests

* Edit example unit tests

* fix validator

* this works

* fix to_python

* fix mandatory docstrings

* typing

* shorter error msgs

* economy router

* fix more examples

* more examples

* more examples

* more examples

* field desc

* minor fix

* fix etf examples

* handling types better

* lint

* rename method

* rename var

* docstring + move method

* typing

* prompt

* rebuild

* prompt fix in PythonEx

* fix examples without model

* example mock data

* add get_field_type func to get field data type

* panel data

* mock data

* fix

* fix

* docstring

* ohlcv

* pylint

* quantitaive router

* simplify mock data

* fix remaining quantitative routers

* a bit more flexibility for examples

* lint

* mock dat from sample

* docstring

* assertion

* bugfix

* minor fix

* technical

* fix integration tests

* fix docstring

* econometrics examples

* econometrics examples

* remove warning

* add technical examples

* fix bad examples

* fix more examples

* update test rules

* remoce old pydantic referenc

* fix bug in treasury prices

* fix quantitative examples

* discovery router

* equity shorts

* equity shorts

* fix currency pairs

* fix sec_router example

* fix panel data to support all funcs

* black

* more examples fixes

* simplify test

* rebuild

* test doc

* add provider to some ex

* ^

* last

* add provider

* rebuild

* working examples

* noqa

* pylint

* pylint

* clean

* minor fix

* fix test

* lint

* ruff

---------

Co-authored-by: Pratyush Shukla <ps4534@nyu.edu>
Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com>
2024-03-09 23:22:40 +00:00
Pratyush Shukla
577a42461d [Feature] - Platform V4 Markdown Generator V2 (#6094)
* add recent `openapi.json`

* fix data types in models

* removed `openapi.json`

* set default date value as None in PolygonCurrencyPairs class

* add function to generate reference.json file

* reworked function to improve readability

* reword function to add seo metadata

* add functions for creating markdown sections

* add code to extract data card markdown title

* add additional functions for generating index and data models file

* extract first sentence of the description for cards

* code cleanup and documentation

* linting

* linting polygon models

* add openbb import statement in create_reference_markdown_examples function

* add POST method functions

* cleanup; reworked generate_reference_index_files function

* moved development section to 7th position in the sidebar

* fix POST function params default value

add standard flag to QueryParams and Data fields

cleanup

* add type expansion from package_builder.MethodDefinition

* sort data models cards alphabetically

make printing less verbose

* make MAX_CARDS global

display less content in cards in Commannds section

* cleanup

* Remove '_' from the cards under Commands section

* " to ' in econometrics/causality

* replace ' with " in ReferenceCard for reference dir index files

* remove extra . from the quantile function description

* shoutout to @deeleeramone for finding POST method description bug!

* set correct value for standard field

* handle BaseModel types in provider data fields

* unit tests for the platform markdown generator v2

* yeet 'Default' and 'Optional' columns in the 'Data' section

* last minute bug fix

* add info for multiple symbols

* make multiple items info same as platform static

* organize sections properly

* sort reference sub-directories alphabetically

* extra space in 'OBBject extra' description

* add type expansion for fields with multiple items

POST method cleanup

---------

Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com>
Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com>
2024-02-27 11:20:28 +00:00
James Maslek
3cc6025ab4 Update the quantitative extension to make more sense (#6087)
* Split out a rolling submenu for the rolling functions

* Make a performance and a stats submenu.

* Test the statistics functions

* lint

* lint

* dupe test

* pylint

* ruff

* Try tests quick

* black magic signature funcs

* fix my custom tests

* Fix the existing imports/urls

* push the api update

* okay I figured out whats going on

* this should be all  of them

* Correct docstringing examples

---------

Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com>
Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com>
2024-02-21 17:09:57 +00:00