financedatabase 2.2.2__tar.gz → 2.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {financedatabase-2.2.2 → financedatabase-2.2.3}/PKG-INFO +5 -9
- {financedatabase-2.2.2 → financedatabase-2.2.3}/README.md +0 -5
- {financedatabase-2.2.2 → financedatabase-2.2.3}/financedatabase/__init__.py +1 -0
- {financedatabase-2.2.2 → financedatabase-2.2.3}/financedatabase/helpers.py +39 -3
- {financedatabase-2.2.2 → financedatabase-2.2.3}/pyproject.toml +9 -6
- {financedatabase-2.2.2 → financedatabase-2.2.3}/LICENSE +0 -0
- {financedatabase-2.2.2 → financedatabase-2.2.3}/financedatabase/Cryptos.py +0 -0
- {financedatabase-2.2.2 → financedatabase-2.2.3}/financedatabase/Currencies.py +0 -0
- {financedatabase-2.2.2 → financedatabase-2.2.3}/financedatabase/ETFs.py +0 -0
- {financedatabase-2.2.2 → financedatabase-2.2.3}/financedatabase/Equities.py +0 -0
- {financedatabase-2.2.2 → financedatabase-2.2.3}/financedatabase/Funds.py +0 -0
- {financedatabase-2.2.2 → financedatabase-2.2.3}/financedatabase/Indices.py +0 -0
- {financedatabase-2.2.2 → financedatabase-2.2.3}/financedatabase/Moneymarkets.py +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: financedatabase
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.3
|
|
4
4
|
Summary: This is a database of 300.000+ symbols containing Equities, ETFs, Funds, Indices, Currencies, Cryptocurrencies and Money Markets.
|
|
5
5
|
Home-page: https://www.jeroenbouma.com/
|
|
6
6
|
License: MIT
|
|
7
7
|
Author: Jeroen Bouma
|
|
8
|
-
Requires-Python: >=3.10,<3.
|
|
8
|
+
Requires-Python: >=3.10,<3.14
|
|
9
9
|
Classifier: Development Status :: 5 - Production/Stable
|
|
10
10
|
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
11
11
|
Classifier: License :: OSI Approved :: MIT License
|
|
@@ -15,8 +15,9 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.12
|
|
17
17
|
Classifier: Topic :: Office/Business :: Financial :: Investment
|
|
18
|
-
|
|
19
|
-
Requires-Dist:
|
|
18
|
+
Provides-Extra: financetoolkit
|
|
19
|
+
Requires-Dist: financetoolkit ; extra == "financetoolkit"
|
|
20
|
+
Requires-Dist: pandas[computation,excel,performance,plot] (>=2.2,<3.0)
|
|
20
21
|
Project-URL: Repository, https://github.com/JerBouma/FinanceDatabase
|
|
21
22
|
Description-Content-Type: text/markdown
|
|
22
23
|
|
|
@@ -24,7 +25,6 @@ Description-Content-Type: text/markdown
|
|
|
24
25
|
|
|
25
26
|
[](https://github.com/sponsors/JerBouma)
|
|
26
27
|
[](https://www.buymeacoffee.com/jerbouma)
|
|
27
|
-
[](https://twitter.com/JerBouma)
|
|
28
28
|
[](https://www.linkedin.com/in/boumajeroen/)
|
|
29
29
|
[](https://www.jeroenbouma.com/projects/financedatabase)
|
|
30
30
|
[](https://pypi.org/project/financedatabase/)
|
|
@@ -59,8 +59,6 @@ Some key statistics of the database:
|
|
|
59
59
|
|
|
60
60
|
The Finance Database is used within or referenced by:
|
|
61
61
|
|
|
62
|
-
<a href="https://openbb.co/"><img width="200" height="100" alt="OpenBB" src="https://github-production-user-asset-6210df.s3.amazonaws.com/46355364/265290693-cff58802-8f6e-48ec-9a5c-1a7795c3522c.png"></a>
|
|
63
|
-
<a href="https://app.noteable.io/f/242bc47d-9c85-4a30-b6e5-d7d201f6e2d6/Finance+Database.ipynb"><img alt="Noteable" width="200" height="100" src="https://github-production-user-asset-6210df.s3.amazonaws.com/46355364/265290704-1110feb5-3ad8-4f1c-b580-df661df4682d.png"></a>
|
|
64
62
|
<a href="https://algotrading101.com/learn/financedatabase-python-guide/"><img width="200" height="100" alt="AlgoTrading" src="https://github-production-user-asset-6210df.s3.amazonaws.com/46355364/265290727-4c113348-45fc-45fe-afb5-e043b738ee94.png"></a>
|
|
65
63
|
<a href="https://twitter.com/pyquantnews/status/1576185955677077504?lang=en"><img width="200" height="100" alt="PyQuantNews" src="https://github-production-user-asset-6210df.s3.amazonaws.com/46355364/265290754-8c9025fb-3830-4f41-95fd-e5e6d0f84758.png"></a>
|
|
66
64
|
<a href="https://alpha2phi.medium.com/investment-analysis-finance-database-61f47ecfe7ca"><img width="200" height="100" alt="Medium" src="https://github-production-user-asset-6210df.s3.amazonaws.com/46355364/265290765-dfbd0f4c-85eb-4de6-adba-345cb5189f31.png"></a>
|
|
@@ -606,10 +604,8 @@ This section is meant to thank those that contributed to the project. Looking to
|
|
|
606
604
|
If you have any questions about the FinanceDatabase or would like to share with me what you have been working on, feel free to reach out to me via:
|
|
607
605
|
|
|
608
606
|
- **Website**: https://jeroenbouma.com/
|
|
609
|
-
- **Twitter**: https://twitter.com/JerBouma
|
|
610
607
|
- **LinkedIn:** https://www.linkedin.com/in/boumajeroen/
|
|
611
608
|
- **Email:** jer.bouma@gmail.com
|
|
612
|
-
- **Discord:** add me on Discord **`JerBouma`**
|
|
613
609
|
|
|
614
610
|
f you'd like to support my efforts, either help me out via the [Contributing Guidelines](https://github.com/JerBouma/FinanceDatabase/blob/main/CONTRIBUTING.md) or [Buy me a Coffee](https://www.buymeacoffee.com/jerbouma).
|
|
615
611
|
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://github.com/sponsors/JerBouma)
|
|
4
4
|
[](https://www.buymeacoffee.com/jerbouma)
|
|
5
|
-
[](https://twitter.com/JerBouma)
|
|
6
5
|
[](https://www.linkedin.com/in/boumajeroen/)
|
|
7
6
|
[](https://www.jeroenbouma.com/projects/financedatabase)
|
|
8
7
|
[](https://pypi.org/project/financedatabase/)
|
|
@@ -37,8 +36,6 @@ Some key statistics of the database:
|
|
|
37
36
|
|
|
38
37
|
The Finance Database is used within or referenced by:
|
|
39
38
|
|
|
40
|
-
<a href="https://openbb.co/"><img width="200" height="100" alt="OpenBB" src="https://github-production-user-asset-6210df.s3.amazonaws.com/46355364/265290693-cff58802-8f6e-48ec-9a5c-1a7795c3522c.png"></a>
|
|
41
|
-
<a href="https://app.noteable.io/f/242bc47d-9c85-4a30-b6e5-d7d201f6e2d6/Finance+Database.ipynb"><img alt="Noteable" width="200" height="100" src="https://github-production-user-asset-6210df.s3.amazonaws.com/46355364/265290704-1110feb5-3ad8-4f1c-b580-df661df4682d.png"></a>
|
|
42
39
|
<a href="https://algotrading101.com/learn/financedatabase-python-guide/"><img width="200" height="100" alt="AlgoTrading" src="https://github-production-user-asset-6210df.s3.amazonaws.com/46355364/265290727-4c113348-45fc-45fe-afb5-e043b738ee94.png"></a>
|
|
43
40
|
<a href="https://twitter.com/pyquantnews/status/1576185955677077504?lang=en"><img width="200" height="100" alt="PyQuantNews" src="https://github-production-user-asset-6210df.s3.amazonaws.com/46355364/265290754-8c9025fb-3830-4f41-95fd-e5e6d0f84758.png"></a>
|
|
44
41
|
<a href="https://alpha2phi.medium.com/investment-analysis-finance-database-61f47ecfe7ca"><img width="200" height="100" alt="Medium" src="https://github-production-user-asset-6210df.s3.amazonaws.com/46355364/265290765-dfbd0f4c-85eb-4de6-adba-345cb5189f31.png"></a>
|
|
@@ -584,10 +581,8 @@ This section is meant to thank those that contributed to the project. Looking to
|
|
|
584
581
|
If you have any questions about the FinanceDatabase or would like to share with me what you have been working on, feel free to reach out to me via:
|
|
585
582
|
|
|
586
583
|
- **Website**: https://jeroenbouma.com/
|
|
587
|
-
- **Twitter**: https://twitter.com/JerBouma
|
|
588
584
|
- **LinkedIn:** https://www.linkedin.com/in/boumajeroen/
|
|
589
585
|
- **Email:** jer.bouma@gmail.com
|
|
590
|
-
- **Discord:** add me on Discord **`JerBouma`**
|
|
591
586
|
|
|
592
587
|
f you'd like to support my efforts, either help me out via the [Contributing Guidelines](https://github.com/JerBouma/FinanceDatabase/blob/main/CONTRIBUTING.md) or [Buy me a Coffee](https://www.buymeacoffee.com/jerbouma).
|
|
593
588
|
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
from pathlib import Path
|
|
4
4
|
|
|
5
5
|
import pandas as pd
|
|
6
|
-
from financetoolkit import Toolkit
|
|
7
6
|
|
|
8
7
|
file_path = Path(__file__).parent.parent / "compression"
|
|
9
8
|
DATA_REPO = (
|
|
@@ -127,13 +126,17 @@ class FinanceFrame(pd.DataFrame):
|
|
|
127
126
|
start_date: str | None = None,
|
|
128
127
|
end_date: str | None = None,
|
|
129
128
|
quarterly: bool = False,
|
|
129
|
+
use_cached_data: bool | str = False,
|
|
130
130
|
risk_free_rate: str = "10y",
|
|
131
131
|
benchmark_ticker: str | None = "SPY",
|
|
132
|
+
historical_source: str | None = None,
|
|
133
|
+
convert_currency: bool | None = None,
|
|
134
|
+
intraday_period: str | None = None,
|
|
132
135
|
rounding: int | None = 4,
|
|
133
136
|
remove_invalid_tickers: bool = False,
|
|
134
137
|
sleep_timer: bool | None = None,
|
|
135
138
|
progress_bar: bool = True,
|
|
136
|
-
)
|
|
139
|
+
):
|
|
137
140
|
"""
|
|
138
141
|
Convert the FinanceFrame to a Finance Toolkit object.
|
|
139
142
|
|
|
@@ -142,7 +145,11 @@ class FinanceFrame(pd.DataFrame):
|
|
|
142
145
|
performance and risk metrics, models, and technical indicators.
|
|
143
146
|
|
|
144
147
|
Args:
|
|
145
|
-
|
|
148
|
+
tickers (str or list): A string or a list of strings containing the company ticker(s). E.g. 'TSLA' or 'MSFT'
|
|
149
|
+
Find the tickers on a variety of websites or via the FinanceDatabase:
|
|
150
|
+
https://github.com/JerBouma/financedatabase
|
|
151
|
+
api_key (str): An API key from FinancialModelingPrep. Obtain one here:
|
|
152
|
+
https://www.jeroenbouma.com/fmp
|
|
146
153
|
start_date (str): A string containing the start date of the data. This needs to be formatted as YYYY-MM-DD.
|
|
147
154
|
The default is today minus 10 years which can be freely changed to extend the period.
|
|
148
155
|
end_date (str): A string containing the end date of the data. This needs to be formatted as YYYY-MM-DD.
|
|
@@ -150,11 +157,29 @@ class FinanceFrame(pd.DataFrame):
|
|
|
150
157
|
quarterly (bool): A boolean indicating whether to collect quarterly data. This defaults to False and thus
|
|
151
158
|
collects yearly financial statements. Note that historical data can still be collected for
|
|
152
159
|
any period and interval.
|
|
160
|
+
use_cached_data (bool or str): A boolean indicating whether to use cached data. This is useful when you
|
|
161
|
+
have collected data before and want to use this data again. If you want to use a specific location to
|
|
162
|
+
store the cached data, you can define this as a string, e.g. "datasets". Defaults to False.
|
|
153
163
|
risk_free_rate (str): A string containing the risk free rate. This can be 13w, 5y, 10y or 30y. This is
|
|
154
164
|
based on the US Treasury Yields and is used to calculate various ratios and Excess Returns.
|
|
155
165
|
benchmark_ticker (str): A string containing the benchmark ticker. Defaults to SPY (S&P 500). This is
|
|
156
166
|
meant to calculate ratios and indicators such as the CAPM and Jensen's Alpha but also serves as purpose to
|
|
157
167
|
give insights in the performance of a stock compared to a benchmark.
|
|
168
|
+
historical_source (str): A string containing the historical source. This can be either FinancialModelingPrep
|
|
169
|
+
or YahooFinance. Defaults to FinancialModelingPrep. It is automatically defined if you enter an API Key from
|
|
170
|
+
FinancialModelingPrep. You can overwrite this by filling this parameter. Note that for the Free plan
|
|
171
|
+
the amount of historical data is limited to 5 years. If you want to collect more data, you need to
|
|
172
|
+
upgrade to a paid plan.
|
|
173
|
+
convert_currency (bool): A boolean indicating whether to convert the currency of the financial statements to
|
|
174
|
+
match that of the related historical data. This is an important conversion when comparing the financial
|
|
175
|
+
statements between each ticker as well as for calculations that are done with the historical data.
|
|
176
|
+
If you are using a Free plan from FinancialModelingPrep, this will be set to False.
|
|
177
|
+
If you are using a Premium plan from FinancialModelingPrep, this will be set to True. Defaults to None
|
|
178
|
+
and can thus be overridden.
|
|
179
|
+
intraday_period (str): A string containing the intraday period. This can be 1min, 5min, 15min, 30min or 1hour.
|
|
180
|
+
This is used to collect intraday data. Note that this is only relevant if you have are looking to utilize
|
|
181
|
+
intraday data through the Toolkit and wish to access Risk, Performance and Technicals for very short
|
|
182
|
+
timeframes. Defaults to None which means it will not use intraday data.
|
|
158
183
|
rounding (int): An integer indicating the number of decimals to round the results to.
|
|
159
184
|
remove_invalid_tickers (bool): A boolean indicating whether to remove invalid tickers. Defaults to False.
|
|
160
185
|
sleep_timer (bool): Whether to set a sleep timer when the rate limit is reached. Note that this only works
|
|
@@ -166,6 +191,13 @@ class FinanceFrame(pd.DataFrame):
|
|
|
166
191
|
Toolkit:
|
|
167
192
|
A Finance Toolkit object.
|
|
168
193
|
"""
|
|
194
|
+
try:
|
|
195
|
+
from financetoolkit import Toolkit
|
|
196
|
+
except ImportError:
|
|
197
|
+
raise ImportError(
|
|
198
|
+
"To use the 'to_toolkit' functionality, it requires installation of the FinanceToolkit "
|
|
199
|
+
"Please use: \033[1m pip install 'financedatabase[financetoolkit]' \033[0m"
|
|
200
|
+
)
|
|
169
201
|
if api_key is None:
|
|
170
202
|
print(
|
|
171
203
|
"The parameter api_key is not set. Therefore, only historical data and "
|
|
@@ -183,8 +215,12 @@ class FinanceFrame(pd.DataFrame):
|
|
|
183
215
|
start_date=start_date,
|
|
184
216
|
end_date=end_date,
|
|
185
217
|
quarterly=quarterly,
|
|
218
|
+
use_cached_data=use_cached_data,
|
|
186
219
|
risk_free_rate=risk_free_rate,
|
|
187
220
|
benchmark_ticker=benchmark_ticker,
|
|
221
|
+
historical_source=historical_source,
|
|
222
|
+
convert_currency=convert_currency,
|
|
223
|
+
intraday_period=intraday_period,
|
|
188
224
|
rounding=rounding,
|
|
189
225
|
remove_invalid_tickers=remove_invalid_tickers,
|
|
190
226
|
sleep_timer=sleep_timer,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "financedatabase"
|
|
3
|
-
version = "2.2.
|
|
3
|
+
version = "2.2.3"
|
|
4
4
|
description = "This is a database of 300.000+ symbols containing Equities, ETFs, Funds, Indices, Currencies, Cryptocurrencies and Money Markets."
|
|
5
5
|
license = "MIT"
|
|
6
6
|
authors = ["Jeroen Bouma"]
|
|
@@ -22,15 +22,15 @@ classifiers = [
|
|
|
22
22
|
]
|
|
23
23
|
|
|
24
24
|
[tool.poetry.dependencies]
|
|
25
|
-
python = ">=3.10, <3.
|
|
26
|
-
financetoolkit = "
|
|
27
|
-
pandas = {extras = ["computation", "performance", "plot"
|
|
25
|
+
python = ">=3.10, <3.14"
|
|
26
|
+
financetoolkit = { version = "*", optional = true }
|
|
27
|
+
pandas = {version = "^2.2", extras = ["computation", "performance", "plot", "excel"]}
|
|
28
28
|
|
|
29
29
|
[tool.poetry.group.dev.dependencies]
|
|
30
30
|
pytest = "^6.2.2"
|
|
31
31
|
pylint = "2.17.0"
|
|
32
32
|
codespell = "^2.2.4"
|
|
33
|
-
black = "
|
|
33
|
+
black = ">=23.1,<25.0"
|
|
34
34
|
bandit = "^1.7.0"
|
|
35
35
|
pytest-mock = "^3.6.1"
|
|
36
36
|
pytest-recording = "^0.12.0"
|
|
@@ -39,6 +39,9 @@ ruff = "^0.0.256"
|
|
|
39
39
|
pytest-timeout = "^2.1.0"
|
|
40
40
|
pytest-recorder = "^0.2.1"
|
|
41
41
|
|
|
42
|
+
[tool.poetry.extras]
|
|
43
|
+
financetoolkit = ["financetoolkit"]
|
|
44
|
+
|
|
42
45
|
[build-system]
|
|
43
46
|
requires = ["setuptools<65.5.0", "poetry-core>=1.0.0"]
|
|
44
47
|
build-backend = "poetry.core.masonry.api"
|
|
@@ -46,7 +49,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
46
49
|
[tool.ruff]
|
|
47
50
|
line-length = 122
|
|
48
51
|
select = ["E", "W", "F", "Q", "W", "S", "UP", "I", "PD", "SIM", "PLC", "PLE", "PLR", "PLW"]
|
|
49
|
-
ignore = ["S105", "S106", "S107", "PLR0913"]
|
|
52
|
+
ignore = ["S105", "S106", "S107", "PLR0913", "PLR0912", "PLR0915"]
|
|
50
53
|
|
|
51
54
|
[tool.pylint]
|
|
52
55
|
max-line-length = 122
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|