aponyx 0.1.0__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.

Potentially problematic release.


This version of aponyx might be problematic. Click here for more details.

Files changed (38) hide show
  1. aponyx-0.1.0/LICENSE +21 -0
  2. aponyx-0.1.0/PKG-INFO +271 -0
  3. aponyx-0.1.0/README.md +212 -0
  4. aponyx-0.1.0/pyproject.toml +78 -0
  5. aponyx-0.1.0/src/aponyx/__init__.py +12 -0
  6. aponyx-0.1.0/src/aponyx/backtest/__init__.py +29 -0
  7. aponyx-0.1.0/src/aponyx/backtest/adapters.py +134 -0
  8. aponyx-0.1.0/src/aponyx/backtest/config.py +59 -0
  9. aponyx-0.1.0/src/aponyx/backtest/engine.py +256 -0
  10. aponyx-0.1.0/src/aponyx/backtest/metrics.py +216 -0
  11. aponyx-0.1.0/src/aponyx/backtest/protocols.py +101 -0
  12. aponyx-0.1.0/src/aponyx/config/__init__.py +77 -0
  13. aponyx-0.1.0/src/aponyx/data/__init__.py +31 -0
  14. aponyx-0.1.0/src/aponyx/data/cache.py +242 -0
  15. aponyx-0.1.0/src/aponyx/data/fetch.py +410 -0
  16. aponyx-0.1.0/src/aponyx/data/providers/__init__.py +13 -0
  17. aponyx-0.1.0/src/aponyx/data/providers/bloomberg.py +269 -0
  18. aponyx-0.1.0/src/aponyx/data/providers/file.py +86 -0
  19. aponyx-0.1.0/src/aponyx/data/sample_data.py +359 -0
  20. aponyx-0.1.0/src/aponyx/data/schemas.py +65 -0
  21. aponyx-0.1.0/src/aponyx/data/sources.py +135 -0
  22. aponyx-0.1.0/src/aponyx/data/validation.py +231 -0
  23. aponyx-0.1.0/src/aponyx/main.py +7 -0
  24. aponyx-0.1.0/src/aponyx/models/__init__.py +24 -0
  25. aponyx-0.1.0/src/aponyx/models/catalog.py +167 -0
  26. aponyx-0.1.0/src/aponyx/models/config.py +33 -0
  27. aponyx-0.1.0/src/aponyx/models/registry.py +200 -0
  28. aponyx-0.1.0/src/aponyx/models/signal_catalog.json +34 -0
  29. aponyx-0.1.0/src/aponyx/models/signals.py +221 -0
  30. aponyx-0.1.0/src/aponyx/persistence/__init__.py +20 -0
  31. aponyx-0.1.0/src/aponyx/persistence/json_io.py +130 -0
  32. aponyx-0.1.0/src/aponyx/persistence/parquet_io.py +174 -0
  33. aponyx-0.1.0/src/aponyx/persistence/registry.py +375 -0
  34. aponyx-0.1.0/src/aponyx/py.typed +0 -0
  35. aponyx-0.1.0/src/aponyx/visualization/__init__.py +20 -0
  36. aponyx-0.1.0/src/aponyx/visualization/app.py +37 -0
  37. aponyx-0.1.0/src/aponyx/visualization/plots.py +309 -0
  38. aponyx-0.1.0/src/aponyx/visualization/visualizer.py +242 -0
aponyx-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Stabile Frisur
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
aponyx-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,271 @@
1
+ Metadata-Version: 2.3
2
+ Name: aponyx
3
+ Version: 0.1.0
4
+ Summary: Systematic research framework for tactical credit strategies
5
+ Keywords: finance,investing
6
+ Author: Stabile Frisur
7
+ Author-email: Stabile Frisur <26568863+stabilefrisur@users.noreply.github.com>
8
+ License: MIT License
9
+
10
+ Copyright (c) 2025 Stabile Frisur
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+ Classifier: Development Status :: 3 - Alpha
30
+ Classifier: Intended Audience :: Financial and Insurance Industry
31
+ Classifier: License :: OSI Approved :: MIT License
32
+ Classifier: Programming Language :: Python :: 3
33
+ Classifier: Programming Language :: Python :: 3.13
34
+ Classifier: Topic :: Office/Business :: Financial :: Investment
35
+ Classifier: Typing :: Typed
36
+ Requires-Dist: pandas>=2.2.0
37
+ Requires-Dist: numpy>=2.0.0
38
+ Requires-Dist: pyarrow>=17.0.0
39
+ Requires-Dist: xbbg>=0.7.0
40
+ Requires-Dist: pytest>=8.0.0 ; extra == 'dev'
41
+ Requires-Dist: pytest-cov>=5.0.0 ; extra == 'dev'
42
+ Requires-Dist: ruff>=0.6.0 ; extra == 'dev'
43
+ Requires-Dist: black>=24.0.0 ; extra == 'dev'
44
+ Requires-Dist: mypy>=1.11.0 ; extra == 'dev'
45
+ Requires-Dist: pandas-stubs>=2.0.0 ; extra == 'dev'
46
+ Requires-Dist: plotly>=5.24.0 ; extra == 'viz'
47
+ Requires-Dist: streamlit>=1.39.0 ; extra == 'viz'
48
+ Requires-Dist: nbformat>=5.10.0 ; extra == 'viz'
49
+ Requires-Dist: ipykernel>=6.29.0 ; extra == 'viz'
50
+ Requires-Python: >=3.13
51
+ Project-URL: Changelog, https://github.com/stabilefrisur/aponyx/blob/master/CHANGELOG.md
52
+ Project-URL: Documentation, https://github.com/stabilefrisur/aponyx/blob/master/README.md
53
+ Project-URL: Homepage, https://github.com/stabilefrisur/aponyx
54
+ Project-URL: Issues, https://github.com/stabilefrisur/aponyx/issues
55
+ Project-URL: Repository, https://github.com/stabilefrisur/aponyx
56
+ Provides-Extra: dev
57
+ Provides-Extra: viz
58
+ Description-Content-Type: text/markdown
59
+
60
+ # Aponyx
61
+
62
+ [![PyPI version](https://img.shields.io/pypi/v/aponyx.svg)](https://pypi.org/project/aponyx/)
63
+ [![Python 3.13+](https://img.shields.io/badge/python-3.13+-blue.svg)](https://www.python.org/downloads/)
64
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
65
+
66
+ A modular Python framework for developing and backtesting systematic credit strategies.
67
+
68
+ > **⚠️ Bloomberg Terminal Required**: Data loading via `BloombergSource` requires an active Bloomberg Terminal session. File-based alternatives (`FileSource`) are also supported.
69
+
70
+ ## Quick Start
71
+
72
+ ### Installation from PyPI
73
+
74
+ ```bash
75
+ pip install aponyx
76
+
77
+ # Optional: visualization dependencies
78
+ pip install aponyx[viz]
79
+ ```
80
+
81
+ ### Installation from Source
82
+
83
+ Requires **Python 3.13+** and [`uv`](https://docs.astral.sh/uv/) for environment management.
84
+
85
+ ```bash
86
+ # Clone repository
87
+ git clone https://github.com/stabilefrisur/aponyx.git
88
+ cd aponyx
89
+
90
+ # Create virtual environment with uv
91
+ uv venv
92
+ source .venv/Scripts/activate # Windows: .venv\Scripts\activate
93
+
94
+ # Install dependencies
95
+ uv sync
96
+
97
+ # Install visualization dependencies (optional)
98
+ uv sync --extra viz
99
+
100
+ # Run examples
101
+ uv run python examples/backtest_demo.py
102
+ ```
103
+
104
+ ### Basic Usage
105
+
106
+ ```python
107
+ from aponyx.data import fetch_cdx, fetch_etf, FileSource, BloombergSource
108
+ from aponyx.models import compute_cdx_etf_basis, SignalConfig
109
+ from aponyx.backtest import run_backtest, BacktestConfig
110
+
111
+ # Load market data with validation (file-based)
112
+ cdx_df = fetch_cdx(FileSource("data/raw/cdx_data.parquet"), index_name="CDX_IG_5Y")
113
+ etf_df = fetch_etf(FileSource("data/raw/etf_data.parquet"), ticker="HYG")
114
+
115
+ # Or use Bloomberg Terminal (requires active session and xbbg package)
116
+ # source = BloombergSource()
117
+ # cdx_df = fetch_cdx(source, index_name="CDX_IG", tenor="5Y")
118
+ # etf_df = fetch_etf(source, ticker="HYG")
119
+
120
+ # Generate signal
121
+ signal_config = SignalConfig(lookback=20, min_periods=10)
122
+ signal = compute_cdx_etf_basis(cdx_df, etf_df, signal_config)
123
+
124
+ # Run backtest
125
+ backtest_config = BacktestConfig(entry_threshold=1.5, exit_threshold=0.75)
126
+ results = run_backtest(signal, cdx_df["spread"], backtest_config)
127
+ print(f"Sharpe Ratio: {results.metrics['sharpe_ratio']:.2f}")
128
+ ```
129
+
130
+ ## Project Structure
131
+
132
+ ```
133
+ aponyx/
134
+ ├── src/aponyx/ # Core framework
135
+ │ ├── data/ # Data loading, validation, transformation
136
+ │ ├── models/ # Signal generation for credit strategies
137
+ │ ├── backtest/ # Backtesting engine and metrics
138
+ │ ├── visualization/ # Plotly charts and Streamlit dashboard
139
+ │ ├── persistence/ # Parquet/JSON I/O and registry
140
+ │ └── config/ # Configuration and constants
141
+ ├── examples/ # Runnable demonstrations
142
+ ├── tests/ # Unit tests
143
+ └── docs/ # Architecture and design docs
144
+ ```
145
+
146
+ ### Key Layers
147
+
148
+ | Layer | Purpose | Entry Point |
149
+ |-------|---------|-------------|
150
+ | **Data** | Load, validate, transform market data | `aponyx.data` |
151
+ | **Models** | Generate signals for independent evaluation | `aponyx.models` |
152
+ | **Backtest** | Simulate execution and compute metrics | `aponyx.backtest` |
153
+ | **Visualization** | Interactive charts and dashboards | `aponyx.visualization` |
154
+ | **Persistence** | Save/load data with metadata registry | `aponyx.persistence` |
155
+
156
+ ## Documentation
157
+
158
+ ### Getting Started
159
+ - **[Python Guidelines](docs/python_guidelines.md)** - Code standards and best practices
160
+ - **[Examples](examples/)** - Runnable demos for each layer
161
+
162
+ ### Strategy & Architecture
163
+ - **[CDX Overlay Strategy](docs/cdx_overlay_strategy.md)** - Investment thesis and pilot implementation
164
+ - **[Documentation Structure](docs/documentation_structure.md)** - Single source of truth principles
165
+
166
+ ### Design Guides
167
+ - **[Logging Design](docs/logging_design.md)** - Logging conventions and metadata tracking
168
+ - **[Signal Registry Usage](docs/signal_registry_usage.md)** - Signal management and research workflow
169
+ - **[Visualization Design](docs/visualization_design.md)** - Chart architecture and integration patterns
170
+ - **[Caching Design](docs/caching_design.md)** - Cache layer architecture and usage
171
+ - **[Adding Data Providers](docs/adding_data_providers.md)** - Provider extension guide
172
+
173
+ ## Features
174
+
175
+ ✅ **Type-safe data loading** with schema validation
176
+ ✅ **Modular signal framework** with composable transformations
177
+ ✅ **Deterministic backtesting** with transaction cost modeling
178
+ ✅ **Interactive visualization** with Plotly charts (equity, signals, drawdown)
179
+ ✅ **Parquet-based persistence** with JSON metadata registry
180
+ ✅ **Comprehensive logging** with run metadata tracking
181
+ ✅ **Bloomberg Terminal integration** via xbbg wrapper (included by default, requires active Terminal session)
182
+
183
+ **Planned Features:**
184
+ - 🔜 Streamlit dashboard (stub exists, not yet implemented)
185
+ - 🔜 Advanced attribution charts (stubs with NotImplementedError)
186
+
187
+ ## Development
188
+
189
+ ### Running Tests
190
+
191
+ ```bash
192
+ # All tests
193
+ uv run pytest
194
+
195
+ # With coverage
196
+ uv run pytest --cov=aponyx --cov-report=term-missing
197
+
198
+ # Specific module
199
+ uv run pytest tests/models/
200
+ ```
201
+
202
+ ### Code Quality
203
+
204
+ ```bash
205
+ # Format code
206
+ uv run black src/ tests/
207
+
208
+ # Lint
209
+ uv run ruff check src/ tests/
210
+
211
+ # Type check
212
+ uv run mypy src/
213
+ ```
214
+
215
+ ### Examples
216
+
217
+ Each example demonstrates a specific layer with synthetic data:
218
+
219
+ ```bash
220
+ uv run python examples/data_demo.py # Data loading and transformation
221
+ uv run python examples/models_demo.py # Signal generation
222
+ uv run python examples/backtest_demo.py # Complete backtest workflow
223
+ uv run python examples/visualization_demo.py # Interactive charts (requires viz extra)
224
+ uv run python examples/persistence_demo.py # Data I/O and registry
225
+ ```
226
+
227
+ ## Design Principles
228
+
229
+ 1. **Modularity** - Separate data, models, backtest, and persistence layers
230
+ 2. **Reproducibility** - Deterministic outputs with seed control and metadata logging
231
+ 3. **Type safety** - Strict type hints and runtime validation
232
+ 4. **Simplicity** - Prefer functions over classes, explicit over implicit
233
+ 5. **Transparency** - Clear separation between strategy logic and infrastructure
234
+
235
+ ## Architecture Notes
236
+
237
+ ### Signal Convention
238
+
239
+ All model signals follow a **consistent sign convention**:
240
+ - **Positive values** → Long credit risk (buy CDX / sell protection)
241
+ - **Negative values** → Short credit risk (sell CDX / buy protection)
242
+
243
+ This convention ensures clear interpretation when evaluating signals individually
244
+ or when combining signals in future experiments.
245
+
246
+ ### Data Flow
247
+
248
+ ```
249
+ Raw Data (Parquet/CSV)
250
+
251
+ Data Layer (load, validate, transform)
252
+
253
+ Models Layer (signal computation)
254
+
255
+ Backtest Layer (simulation, metrics)
256
+
257
+ Persistence Layer (save results, metadata)
258
+ ```
259
+
260
+ ## License
261
+
262
+ MIT License - see [LICENSE](LICENSE) for details.
263
+
264
+ ## Contributing
265
+
266
+ This is a research project under active development. See [Python Guidelines](docs/python_guidelines.md) for code standards.
267
+
268
+ ---
269
+
270
+ **Maintained by stabilefrisur**
271
+ Version 0.1.0 | Last Updated: October 31, 2025
aponyx-0.1.0/README.md ADDED
@@ -0,0 +1,212 @@
1
+ # Aponyx
2
+
3
+ [![PyPI version](https://img.shields.io/pypi/v/aponyx.svg)](https://pypi.org/project/aponyx/)
4
+ [![Python 3.13+](https://img.shields.io/badge/python-3.13+-blue.svg)](https://www.python.org/downloads/)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+
7
+ A modular Python framework for developing and backtesting systematic credit strategies.
8
+
9
+ > **⚠️ Bloomberg Terminal Required**: Data loading via `BloombergSource` requires an active Bloomberg Terminal session. File-based alternatives (`FileSource`) are also supported.
10
+
11
+ ## Quick Start
12
+
13
+ ### Installation from PyPI
14
+
15
+ ```bash
16
+ pip install aponyx
17
+
18
+ # Optional: visualization dependencies
19
+ pip install aponyx[viz]
20
+ ```
21
+
22
+ ### Installation from Source
23
+
24
+ Requires **Python 3.13+** and [`uv`](https://docs.astral.sh/uv/) for environment management.
25
+
26
+ ```bash
27
+ # Clone repository
28
+ git clone https://github.com/stabilefrisur/aponyx.git
29
+ cd aponyx
30
+
31
+ # Create virtual environment with uv
32
+ uv venv
33
+ source .venv/Scripts/activate # Windows: .venv\Scripts\activate
34
+
35
+ # Install dependencies
36
+ uv sync
37
+
38
+ # Install visualization dependencies (optional)
39
+ uv sync --extra viz
40
+
41
+ # Run examples
42
+ uv run python examples/backtest_demo.py
43
+ ```
44
+
45
+ ### Basic Usage
46
+
47
+ ```python
48
+ from aponyx.data import fetch_cdx, fetch_etf, FileSource, BloombergSource
49
+ from aponyx.models import compute_cdx_etf_basis, SignalConfig
50
+ from aponyx.backtest import run_backtest, BacktestConfig
51
+
52
+ # Load market data with validation (file-based)
53
+ cdx_df = fetch_cdx(FileSource("data/raw/cdx_data.parquet"), index_name="CDX_IG_5Y")
54
+ etf_df = fetch_etf(FileSource("data/raw/etf_data.parquet"), ticker="HYG")
55
+
56
+ # Or use Bloomberg Terminal (requires active session and xbbg package)
57
+ # source = BloombergSource()
58
+ # cdx_df = fetch_cdx(source, index_name="CDX_IG", tenor="5Y")
59
+ # etf_df = fetch_etf(source, ticker="HYG")
60
+
61
+ # Generate signal
62
+ signal_config = SignalConfig(lookback=20, min_periods=10)
63
+ signal = compute_cdx_etf_basis(cdx_df, etf_df, signal_config)
64
+
65
+ # Run backtest
66
+ backtest_config = BacktestConfig(entry_threshold=1.5, exit_threshold=0.75)
67
+ results = run_backtest(signal, cdx_df["spread"], backtest_config)
68
+ print(f"Sharpe Ratio: {results.metrics['sharpe_ratio']:.2f}")
69
+ ```
70
+
71
+ ## Project Structure
72
+
73
+ ```
74
+ aponyx/
75
+ ├── src/aponyx/ # Core framework
76
+ │ ├── data/ # Data loading, validation, transformation
77
+ │ ├── models/ # Signal generation for credit strategies
78
+ │ ├── backtest/ # Backtesting engine and metrics
79
+ │ ├── visualization/ # Plotly charts and Streamlit dashboard
80
+ │ ├── persistence/ # Parquet/JSON I/O and registry
81
+ │ └── config/ # Configuration and constants
82
+ ├── examples/ # Runnable demonstrations
83
+ ├── tests/ # Unit tests
84
+ └── docs/ # Architecture and design docs
85
+ ```
86
+
87
+ ### Key Layers
88
+
89
+ | Layer | Purpose | Entry Point |
90
+ |-------|---------|-------------|
91
+ | **Data** | Load, validate, transform market data | `aponyx.data` |
92
+ | **Models** | Generate signals for independent evaluation | `aponyx.models` |
93
+ | **Backtest** | Simulate execution and compute metrics | `aponyx.backtest` |
94
+ | **Visualization** | Interactive charts and dashboards | `aponyx.visualization` |
95
+ | **Persistence** | Save/load data with metadata registry | `aponyx.persistence` |
96
+
97
+ ## Documentation
98
+
99
+ ### Getting Started
100
+ - **[Python Guidelines](docs/python_guidelines.md)** - Code standards and best practices
101
+ - **[Examples](examples/)** - Runnable demos for each layer
102
+
103
+ ### Strategy & Architecture
104
+ - **[CDX Overlay Strategy](docs/cdx_overlay_strategy.md)** - Investment thesis and pilot implementation
105
+ - **[Documentation Structure](docs/documentation_structure.md)** - Single source of truth principles
106
+
107
+ ### Design Guides
108
+ - **[Logging Design](docs/logging_design.md)** - Logging conventions and metadata tracking
109
+ - **[Signal Registry Usage](docs/signal_registry_usage.md)** - Signal management and research workflow
110
+ - **[Visualization Design](docs/visualization_design.md)** - Chart architecture and integration patterns
111
+ - **[Caching Design](docs/caching_design.md)** - Cache layer architecture and usage
112
+ - **[Adding Data Providers](docs/adding_data_providers.md)** - Provider extension guide
113
+
114
+ ## Features
115
+
116
+ ✅ **Type-safe data loading** with schema validation
117
+ ✅ **Modular signal framework** with composable transformations
118
+ ✅ **Deterministic backtesting** with transaction cost modeling
119
+ ✅ **Interactive visualization** with Plotly charts (equity, signals, drawdown)
120
+ ✅ **Parquet-based persistence** with JSON metadata registry
121
+ ✅ **Comprehensive logging** with run metadata tracking
122
+ ✅ **Bloomberg Terminal integration** via xbbg wrapper (included by default, requires active Terminal session)
123
+
124
+ **Planned Features:**
125
+ - 🔜 Streamlit dashboard (stub exists, not yet implemented)
126
+ - 🔜 Advanced attribution charts (stubs with NotImplementedError)
127
+
128
+ ## Development
129
+
130
+ ### Running Tests
131
+
132
+ ```bash
133
+ # All tests
134
+ uv run pytest
135
+
136
+ # With coverage
137
+ uv run pytest --cov=aponyx --cov-report=term-missing
138
+
139
+ # Specific module
140
+ uv run pytest tests/models/
141
+ ```
142
+
143
+ ### Code Quality
144
+
145
+ ```bash
146
+ # Format code
147
+ uv run black src/ tests/
148
+
149
+ # Lint
150
+ uv run ruff check src/ tests/
151
+
152
+ # Type check
153
+ uv run mypy src/
154
+ ```
155
+
156
+ ### Examples
157
+
158
+ Each example demonstrates a specific layer with synthetic data:
159
+
160
+ ```bash
161
+ uv run python examples/data_demo.py # Data loading and transformation
162
+ uv run python examples/models_demo.py # Signal generation
163
+ uv run python examples/backtest_demo.py # Complete backtest workflow
164
+ uv run python examples/visualization_demo.py # Interactive charts (requires viz extra)
165
+ uv run python examples/persistence_demo.py # Data I/O and registry
166
+ ```
167
+
168
+ ## Design Principles
169
+
170
+ 1. **Modularity** - Separate data, models, backtest, and persistence layers
171
+ 2. **Reproducibility** - Deterministic outputs with seed control and metadata logging
172
+ 3. **Type safety** - Strict type hints and runtime validation
173
+ 4. **Simplicity** - Prefer functions over classes, explicit over implicit
174
+ 5. **Transparency** - Clear separation between strategy logic and infrastructure
175
+
176
+ ## Architecture Notes
177
+
178
+ ### Signal Convention
179
+
180
+ All model signals follow a **consistent sign convention**:
181
+ - **Positive values** → Long credit risk (buy CDX / sell protection)
182
+ - **Negative values** → Short credit risk (sell CDX / buy protection)
183
+
184
+ This convention ensures clear interpretation when evaluating signals individually
185
+ or when combining signals in future experiments.
186
+
187
+ ### Data Flow
188
+
189
+ ```
190
+ Raw Data (Parquet/CSV)
191
+
192
+ Data Layer (load, validate, transform)
193
+
194
+ Models Layer (signal computation)
195
+
196
+ Backtest Layer (simulation, metrics)
197
+
198
+ Persistence Layer (save results, metadata)
199
+ ```
200
+
201
+ ## License
202
+
203
+ MIT License - see [LICENSE](LICENSE) for details.
204
+
205
+ ## Contributing
206
+
207
+ This is a research project under active development. See [Python Guidelines](docs/python_guidelines.md) for code standards.
208
+
209
+ ---
210
+
211
+ **Maintained by stabilefrisur**
212
+ Version 0.1.0 | Last Updated: October 31, 2025
@@ -0,0 +1,78 @@
1
+ [project]
2
+ name = "aponyx"
3
+ description = "Systematic research framework for tactical credit strategies"
4
+ version = "0.1.0"
5
+ readme = "README.md"
6
+ license = {file = "LICENSE"}
7
+ authors = [
8
+ { name = "Stabile Frisur", email = "26568863+stabilefrisur@users.noreply.github.com" }
9
+ ]
10
+ requires-python = ">=3.13"
11
+ keywords = [
12
+ "finance",
13
+ "investing",
14
+ ]
15
+ classifiers = [
16
+ "Development Status :: 3 - Alpha",
17
+ "Intended Audience :: Financial and Insurance Industry",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.13",
21
+ "Topic :: Office/Business :: Financial :: Investment",
22
+ "Typing :: Typed",
23
+ ]
24
+ dependencies = [
25
+ "pandas>=2.2.0",
26
+ "numpy>=2.0.0",
27
+ "pyarrow>=17.0.0",
28
+ "xbbg>=0.7.0",
29
+ ]
30
+
31
+ [project.urls]
32
+ Homepage = "https://github.com/stabilefrisur/aponyx"
33
+ Repository = "https://github.com/stabilefrisur/aponyx"
34
+ Documentation = "https://github.com/stabilefrisur/aponyx/blob/master/README.md"
35
+ Issues = "https://github.com/stabilefrisur/aponyx/issues"
36
+ Changelog = "https://github.com/stabilefrisur/aponyx/blob/master/CHANGELOG.md"
37
+
38
+ [build-system]
39
+ requires = ["uv_build>=0.9.5,<0.10.0"]
40
+ build-backend = "uv_build"
41
+
42
+ [tool.uv.build-backend]
43
+ # optional overrides; defaults expect a single module under src/<name>
44
+ module-root = "src"
45
+
46
+ [project.optional-dependencies]
47
+ dev = [
48
+ "pytest>=8.0.0",
49
+ "pytest-cov>=5.0.0",
50
+ "ruff>=0.6.0",
51
+ "black>=24.0.0",
52
+ "mypy>=1.11.0",
53
+ "pandas-stubs>=2.0.0",
54
+ ]
55
+ viz = [
56
+ "plotly>=5.24.0",
57
+ "streamlit>=1.39.0",
58
+ "nbformat>=5.10.0",
59
+ "ipykernel>=6.29.0",
60
+ ]
61
+
62
+ [tool.pytest.ini_options]
63
+ pythonpath = "src"
64
+ testpaths = ["tests"]
65
+
66
+ [tool.ruff]
67
+ line-length = 100
68
+ target-version = "py313"
69
+
70
+ [tool.black]
71
+ line-length = 100
72
+ target-version = ["py313"]
73
+
74
+ [tool.mypy]
75
+ python_version = "3.13"
76
+ strict = true
77
+ warn_return_any = true
78
+ warn_unused_configs = true
@@ -0,0 +1,12 @@
1
+ """
2
+ Aponyx - Systematic Macro Credit Strategy Framework.
3
+
4
+ A modular Python framework for developing and backtesting systematic credit strategies.
5
+ """
6
+
7
+ __version__ = "0.1.0"
8
+
9
+
10
+ def hello() -> str:
11
+ """Return greeting message."""
12
+ return "Hello from aponyx!"
@@ -0,0 +1,29 @@
1
+ """
2
+ Backtesting engine for CDX overlay strategy.
3
+
4
+ This module provides a lightweight backtesting framework optimized for
5
+ credit index strategies. The design prioritizes transparency and extensibility,
6
+ with clean interfaces that can wrap more powerful libraries later.
7
+
8
+ Core Components
9
+ ---------------
10
+ - engine: Position generation and P&L simulation
11
+ - metrics: Performance and risk statistics
12
+ - config: Backtest parameters and constraints
13
+ - protocols: Abstract interfaces for extensibility
14
+ """
15
+
16
+ from .config import BacktestConfig
17
+ from .engine import run_backtest, BacktestResult
18
+ from .metrics import compute_performance_metrics, PerformanceMetrics
19
+ from .protocols import BacktestEngine, PerformanceCalculator
20
+
21
+ __all__ = [
22
+ "BacktestConfig",
23
+ "run_backtest",
24
+ "BacktestResult",
25
+ "compute_performance_metrics",
26
+ "PerformanceMetrics",
27
+ "BacktestEngine",
28
+ "PerformanceCalculator",
29
+ ]