Commit Graph

24 Commits

Author SHA1 Message Date
Pratyush Shukla
13283fbfce CI listing quick fix (#6002)
* BIGGGG LINTING

* fixing lints

* fixing lints

* black

* very ruff

* no export

* fix hedge_view again

* lints

* platform lints

* lints

* black

* black it @hjoaquim

* fix some more linting

---------

Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt>
2024-01-26 17:08:42 +00:00
Colin Delahunty
1ca7fd9beb Improves the settings/userdata command, and upgrade ruff (#5359)
* Began the fax

* Bumped ruff

* Fixed a BUNCH of ruff errors

* Fixed a lot of ruff errors

* Simplify if statements

* Fixed black

* Updated some stuff

* Updated some stuff

* A lot more ruff fixes

* Added a fix

* Added a fix

* Fixed mypy

* Fixed some stuff

* Reverted one thing

* Small fix

* Small fix

* Small fix

* Added fix

* Added fix

* Update requirements
2023-08-22 20:11:48 +00:00
DidierRLopes
c40c3f7529 Creates a "--dev" flag that points to dev backend for testing with hub (#5319)
* check that routine title is valid

* more updates

* small fixes

* override local routine

* more improvements to routine logic

* --debug runs .dev

* few more updates

* small fix

* rename BASE_URL from ultima to ULTIMA_BASE_URL

* use debug from dataclasses instead of env since env doesn't get updated

* create --dev flag that can point to .dev backend

* merge conflits

* few changes, made it actually work 🤣

---------

Co-authored-by: tehcoderer <me@tehcoderer.com>
2023-08-13 23:20:07 -07:00
montezdesousa
2b52337da9 Keep hub sources updated and allow only available sources in the terminal (#4711)
* loop and update sources

* clean update sources dict

* use only allowed sources and update hub sources on login

* silently update hub

* ruff

* update only allowed sources now

* clean up some funcs

* fix dict on tests

* mypy

* remove unused method

* change class arg name sources_dict

* change attribute name in sources model

* remove allowed from SourcesModel

* change from user_choices to choices

* change default msg
2023-04-09 22:10:37 +00:00
montezdesousa
b4a7ed0ab4 Allow special characters in autocompletion and improve sources controller (#4698)
* allow empty spaces between sources commands

* allow special characters in autocomplete

* update parse input

* repeated character

* improve sources controller

* pylint?

* help was not working on set

* display file only if exists and has dat

* lowercase

* skip ultima test

* update default sources instead of replacing

* change var names

* revert, need to think better about this

* Update test_ultima_newsmonitor_model.py

---------

Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt>
2023-04-08 16:48:43 +00:00
montezdesousa
b9ea4d5cd0 Refactor sources menu (#4668)
* add data sources defaults to model

* fix f string

* refactor sources controller

* write sources to file

* write to user file

* add user data sources file inside OpenBBUserData

* append to user file, don't rewrite

* fix when sources folder does not exist

* codespell

* change func name

* change path to str

* ruff

* Add method to upload entire user field

* change clear func args

* update get_ordered_list_sources function

* move flatten

* move flatten

* change extend func name

* remove comment

* clean sources utils funcs

* mypy

* Update utils.py

* spacing

* docs

---------

Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt>
2023-04-05 12:13:34 +00:00
montezdesousa
f5230b26c0 Hub | sync, pull, sources and other updates (#4640)
* remove sync and pull

* ruff

* remove runtime fetch configs

* add comment

* reset when logged

* update translation yml file

* sdk regen

* print bold red messages if logout process fails

* fix sources not being applied

* handle bad json

* update hub links

* save terminal crash when sources file is broken

* add user defaults to gitignore

* actually no needed, will just be more specific about richstyle coming from hub

* black

* rewrite stdout

* fix session_model tests

* fix sdk session tests

* move paths

* remove duplicate line

* fix user being reset in test_logout_user test

* remove unecessary recording

* change colors msg

* remove repeated code
2023-04-03 13:49:53 +00:00
montezdesousa
b6b42afd71 Hub | Add colors, sources sync (#4546)
* fix show version

* update login prompt and account

* update set preference

* fix account controller

* block login/logout if not called from account

* change conditions to start terminal

* fix required args account model

* add not to login command

* pylint

* accounte controller messages

* set default user when logout

* logout then show menu

* remove unused functions

* fix logging bug

* ruff

* fix account unittests

* fix session unittests

* refactor colors preference

* no theme, no party

* add colors sync

* dynamic theme

* add comment

* add colors to settings

* ruff

* linting

* update menu desc

* adjust keys sync flag

* write to dotenv sync flag

* english

* fix pull command

* fix edge cases

* handle some errors

* small bug

* change func name

* pylint

* no light

* colors preview

* ruff

* fix login logout preferences

* ruff

* delete folder

* pylint

* default, custom, hub

* fix clear

* docstring

* add preference exceptions

* set only rich style

* request theme only if hub

* linting

* change guest msg

* add option to update chart style on the fly

* apply style

* rollback to old terminal style

* fix console theme

* remove print

* remove hub rich style

* ruff

* mypy

* black

* Hub | Add sources sync (#4565)

* Add sources model

* adapt session model

* fetch sources dict

* rename local funcs

* set sources inside current user

* set sources inside current user

* generate sources dict from hub

* fix dict generator

* send request to hub

* fix conflict

* revert datasources to develop head

* fix docstring

* avoid invalid patch types

* add default option to sources

* fix small bug on sources

* ruff

* black

* remove (

* mypy failing only on git

* ignore mypy

* pylint

* fix settings controller

* Tests: fix keys model writing to .env

* fix keys controller test writing to .env

* ruff

* Test: fix account controller

* Test: fix account controller pull

* Tests: fix launch terminal

* Test: add sources to user object

* Tests: fix clear cmd tests

* ruff

* revert core/sdk changes

* TerminalStyle docstring

* upload config docstring

* remove comment

* remove unecessary pylint disable

* revert openbb_terminal/sdk changes

* Terminal style docstring

* docstring

* remove unecessary changes

* add TODO

* add other todo

* Tests: prevent sync from being written in .env

* change clear msg

* display sources source on menu

* update settings controller

* display keys source

* black

* sync not needed for pull

* remove sync from apply configs

* change func name for consistency

* Update test_keys_model.py

* save rich style in user folder

* search recursively inside styles

* set hub theme by default

* remove debug print

* allow any plot style

* comment plotstyle sync for now

* fix sources set terminal to hub

* ruff

* rewrite cassettes

* remove repeated settings

* rewrite expected
2023-03-27 16:59:36 +00:00
montezdesousa
475ebb5acd [WIP] Migrate user, feature flags and configurations to dataclass (#4309)
* implement user and change is guest

* replace User methods

* move remaining functions to user

* fix bug

* portfolio test

* fix tests

* fix tests

* uncomment skip

* ruff

* start credentials model implementation

* change deault structure

* refacto quandl

* change default struct and file names

* bug

* start using global user

* add comments

* move update flair

* change cfg references in keys model

* reddit & fmp

* refactore additional keys

* remaing config keys

* remove unsude imports and fix hub keys

* ruff

* fix line too long

* unblock unittests

* fix keys model tests

* remove os patch

* fix account controller tests

* fix account controller tests

* fix account model

* account fixed

* fix user tests

* User Model

* User Model

* User Model

* Move session folder

* User Model : grouping the models

* User Model : fix bugs

* Config Plot + bug fix

* User Model : Refactoring plots

* Feature flags

* Remove dup

* clean comments a fix some vars

* fix feature flags controller

* refactor obbff from settings controller

* refactor a bunch of obbff variables

* fix bug blocking terminal

* fix integration tests

* refactor controllers with obbff

* refactor remaining ffs

* remove comments

* log not started

* mispelled variable

* set current user on local model

* User Model : moving files + updating

* User Preferences

* User : Refactor is_guest function + bug fix

* User : refactor is_guest function

* Fix conftest.py

* remove lost obbffs

* typo on fileoverwrite

* Plot config: move variables and start plot dpi

* User : tests

* refactor plot dpi references

* remove plot dpi imports

* refactor some config terminal leftover

* /account/sync : fix bug

* remove configs reload

* start path refactor

* installation paths vs user paths

* remove cfg_plot

* Tests : User Refactoring

* user prefix only for preferences

* user prefix only for preferences

* move user paths

* remove comment

* update apply remote configs

* fix tz not updating

* save some copys

* small fix

* create interface for credentials and preferences

* wrong docstrings fixed

* ruff core

* fix some pref setting

* login is better

* ruff

* ruff

* remove Literal

* add small comment

* Tests : User Refactoring

* Credentials Model : add DataBento

* Fix helper_funcs

* Fixing code

* Tests : fixing

* User Model : freezing the models

* Fixed Income + Databento

* Tests : fixing keys

* black

* ruff

* Tests : user model

* Tests : user model

* Fix linting

* Fix linting

* Linting

* Linting

* Fixing code and tests

* Fix tests

* mypy

* SDK

* Clean ruff cache

* Fix syntax issue

* Update fred_view

* Black

* Linting

* Update code

* Update tests

* Linting

* Linting

* Tests

* Black

* Linting

* Linting

* Mock os.listdir to avoid looking for file that doesnt exist

* Mock options paths

* lint

* Tests : fix

* Code : update

* Tests + Linting

* Tests

* Ruff

* Code : update

* Tests

* Code : update

* Fix workflow

* Code : update

---------

Co-authored-by: Chavithra PARANA <chavithra@gmail.com>
Co-authored-by: luqazino@gmail.com <luqazino@gmail.com>
Co-authored-by: James Maslek <jmaslek11@gmail.com>
2023-03-05 00:37:19 +01:00
james
0ed729e59e Merge branch 'develop' into feature/mypy10 2023-02-09 20:07:10 -05:00
montezdesousa
5953be0a42 Terminal authentication + keys/settings/routines (#4015)
* import order

* pylint

* no login, go to prompt

* add logout and whoami

* clear before prompt

* black

* these are unecessary

* error

* improve login prompt message

* login does not follow the controller pattern, so will name it differently

* nop

* move logout and change to results

* change return obj

* ruff

* pyupgrade

* remove user from statics

* message

* fetch configs at start

* remove unecessary func

* unecessary dataclass

* change user vars

* change login flow

* remote logout should not be used

* simplify

* fix double exit logout bug

* wrong exception

* apply keys

* change controller

* mypy

* save if no internet

* pylint

* logout everywhere

* breaking changes: move to local/hub models

* unused import

* fix logout bug

* whoami in guest mode

* add todo

* small bug guest allowed

* limit flair length

* fix bug on user pull

* logout working

* handle no connection

* logout user when logout

* remove keys push

* split logger funcs

* commant apply configs for now

* account to session

* rename user

* clear sounds better

* breaking changes: splitting guest from logged users

* pull imports up

* delete session model

* move logout func

* add ability to save and apply keys from remote

* no sensitive keys

* add support for feature flags

* unecessary print

* allow settings from differnt modules

* change setff to static

* change way to set ff

* fix bug in applying configs

* simplify obbff application

* bug on setting configs

* allow text ff

* obbff in settings

* add upload to cfg_plot 1

* data sources + backend

* this solves circular import?

* move create_session to model

* rever logs changes, not needed for now

* sync optionally

* outline account controller interface

* don't sync when guest

* block guest on installer

* or not and

* start routines

* fix bug on ff, settings

* is installer

* implementing chavi suggestions

* fix colors on installer prompt

* Logging login (#4046)

* basic logging for the login

* removing unused import

* hacking the logs custom filter to not filter the email

* black

* cooping with the new changes

* removing redundant method

* ruff

* ruff

* mypy

* SDK login (#4051)

* sdk login

* adding to the trail map

* minor fix

* improve sdk expirience

* adapting to new changes

* add docstrings

* block guest from account

* change guest msg

* change guest messages

* add sync on/off

* display onoff

* missing paragraph

* fix glitch on logout

* add sys clear

* filtering password

* filtering the email from user

* avoid writing to multiple log files if a user logs out

* fix bug, guest allowed in installer without connection

* log user on the sdk

* split login from lauch

* add clear and change messages on account

* docstrings

* start pull cmd

* change account menu description

* Fix login bug and decouple some logic (#4056)

* fix bug, guest allowed in installer without connection

* split login from lauch

* improvements on the sdk login

---------

Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt>

* sync fix

* change account controller description

* ruff

* add help on account cmds

* update clear prompt

* fix email not in jwt

* remove jwt from requiremnts

* pull command output

* remove character

* pull cmd when no data

* add space below whoami

* fix log filenotfound exception

* changed arg name

* delete .hist on logout

* add asteriscs to password

* pylint

* uncomment rich config

* show only diffs on pull

* black#

* warn when no changes#

* pull msg was switched

* apply diff only

* breaking?: strbool change

* reduce some code

* add timeout to hub requests

* black

* add remote logout

* success msg only if success

* remove colors in prompt

* update docstrings

* keep timeout outside funcs

* update clear

* clear and patch

* delete session

* routine upload

* move .his file to .openbb folder

* change apply configs

* refactor logout

* remove mixed portfolio changes

* fix bug in lock file

* fix bug pwidth, pheight are floats

* fix sources command & add choices

* refactor timezone setting

* userdata

* fix flair

* need to cast paths

* cast on diff

* fix flair default

* save session test

* get session

* data

* test remove

* test remove with assert

* add bad test cases

* add exception cases to unittests

* test remove cli hist file

* black

* test apply configs

* test apply with sync flag

* test create session, session model

* login tests, session model

* some tests for the hub_model

* test logout user

* black

* test clear vars, reload

* test create session

* update user-json to user

* update user class

* add user tests

* tests sdk session

* tests for hub_model

* start account controller tsts

* unused import

* tests account controller: clear, pull

* tests for session_controller

* logout success bugfix

* add integration test for account

* black

* move routine related commands to other PR

* test for the user input

* completed tests for session controller

* convert to hist to str)

* fix import errors

* ruff

* ruff tests

* fix qa

* add help to settings cmds

* ruff

* fix pull keys bug

* point to dev

* account model tests

* black

* ruff

* fix for empty feature settings

* ruff

* don't display config msg if wrong token

* general msgs

* remove print

* ruff

* fix sources not updated real time

* missing return doc

* add guest if no email

* Routine remote storage (#4143)

* add upload routine command

* remove prints

* point to local again

* add commands

* add delete

* add download command and upload 409

* list comprehension

* add download & save plus upload fixe

* add user uuid folder

* add list command

* ruff

* en.yml detail

* provide choices to delete & download

* add choices to upload

* change menu text

* starting adding unit tests

* bad english

* Update test_print_help.txt

* genearl msgs

* remove print

* add docstrings

* add unit tests to account controller

* change parser

* fix routine upload test

* add to be implemented tests hub

* add to be implemented tests local

* add total pages to title

* split list into model and view

* add docstring

* print msg if character

* add local model tests

* hub tests routines

* fix test

* point to dev and glob

* fix small bug on upload

* missing return

* log decorators missing

* black

* ruff

* change prompt display

* rewrite test

* rewrite expected

* rewrite call

* try passing git action

* change .yml everywhere

---------

Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt>
Co-authored-by: James Maslek <jmaslek11@gmail.com>
2023-02-09 13:35:44 +00:00
james
d73dfd3980 fixes for mypy 1.0 2023-02-08 19:14:25 -05:00
Colin Delahunty
ee34a1f278 Feature/add isort linter (#4114)
* Fixed isort

* Fixed issues

* FIxed linters

---------

Co-authored-by: James Maslek <jmaslek11@gmail.com>
2023-02-04 21:24:47 -05:00
Chavithra
cfde16e93d Core: move parse_simple_args (#3705)
* Moving Docker folder into Build

* Workflows : update Docker

* Docker : update compose image version

* Docker : fix volumes path

* Update core

* Update helper_funcs

* Update dashboards

* Update reports

* Update keys_controller

* Update settings_controller

* Update sources_controller

* Tests : fix __mock_parse_simple_args

* Reduce lines

Co-authored-by: James Maslek <jmaslek11@gmail.com>
2022-12-06 09:52:13 +01:00
Henrique Joaquim
46afc9eb8f Fix economy bugs (#3144)
* removed investing/investpy from sources and added #TODO

* removed Investing from events source

* fixed autocompletion for events

* added rank column based on the debt value

* removed options in treasury autocompletion

* fixed autocompletion to use comma instead of space

* fix verification for no data on economy/qa

* fix the exaple

* commented spreadso it don't show on auto completion

* preventing testst from using user default data sources and also removing unused env variables

* fixing tests

* adding empty line after uninterpreted args

* fixing tests

* improve the way fred works by not repeating the request. also, solve some issues with the plot - but not all

* Revert "improve the way fred works by not repeating the request. also, solve some issues with the plot - but not all"

This reverts commit 1094b454a5.

Co-authored-by: James Maslek <jmaslek11@gmail.com>
2022-11-07 14:58:09 +00:00
Colin Delahunty
3e792d75de Fixes Issues with the OSS Menu (#3238)
* Added docs and added auto suggest for country

* Fixes docs

* Added chavi fixes

* Reverted argument name change

* Added case fixing to countries

Co-authored-by: James Maslek <jmaslek11@gmail.com>
2022-11-04 10:19:37 -04:00
Chavithra
40e486f93b Moving portfolio and data_sources_default.json into openbb_terminal folder. (#2857)
* Move `portfolio` to `openbb_terminal\miscellaneous\portfolio_examples`

* Fixing build

* Portfolio : fixing path

* Add `data_sources_default.json`

Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt>
2022-10-17 15:04:51 +02:00
northern-64bit
28a0cfd2ee Improved auto completion (#2763)
* Adding improved auto complete to all menus

* Improve autocomplete

* Done

* Linting : fix unused imports

* Tests : fix help messages

* Fixing typing

* Tests : forex

* Tests: stocks

* Stocks/TA

* Linting

* Stocks/insider

* Portfolio/Broker/Degiro

* Linting

Co-authored-by: Chavithra PARANA <chavithra@gmail.com>
2022-10-11 16:07:24 +02:00
DidierRLopes
7979b1fc07 Add 3 Token Terminal commands (#2447)
* add crypto/ov/fun

* add tokenterminal to dependencies

* update website content

* add to main.yml

* fix tests

* add tests

* Update _index.md

* Update _index.md

* fix tests

* fix test

* List hint added

* improve code based on Jose input

* fix tests

* requirements for token terminal

* add source and fix source bug

* some improvements

* colors bars

* fix dependencies

* update kaleido version

* update setuptools for pkg_resources

* replace pkg_resources by importlib_metadata

* Added fixes

* Fixed tests

* fix stuff for Josecas

Co-authored-by: Colin Delahunty <72827203+colin99d@users.noreply.github.com>
Co-authored-by: colin99d <colin99delahunty@gmail.com>
2022-10-10 00:28:42 +02:00
James Simmons
2c94ef788c loading default first but if user data has sources then use that (#2718) 2022-10-05 17:49:15 -04:00
Om Gupta
26c14f262e New path for data_sources_default.json (#2646)
* create_data_source file

* add data_sources in user menu
2022-09-27 13:36:05 +01:00
DidierRLopes
f4bbcbc31c suggest data sources to use for a command (#2518)
Co-authored-by: Colin Delahunty <72827203+colin99d@users.noreply.github.com>
2022-09-14 15:17:01 +01:00
James Simmons
d6291ead84 Release/1.6.0 (#2106)
* Fixing paths for build procedure

* Adding back env file

* Updating pyproject and setup.nsi files for release

* Update version on feature_flags.py

* Fix default sources path not working in installers

* Fix crypto/ov/wf

* Remove old and slow tests from openbb scripts folder

* Adding a note about to explain that prediction is not available for Mac users

* Disabling prediction menu via env file

* Fix tkinter bug on windows ci by specifying the mpl backend

* Adding prediction back in and deleting previous comments about prediction not being available

Co-authored-by: Chavithra PARANA <chavithra@gmail.com>
Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com>
2022-07-21 00:19:13 -04:00
DidierRLopes
9e220e8f3c Creates a controller to specify sources (#2069)
* Add all data sources to data_sources_default.json so we can have a list in one place

* create menu to get and set data sources

* improve settings controller

* james request

* improve helper message

* minor improvement

* fix tests
2022-07-12 18:56:52 +01:00