diff --git a/api/load_share_price.py b/api/load_share_price.py index 80bf4a3..bd77ee4 100644 --- a/api/load_share_price.py +++ b/api/load_share_price.py @@ -9,42 +9,19 @@ import os import threading import time -import investpy -import pandas import requests -from currency_converter import CurrencyConverter +import yfinance from dotenv import load_dotenv def thread_function(s): - try: - search_result = investpy.search_quotes(text=s, products=['stocks'], countries=['germany'], n_results=1) - - recent_data = pandas.DataFrame(search_result.retrieve_recent_data()) - - stock_price = round(float(recent_data.iloc[-1]["Close"]), 2) + my_share_info = yfinance.Ticker(s) + my_share_data = my_share_info.info + if my_share_data['regularMarketPrice'] is not None: payload = { - "isin": s, - "price": round(float(stock_price), 2), - "time": datetime.datetime.now().strftime("%Y-%m-%dT%H:%M:%S.000Z") - } - - requests.post(os.getenv("API_URL") + '/symbol', json=payload, headers={'Authorization': 'Bearer ' + token}) - except RuntimeError: - my_converter = CurrencyConverter() - - search_result = investpy.search_quotes(text=s, products=['stocks'], n_results=1) - - currency = str(search_result.retrieve_currency()) - - recent_data = pandas.DataFrame(search_result.retrieve_recent_data()) - - stock_price = my_converter.convert(float(recent_data.iloc[-1]["Close"]), str(currency), 'EUR') - - payload = { - "isin": s, - "price": round(float(stock_price), 2), + "symbol": s, + "price": float(my_share_data['regularMarketPrice']), "time": datetime.datetime.now().strftime("%Y-%m-%dT%H:%M:%S.000Z") } diff --git a/api/requirements.txt b/api/requirements.txt index 40cba39..4768e71 100644 --- a/api/requirements.txt +++ b/api/requirements.txt @@ -12,7 +12,5 @@ pytest~=7.1.2 pytest-cov marshmallow~=3.15.0 faker~=13.7.0 -requests~=2.27.1 -investpy~=1.0.8 -pandas~=1.4.1 -currencyconverter~=0.16.12 \ No newline at end of file +yfinance~=0.1.70 +requests~=2.27.1 \ No newline at end of file diff --git a/documentation/Kurzdokumentation.docx b/documentation/Kurzdokumentation.docx new file mode 100644 index 0000000..82f2aa3 Binary files /dev/null and b/documentation/Kurzdokumentation.docx differ diff --git a/documentation/Kurzdokumentation.pdf b/documentation/Kurzdokumentation.pdf deleted file mode 100644 index cf4d102..0000000 Binary files a/documentation/Kurzdokumentation.pdf and /dev/null differ diff --git a/frontend/documentation/components/AppComponent.html b/frontend/documentation/components/AppComponent.html index 715fd3f..264b1f5 100644 --- a/frontend/documentation/components/AppComponent.html +++ b/frontend/documentation/components/AppComponent.html @@ -8,59 +8,395 @@ - - +
+
+ +
@@ -69,12 +405,9 @@
-
-
-
Router import to show router-outlet. Router Router import to show router-outlet. Router Application title. Application title.
- Metadata
-
+
@@ -87,6 +420,7 @@
+
-
selector
@@ -94,235 +428,130 @@
app-root
styleUrls
-
+ ./app.component.scss
app.component.scss
-
-
-
-
-
-
templateUrl
-
+ ./app.component.html
app.component.html
Index
-
-
-
-
-
-
-
- Properties
-
-
-
-
-
-
-
-
-
-
-
- Constructor
-
-
-
-
-
+
-
- constructor(router: Router, tokenStorage: TokenStorageService)
- Constructor
+
+
+
+
+
+
+
+
+
+
+
+ constructor(router: Router, tokenStorage: TokenStorageService)
+
+
+
+
+
+
+
+ Properties
+
+
+
-
+
+
+ isLoggedIn
+
+
+
+
+ isLoggedIn:
boolean
+
+
-
-
-
false
-
-
-
-
-
-
-
-
-
-
-
- Name
- Type
- Optional
- Description
-
-
- router
-
-
-
-
- Router
-
- No
-
-
-
-
-
-
-
- tokenStorage
-
-
-
-
- TokenStorageService
-
- No
-
-
-
-
-
- Properties
-
-
-
-
+
-
-
-
-
- isLoggedIn
-
-
-
-
-
+
+
- Default value :
- false
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
- showHeader
-
-
-
-
-
- Default value :
- false
-
-
-
-
-
-
showHeader:
boolean
+
-
-
+
-
-
-
-
- title
-
-
-
-
-
-
- Type :
- string
-
-
-
+
- Default value :
- 'Aktienbot'
-
+
+
+
+ Default value:
+ false
+
+
+
-
-
-
-
+
-
+
+
+
+ title:
string
+
+
+
+
+ Default value:
+ Aktienbot
+
+
+
+
+ import { Component } from '@angular/core';
+
- import { Component } from '@angular/core';
import { NavigationEnd, Router } from '@angular/router';
import { TokenStorageService } from './Services/token.service';
import { filter } from 'rxjs/operators';
@@ -377,60 +606,9 @@ export class AppComponent {
}
}
- <app-header *ngIf="showHeader"></app-header>
-<router-outlet></router-outlet>
-
./app.component.scss
-
-