openseries 1.7.8__tar.gz → 1.8.1__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.
@@ -0,0 +1,27 @@
1
+ # BSD 3-Clause License
2
+
3
+ ## Copyright (c) Captor Fund Management AB
4
+
5
+ Redistribution and use in source and binary forms, with or without modification, are
6
+ permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this list of
9
+ conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list
12
+ of conditions and the following disclaimer in the documentation and/or other
13
+ materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its contributors may be
16
+ used to endorse or promote products derived from this software without specific prior
17
+ written permission.
18
+
19
+ This software is provided by the copyright holders and contributors “as is” and any
20
+ express or implied warranties, including, but not limited to, the implied warranties of
21
+ merchantability and fitness for a particular purpose, are disclaimed. In no event shall
22
+ the copyright holder or contributors be liable for any direct, indirect, incidental,
23
+ special, exemplary, or consequential damages (including, but not limited to, procurement
24
+ of substitute goods or services; loss of use, data, or profits; or business interruption)
25
+ however caused and on any theory of liability, whether in contract, strict liability,
26
+ or tort (including negligence or otherwise) arising in any way out of the use of this
27
+ software, even if advised of the possibility of such damage.
@@ -1,37 +1,66 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: openseries
3
- Version: 1.7.8
3
+ Version: 1.8.1
4
4
  Summary: Tools for analyzing financial timeseries.
5
- Home-page: https://github.com/CaptorAB/openseries
6
- License: BSD-3-Clause
5
+ License: # BSD 3-Clause License
6
+
7
+ ## Copyright (c) Captor Fund Management AB
8
+
9
+ Redistribution and use in source and binary forms, with or without modification, are
10
+ permitted provided that the following conditions are met:
11
+
12
+ 1. Redistributions of source code must retain the above copyright notice, this list of
13
+ conditions and the following disclaimer.
14
+
15
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list
16
+ of conditions and the following disclaimer in the documentation and/or other
17
+ materials provided with the distribution.
18
+
19
+ 3. Neither the name of the copyright holder nor the names of its contributors may be
20
+ used to endorse or promote products derived from this software without specific prior
21
+ written permission.
22
+
23
+ This software is provided by the copyright holders and contributors “as is” and any
24
+ express or implied warranties, including, but not limited to, the implied warranties of
25
+ merchantability and fitness for a particular purpose, are disclaimed. In no event shall
26
+ the copyright holder or contributors be liable for any direct, indirect, incidental,
27
+ special, exemplary, or consequential damages (including, but not limited to, procurement
28
+ of substitute goods or services; loss of use, data, or profits; or business interruption)
29
+ however caused and on any theory of liability, whether in contract, strict liability,
30
+ or tort (including negligence or otherwise) arising in any way out of the use of this
31
+ software, even if advised of the possibility of such damage.
7
32
  Keywords: python,finance,fintech,data-science,timeseries,timeseries-data,timeseries-analysis,investment,investment-analysis,investing
8
33
  Author: Martin Karrin
9
34
  Author-email: martin.karrin@captor.se
35
+ Maintainer: Martin Karrin
36
+ Maintainer-email: martin.karrin@captor.se
10
37
  Requires-Python: >=3.10,<3.14
11
- Classifier: Development Status :: 5 - Production/Stable
12
- Classifier: Framework :: Pydantic
13
- Classifier: Intended Audience :: Financial and Insurance Industry
14
- Classifier: License :: OSI Approved :: BSD License
15
- Classifier: Natural Language :: English
16
- Classifier: Operating System :: OS Independent
17
- Classifier: Programming Language :: Python :: 3
18
38
  Classifier: Programming Language :: Python :: 3.10
19
39
  Classifier: Programming Language :: Python :: 3.11
20
40
  Classifier: Programming Language :: Python :: 3.12
21
41
  Classifier: Programming Language :: Python :: 3.13
42
+ Classifier: License :: OSI Approved :: BSD License
43
+ Classifier: Intended Audience :: Financial and Insurance Industry
22
44
  Classifier: Topic :: Office/Business :: Financial :: Investment
45
+ Classifier: Natural Language :: English
46
+ Classifier: Development Status :: 5 - Production/Stable
47
+ Classifier: Operating System :: OS Independent
48
+ Classifier: Framework :: Pydantic
23
49
  Requires-Dist: holidays (>=0.30,<1.0)
24
50
  Requires-Dist: numpy (>=1.23.2,<3.0.0)
25
- Requires-Dist: openpyxl (>=3.1.2,<4.0.0)
51
+ Requires-Dist: openpyxl (>=3.1.2,<5.0.0)
26
52
  Requires-Dist: pandas (>=2.1.2,<3.0.0)
27
- Requires-Dist: plotly (>=5.18.0,<6.0.0)
28
- Requires-Dist: pyarrow (>=14.0.2,<19.0.0)
53
+ Requires-Dist: plotly (>=5.18.0,<7.0.0)
54
+ Requires-Dist: pyarrow (>=14.0.2,<21.0.0)
29
55
  Requires-Dist: pydantic (>=2.5.2,<3.0.0)
30
- Requires-Dist: python-dateutil (>=2.8.2,<3.0.0)
56
+ Requires-Dist: python-dateutil (>=2.8.2,<4.0.0)
31
57
  Requires-Dist: requests (>=2.20.0,<3.0.0)
32
58
  Requires-Dist: scipy (>=1.11.4,<2.0.0)
33
59
  Requires-Dist: statsmodels (>=0.14.0,!=0.14.2,<1.0.0)
34
- Project-URL: Repository, https://github.com/CaptorAB/openseries
60
+ Project-URL: Homepage, https://github.com/CaptorAB/openseries
61
+ Project-URL: Issue Tracker, https://github.com/CaptorAB/openseries/issues
62
+ Project-URL: Release Notes, https://github.com/CaptorAB/openseries/releases
63
+ Project-URL: Source, https://github.com/CaptorAB/openseries
35
64
  Description-Content-Type: text/markdown
36
65
 
37
66
  <a href="https://captor.se/"><img src="https://sales.captor.se/captor_logo_sv_1600_icketransparent.png" alt="Captor Fund Management AB" width="81" height="100" align="left" float="right"/></a><br/>
@@ -43,6 +72,7 @@ Description-Content-Type: text/markdown
43
72
  [![PyPI version](https://img.shields.io/pypi/v/openseries.svg)](https://pypi.org/project/openseries/)
44
73
  [![Conda Version](https://img.shields.io/conda/vn/conda-forge/openseries.svg)](https://anaconda.org/conda-forge/openseries)
45
74
  [![Conda platforms](https://img.shields.io/conda/pn/conda-forge/openseries.svg)](https://anaconda.org/conda-forge/openseries)
75
+ [![Code Sample](https://img.shields.io/badge/-Code%20Sample-blue)](https://nbviewer.org/github/karrmagadgeteer2/NoteBook/blob/master/openseriesnotebook.ipynb)
46
76
  [![Python version](https://img.shields.io/pypi/pyversions/openseries.svg)](https://www.python.org/)
47
77
  [![GitHub Action Test Suite](https://github.com/CaptorAB/openseries/actions/workflows/test.yml/badge.svg)](https://github.com/CaptorAB/openseries/actions/workflows/test.yml)
48
78
  [![Coverage](https://cdn.jsdelivr.net/gh/CaptorAB/openseries@master/coverage.svg)](https://github.com/CaptorAB/openseries/actions/workflows/test.yml)
@@ -80,10 +110,10 @@ Install openseries and yfinance first.
80
110
  from openseries import OpenTimeSeries
81
111
  import yfinance as yf
82
112
 
83
- move=yf.Ticker("^MOVE")
113
+ move=yf.Ticker(ticker="^MOVE")
84
114
  history=move.history(period="max")
85
- series=OpenTimeSeries.from_df(history.loc[:, "Close"])
86
- _=series.set_new_label("ICE BofAML MOVE Index")
115
+ series=OpenTimeSeries.from_df(dframe=history.loc[:, "Close"])
116
+ _=series.set_new_label(lvl_zero="ICE BofAML MOVE Index")
87
117
  _,_=series.plot_series()
88
118
 
89
119
  ```
@@ -117,11 +147,6 @@ first indices 2006-01-03
117
147
  last indices 2023-04-05 2023-04-05
118
148
  ```
119
149
 
120
- ### Usage example on Jupyter Nbviewer
121
-
122
- [![nbviewer](https://raw.githubusercontent.com/jupyter/design/master/logos/Badges/nbviewer_badge.svg)](https://nbviewer.org/github/karrmagadgeteer2/NoteBook/blob/master/openseriesnotebook.ipynb)
123
-
124
-
125
150
  ## Development Instructions
126
151
 
127
152
  These instructions assume that you have a compatible Python version installed on
@@ -196,11 +221,12 @@ make lint
196
221
 
197
222
  ### On some files in the project
198
223
 
199
- | File | Description |
200
- |:-----------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
201
- | [series.py](https://github.com/CaptorAB/openseries/blob/master/openseries/series.py) | Defines the class _OpenTimeSeries_ for managing and analyzing a single timeseries. The module also defines a function `timeseries_chain` that can be used to chain two timeseries objects together. |
202
- | [frame.py](https://github.com/CaptorAB/openseries/blob/master/openseries/frame.py) | Defines the class _OpenFrame_ for managing a group of timeseries, and e.g. calculate a portfolio timeseries from a rebalancing strategy between timeseries. The module also defines functions to simulate, optimize, and plot portfolios. |
203
- | [simulation.py](https://github.com/CaptorAB/openseries/blob/master/openseries/simulation.py) | Defines the class _ReturnSimulation_ to create simulated financial timeseries. Used in the project's test suite |
224
+ | File | Description |
225
+ |:-----------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
226
+ | [series.py](https://github.com/CaptorAB/openseries/blob/master/openseries/series.py) | Defines the class _OpenTimeSeries_ for managing and analyzing a single timeseries. The module also defines a function `timeseries_chain` that can be used to chain two timeseries objects together. |
227
+ | [frame.py](https://github.com/CaptorAB/openseries/blob/master/openseries/frame.py) | Defines the class _OpenFrame_ for managing a group of timeseries, and e.g. calculate a portfolio timeseries from a rebalancing strategy between timeseries. |
228
+ | [portfoliotools.py](https://github.com/CaptorAB/openseries/blob/master/openseries/portfoliotools.py) | Defines functions to simulate, optimize, and plot portfolios. |
229
+ | [simulation.py](https://github.com/CaptorAB/openseries/blob/master/openseries/simulation.py) | Defines the class _ReturnSimulation_ to create simulated financial timeseries. Used in the project's test suite |
204
230
 
205
231
  ### Class methods used to construct objects.
206
232
 
@@ -7,6 +7,7 @@
7
7
  [![PyPI version](https://img.shields.io/pypi/v/openseries.svg)](https://pypi.org/project/openseries/)
8
8
  [![Conda Version](https://img.shields.io/conda/vn/conda-forge/openseries.svg)](https://anaconda.org/conda-forge/openseries)
9
9
  [![Conda platforms](https://img.shields.io/conda/pn/conda-forge/openseries.svg)](https://anaconda.org/conda-forge/openseries)
10
+ [![Code Sample](https://img.shields.io/badge/-Code%20Sample-blue)](https://nbviewer.org/github/karrmagadgeteer2/NoteBook/blob/master/openseriesnotebook.ipynb)
10
11
  [![Python version](https://img.shields.io/pypi/pyversions/openseries.svg)](https://www.python.org/)
11
12
  [![GitHub Action Test Suite](https://github.com/CaptorAB/openseries/actions/workflows/test.yml/badge.svg)](https://github.com/CaptorAB/openseries/actions/workflows/test.yml)
12
13
  [![Coverage](https://cdn.jsdelivr.net/gh/CaptorAB/openseries@master/coverage.svg)](https://github.com/CaptorAB/openseries/actions/workflows/test.yml)
@@ -44,10 +45,10 @@ Install openseries and yfinance first.
44
45
  from openseries import OpenTimeSeries
45
46
  import yfinance as yf
46
47
 
47
- move=yf.Ticker("^MOVE")
48
+ move=yf.Ticker(ticker="^MOVE")
48
49
  history=move.history(period="max")
49
- series=OpenTimeSeries.from_df(history.loc[:, "Close"])
50
- _=series.set_new_label("ICE BofAML MOVE Index")
50
+ series=OpenTimeSeries.from_df(dframe=history.loc[:, "Close"])
51
+ _=series.set_new_label(lvl_zero="ICE BofAML MOVE Index")
51
52
  _,_=series.plot_series()
52
53
 
53
54
  ```
@@ -81,11 +82,6 @@ first indices 2006-01-03
81
82
  last indices 2023-04-05 2023-04-05
82
83
  ```
83
84
 
84
- ### Usage example on Jupyter Nbviewer
85
-
86
- [![nbviewer](https://raw.githubusercontent.com/jupyter/design/master/logos/Badges/nbviewer_badge.svg)](https://nbviewer.org/github/karrmagadgeteer2/NoteBook/blob/master/openseriesnotebook.ipynb)
87
-
88
-
89
85
  ## Development Instructions
90
86
 
91
87
  These instructions assume that you have a compatible Python version installed on
@@ -160,11 +156,12 @@ make lint
160
156
 
161
157
  ### On some files in the project
162
158
 
163
- | File | Description |
164
- |:-----------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
165
- | [series.py](https://github.com/CaptorAB/openseries/blob/master/openseries/series.py) | Defines the class _OpenTimeSeries_ for managing and analyzing a single timeseries. The module also defines a function `timeseries_chain` that can be used to chain two timeseries objects together. |
166
- | [frame.py](https://github.com/CaptorAB/openseries/blob/master/openseries/frame.py) | Defines the class _OpenFrame_ for managing a group of timeseries, and e.g. calculate a portfolio timeseries from a rebalancing strategy between timeseries. The module also defines functions to simulate, optimize, and plot portfolios. |
167
- | [simulation.py](https://github.com/CaptorAB/openseries/blob/master/openseries/simulation.py) | Defines the class _ReturnSimulation_ to create simulated financial timeseries. Used in the project's test suite |
159
+ | File | Description |
160
+ |:-----------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
161
+ | [series.py](https://github.com/CaptorAB/openseries/blob/master/openseries/series.py) | Defines the class _OpenTimeSeries_ for managing and analyzing a single timeseries. The module also defines a function `timeseries_chain` that can be used to chain two timeseries objects together. |
162
+ | [frame.py](https://github.com/CaptorAB/openseries/blob/master/openseries/frame.py) | Defines the class _OpenFrame_ for managing a group of timeseries, and e.g. calculate a portfolio timeseries from a rebalancing strategy between timeseries. |
163
+ | [portfoliotools.py](https://github.com/CaptorAB/openseries/blob/master/openseries/portfoliotools.py) | Defines functions to simulate, optimize, and plot portfolios. |
164
+ | [simulation.py](https://github.com/CaptorAB/openseries/blob/master/openseries/simulation.py) | Defines the class _ReturnSimulation_ to create simulated financial timeseries. Used in the project's test suite |
168
165
 
169
166
  ### Class methods used to construct objects.
170
167
 
@@ -10,6 +10,7 @@ from .datefixer import (
10
10
  )
11
11
  from .frame import OpenFrame
12
12
  from .load_plotly import load_plotly_dict
13
+ from .owntypes import Self, ValueType
13
14
  from .portfoliotools import (
14
15
  constrain_optimized_portfolios,
15
16
  efficient_frontier,
@@ -19,12 +20,12 @@ from .portfoliotools import (
19
20
  )
20
21
  from .series import OpenTimeSeries, timeseries_chain
21
22
  from .simulation import ReturnSimulation
22
- from .types import ValueType
23
23
 
24
24
  __all__ = [
25
25
  "OpenFrame",
26
26
  "OpenTimeSeries",
27
27
  "ReturnSimulation",
28
+ "Self",
28
29
  "ValueType",
29
30
  "constrain_optimized_portfolios",
30
31
  "date_fix",