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

Upload routine to hub on stop #5077

Merged
merged 7 commits into from
May 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openbb_terminal/account/account_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def call_upload(self, other_args: List[str]):
else:
if ns_parser:
routine = read_routine(file_name=" ".join(ns_parser.file))
if routine:
if routine is not None:
description = " ".join(ns_parser.description)

name = (
Expand Down
2 changes: 1 addition & 1 deletion openbb_terminal/core/session/hub_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ def upload_routine(
description: str = "",
routine: str = "",
override: bool = False,
base_url=BASE_URL,
base_url: str = BASE_URL,
timeout: int = TIMEOUT,
) -> Optional[requests.Response]:
"""Send a routine to the server.
Expand Down
27 changes: 27 additions & 0 deletions openbb_terminal/parent_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
import openbb_terminal.core.session.local_model as Local
from openbb_terminal.core.completer.choices import build_controller_choice_map
from openbb_terminal.core.config.paths import HIST_FILE_PATH
from openbb_terminal.core.session import hub_model as Hub
from openbb_terminal.core.session.current_user import get_current_user, is_local
from openbb_terminal.core.session.routines_handler import read_routine
from openbb_terminal.cryptocurrency import cryptocurrency_helpers
from openbb_terminal.custom_prompt_toolkit import NestedCompleter
from openbb_terminal.decorators import log_start_end
Expand Down Expand Up @@ -692,6 +694,31 @@ def call_stop(self, _) -> None:
f"[green]Your routine has been recorded and saved here: {routine_file}[/green]\n"
)

if not is_local():
routine = read_routine(file_name=routine_file)
if routine is not None:
name = SESSION_RECORDED_NAME.split(sep=".openbb", maxsplit=-1)[0]
response = Hub.upload_routine(
auth_header=current_user.profile.get_auth_header(),
name=name,
routine=routine,
)
if response is not None and response.status_code == 409:
i = console.input(
"A routine with the same name already exists, "
"do you want to replace it? (y/n): "
)
console.print("")
if i.lower() in ["y", "yes"]:
response = Hub.upload_routine(
auth_header=current_user.profile.get_auth_header(),
name=name,
routine=routine,
override=True,
)
else:
console.print("[info]Aborted.[/info]")

# Clear session to be recorded again
RECORD_SESSION = False
SESSION_RECORDED = list()
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interactions:
Connection:
- keep-alive
User-Agent:
- Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.10; rv:86.1) Gecko/20100101 Firefox/86.1
- Mozilla/5.0 (Windows NT 6.1; WOW64; rv:86.1) Gecko/20100101 Firefox/86.1
method: GET
uri: https://api.ultimainsights.ai/v1/supportedTickers
response:
Expand Down Expand Up @@ -58,7 +58,7 @@ interactions:
Content-Type:
- text/html; charset=utf-8
Date:
- Thu, 25 May 2023 17:35:53 GMT
- Mon, 29 May 2023 17:46:11 GMT
Server:
- nginx/1.18.0 (Ubuntu)
Transfer-Encoding:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interactions:
Connection:
- keep-alive
User-Agent:
- Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:82.1) Gecko/20100101 Firefox/82.1
- Mozilla/5.0 (Windows NT 6.1; WOW64; rv:86.1) Gecko/20100101 Firefox/86.1
method: GET
uri: https://api.ultimainsights.ai/v1/supportedTickers
response:
Expand Down Expand Up @@ -58,7 +58,7 @@ interactions:
Content-Type:
- text/html; charset=utf-8
Date:
- Thu, 25 May 2023 17:36:08 GMT
- Mon, 29 May 2023 17:46:24 GMT
Server:
- nginx/1.18.0 (Ubuntu)
Transfer-Encoding:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,41 +1,35 @@

[purple][bold]Most Relevant Articles for AAPL - 2023-05-30[/bold][/purple]

[green]Regulatory Risk[/green] (The U.S. solicitor general has urged the Supreme Court to reject an appeal by Apple and Broadcom in their $1.1 billion trial loss to the California Institute of Technology (Caltech) over a patent infringement case. The solicitor general argued that the U.S. Court of Appeals for the Federal Circuit was correct in ruling that the companies could not seek to invalidate Caltech's patents in court after Apple failed to raise its invalidity arguments at the U.S. Patent Office. Caltech has also sued Microsoft, Samsung, Dell, and HP for infringing the same patents in separate cases that are still pending - Reuters (https://www.reuters.com/legal/biden-administration-urges-supreme-court-not-hear-apple-caltech-patent-case-2023-05-24/))


[green]Technology Risk[/green] (Apple has announced its annual developers conference WWDC, which will run from June 5 through June 9. The company is expected to announce iOS 17, macOS 14, watchOS 10, its long-awaited AR/VR headset, a 15-inch MacBook Air, and more. The conference will primarily be online, with 175 session videos available on the Apple Developer website and in the Apple Developer app for anyone to watch for free - MacRumors (https://www.macrumors.com/2023/05/23/apple-announces-wwdc-2023-schedule/))


[green]Financial Risk[/green] (Apple has signed a multi-billion dollar deal with Broadcom for 5G parts. The deal is expected to strengthen Apple's position in the 5G market and help the company compete with other smartphone manufacturers - Bloomberg (https://www.bloomberg.com/news/articles/2023-05-23/apple-signs-multibillion-dollar-deal-with-broadcom-for-5g-parts))
[green]Legal Risk[/green] (Apple and Fintiv are heading to a court-ordered settlement conference on June 8, 2023, to potentially settle Fintiv's claims that Apple infringed on its patents for technologies in its Apple Pay and Apple Wallet. The lawsuit, initially filed in December 2018, alleges that Apple infringed directly and indirectly on Fintiv's patent for technologies related to mobile wallet applications in its Apple Pay and Apple Wallet apps. The settlement conference would be the last step in the legal process before the case goes to trial, although the parties could still reach a settlement if a trial begins - Fox Business (https://www.foxbusiness.com/technology/apple-fintiv-negotiate-potential-settlement-patent-infringement-claims-apple-pay-apple-wallet))
------------------------

[purple][bold]News for Apple:[/bold][/purple]


> 2023-05-24 14:32:41 - Listen to Odd Lots on Apple Podcasts ... According to the Treasury Department, we're just days away from the so called "X-date" (when a US default would...
[purple]Relevancy score: 4.59/5 Stars[/purple]
[green]Financial Risk[/green] (Apple faces financial risks from currency fluctuations due to the fact that it operates in multiple countries and has to convert its profits into US dollars. Changes in consumer demand can also affect Apple's financial performance, as consumer preferences can shift quickly and unexpectedly. Apple also faces competition from other technology companies, which can lead to decreased market share and decreased profits. Additionally, Apple is exposed to the risk of litigation, which can lead to costly settlements or judgments. Finally, Apple is exposed to the risk of product recalls, which can lead to significant losses due to the cost of the recall and the potential for reputational damage.)
Read more: https://www.bloomberg.com/news/articles/2023-05-24/debt-ceiling-negotiations-biden-is-doing-the-one-thing-he-said-he-wouldn-t

> 2023-05-24 12:32:32 - Connectivity is crucial to digitalization, and networks are critical to connectivity. Huawei is committed to building intelligent cloud-networks that feature...
[purple]Relevancy score: 3.94/5 Stars[/purple]
[green]Competition Risk[/green] (Apple Inc. faces competition risk due to the presence of other technology companies in the market. These companies have a wide range of products and services that are similar to Apple's, and they are constantly innovating and introducing new products and services that can compete with Apple's offerings. Additionally, these companies have strong financial resources and can invest heavily in research and development, marketing, and other areas that can help them gain a competitive edge over Apple. Furthermore, these companies have a large customer base and can leverage their existing customer relationships to gain an advantage over Apple. Additionally, competitors are able to imitate the Company's product features and applications within their products or collaborate to offer solutions that are more competitive than those they currently offer. Furthermore, some competitors are able to provide content to users for free, which can be a major competitive advantage. Additionally, some carriers providing cellular network service for the Company's products offer financing, installment payment plans or subsidies for users’ purchases of the device. These companies also have access to third-party intellectual property, which can give them an advantage over Apple. Apple is also subject to risks related to the availability of third-party software applications and services.)
Read more: https://m.koreaherald.com/amp/view.php?ud=20230524000750

> 2023-05-24 20:32:23 - May 24 (Reuters) - The U.S. National Security Agency (NSA) said on ... U.S. Supreme Court to reject an appeal by Apple Inc and Broadcom Inc stemming from...
[purple]Relevancy score: 3.91/5 Stars[/purple]
[green]Cybersecurity Risk[/green] (Apple Inc. is vulnerable to malicious attacks, such as ransomware, phishing, malware, and other malicious activities, which can compromise the confidentiality, integrity, or availability of confidential information, disrupt normal business operations, and lead to financial losses.)
Read more: https://finance.yahoo.com/news/china-sponsored-cyber-actor-targeting-201347214.html

> 2023-05-24 17:32:49 - New Delhi, May 24 (PTI) LG Electronics India expects around 10 per cent growth in FY24 and exploring new business categories such healthcare and water...
[purple]Relevancy score: 3.88/5 Stars[/purple]
[green]Supply Chain Risk[/green] (Apple Inc. relies heavily on its suppliers to provide components for its products, many of which are located outside of the U.S. If any of these suppliers fail to deliver, it could cause delays in production, resulting in lost sales and revenue, product defects, customer dissatisfaction, and increased costs due to the need to source components from other suppliers.)
Read more: https://www.latestly.com/agency-news/latest-news-lg-india-expects-10-growth-exploring-new-business-categories-as-health-caresays-md-5151933.html

> 2023-05-24 19:32:43 - Amazon beats all 18 shareholder-led proposals at annual meeting ... The U.S. is on track to default on its payments obligations if the debt ceiling is not...
[purple]Relevancy score: 3.74/5 Stars[/purple]
> 2023-05-28 09:02:45 - Shares buyback programs are usually an indication that the company's leadership believes its shares are undervalued. Apple Increases Dividend. The company also...
[purple]Relevancy score: 4.6/5 Stars[/purple]
[green]Financial Risk[/green] (Apple faces financial risks from currency fluctuations due to the fact that it operates in multiple countries and has to convert its profits into US dollars. Changes in consumer demand can also affect Apple's financial performance, as consumer preferences can shift quickly and unexpectedly. Apple also faces competition from other technology companies, which can lead to decreased market share and decreased profits. Additionally, Apple is exposed to the risk of litigation, which can lead to costly settlements or judgments. Finally, Apple is exposed to the risk of product recalls, which can lead to significant losses due to the cost of the recall and the potential for reputational damage.)
Read more: https://finance.yahoo.com/news/white-house-criticizes-republicans-says-185039210.html
Read more: https://www.defenseworld.net/2023/05/28/apple-inc-nasdaqaapl-is-condor-capital-managements-5th-largest-position.html

> 2023-05-28 06:02:46 - San Francisco, May 28 (IANS) A federal judge in the US state of California has finally approved the $50 million lawsuit over Apple (NASDAQ: AAPL )'s flawed...
[purple]Relevancy score: 4.21/5 Stars[/purple]
[green]Legal Risk[/green] (Apple Inc. is exposed to legal risk from patent infringement lawsuits, copyright infringement lawsuits, antitrust investigations, and other claims, legal proceedings, and government investigations. These risks can arise from the use of technology or content owned by another party, or from accusations of anti-competitive practices. Apple is also subject to complex and changing laws and regulations worldwide, which can lead to potential liabilities, increased costs, and other adverse effects on the Company's business.)
Read more: https://in.investing.com/news/us-court-approves-apples-50-mn-butterfly-keyboard-settlement-3662392

> 2023-05-28 22:02:32 - Apple and Fintiv are heading to a court-ordered settlement conference in an effort to potentially settle Fintiv's claims that Apple infringed on its patents ...
[purple]Relevancy score: 4.16/5 Stars[/purple]
[green]Legal Risk[/green] (Apple Inc. is exposed to legal risk from patent infringement lawsuits, copyright infringement lawsuits, antitrust investigations, and other claims, legal proceedings, and government investigations. These risks can arise from the use of technology or content owned by another party, or from accusations of anti-competitive practices. Apple is also subject to complex and changing laws and regulations worldwide, which can lead to potential liabilities, increased costs, and other adverse effects on the Company's business.)
Read more: https://www.foxbusiness.com/technology/apple-fintiv-negotiate-potential-settlement-patent-infringement-claims-apple-pay-apple-wallet

> 2023-05-28 17:02:55 - There is unease over the role of big tech in digital markets and its ability to keep new players out, stifling innovation. India has already passed the ...
[purple]Relevancy score: 3.83/5 Stars[/purple]
[green]Political Risk[/green] (Apple Inc. is subject to political risk due to the possibility of changes in government regulations, trade policies, and tariffs. These changes can have a significant effect on Apple's operations, such as increasing production costs, limiting access to resources, and restricting access to certain markets. Additionally, changes in government regulations can also affect Apple's ability to protect its intellectual property, data, and privacy.)
Read more: https://economictimes.indiatimes.com/opinion/et-commentary/view-india-must-not-stifle-its-digital-market-with-regulations/articleshow/100574312.cms

> 2023-05-28 22:02:36 - Huawei has been using the same formula (crippled software/hardware, ... What is next, going to claim Nokia's lawsuit against Oppo is Apple's fault too?
[purple]Relevancy score: 3.83/5 Stars[/purple]
[green]Legal Risk[/green] (Apple Inc. is exposed to legal risk from patent infringement lawsuits, copyright infringement lawsuits, antitrust investigations, and other claims, legal proceedings, and government investigations. These risks can arise from the use of technology or content owned by another party, or from accusations of anti-competitive practices. Apple is also subject to complex and changing laws and regulations worldwide, which can lead to potential liabilities, increased costs, and other adverse effects on the Company's business.)
Read more: https://www.gsmarena.com/newscomm-58699.php


Loading