perfattr 0.1.0a1__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.
Files changed (27) hide show
  1. perfattr-0.1.0a1/.gitignore +64 -0
  2. perfattr-0.1.0a1/LICENSE +21 -0
  3. perfattr-0.1.0a1/PKG-INFO +77 -0
  4. perfattr-0.1.0a1/README.md +49 -0
  5. perfattr-0.1.0a1/docs/specification.md +552 -0
  6. perfattr-0.1.0a1/pyproject.toml +86 -0
  7. perfattr-0.1.0a1/src/perfattr/__init__.py +16 -0
  8. perfattr-0.1.0a1/src/perfattr/attribution.py +763 -0
  9. perfattr-0.1.0a1/src/perfattr/py.typed +1 -0
  10. perfattr-0.1.0a1/tests/fixtures/README.md +29 -0
  11. perfattr-0.1.0a1/tests/fixtures/linking_boundaries/benchmark.csv +5 -0
  12. perfattr-0.1.0a1/tests/fixtures/linking_boundaries/expected_horizon.csv +3 -0
  13. perfattr-0.1.0a1/tests/fixtures/linking_boundaries/expected_period_detail.csv +5 -0
  14. perfattr-0.1.0a1/tests/fixtures/linking_boundaries/portfolio.csv +5 -0
  15. perfattr-0.1.0a1/tests/fixtures/multi_period_linking/benchmark.csv +5 -0
  16. perfattr-0.1.0a1/tests/fixtures/multi_period_linking/expected_horizon.csv +3 -0
  17. perfattr-0.1.0a1/tests/fixtures/multi_period_linking/expected_period_detail.csv +5 -0
  18. perfattr-0.1.0a1/tests/fixtures/multi_period_linking/portfolio.csv +5 -0
  19. perfattr-0.1.0a1/tests/fixtures/single_period_authoritative/benchmark.csv +2 -0
  20. perfattr-0.1.0a1/tests/fixtures/single_period_authoritative/expected_period_detail.csv +3 -0
  21. perfattr-0.1.0a1/tests/fixtures/single_period_authoritative/portfolio.csv +3 -0
  22. perfattr-0.1.0a1/tests/fixtures/single_period_derived/benchmark.csv +4 -0
  23. perfattr-0.1.0a1/tests/fixtures/single_period_derived/expected_period_detail.csv +6 -0
  24. perfattr-0.1.0a1/tests/fixtures/single_period_derived/portfolio.csv +5 -0
  25. perfattr-0.1.0a1/tests/test_attribution.py +261 -0
  26. perfattr-0.1.0a1/tests/test_fixtures.py +290 -0
  27. perfattr-0.1.0a1/tests/test_package.py +8 -0
@@ -0,0 +1,64 @@
1
+ # Generated project outputs
2
+ /.cache/
3
+
4
+ # Python-generated files
5
+ __pycache__/
6
+ *.py[cod]
7
+ *$py.class
8
+ *.so
9
+
10
+ # Distribution / packaging
11
+ /build/
12
+ /dist/
13
+ *.egg-info/
14
+ .eggs/
15
+
16
+ # Installer remnants
17
+ pip-delete-this-directory.txt
18
+
19
+ # Tests, type checking, and profiling
20
+ /.pytest_cache/
21
+ /.mypy_cache/
22
+ .dmypy.json
23
+ dmypy.json
24
+ htmlcov/
25
+ .coverage
26
+ .coverage.*
27
+ *.cover
28
+ *.py,cover
29
+ coverage.xml
30
+ *.prof
31
+ .profraw
32
+
33
+ # pyenv
34
+ .python-version
35
+
36
+ # Local environment
37
+ .env
38
+ .env.*
39
+ !.env.example
40
+ /.venv/
41
+
42
+ # IDEs and text editors
43
+ .vscode/
44
+ .idea/
45
+ *.swp
46
+ *.swo
47
+ *.swn
48
+
49
+ # macOS
50
+ .DS_Store
51
+ .AppleDouble
52
+ .LSOverride
53
+
54
+ # Windows
55
+ Thumbs.db
56
+ ehthumbs.db
57
+ Desktop.ini
58
+ $RECYCLE.BIN/
59
+
60
+ # Linux
61
+ .Trash-*
62
+
63
+ # Temporary files
64
+ .~lock.*#
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 John Reynolds
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.
@@ -0,0 +1,77 @@
1
+ Metadata-Version: 2.5
2
+ Name: perfattr
3
+ Version: 0.1.0a1
4
+ Summary: Auditable portfolio performance attribution using pandas and NumPy.
5
+ Project-URL: Repository, https://github.com/JohnDReynolds/perfattr
6
+ Author: John Reynolds
7
+ License-Expression: MIT
8
+ License-File: LICENSE
9
+ Keywords: attribution,brinson,finance,performance,portfolio
10
+ Classifier: Development Status :: 2 - Pre-Alpha
11
+ Classifier: Intended Audience :: Financial and Insurance Industry
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
17
+ Classifier: Typing :: Typed
18
+ Requires-Python: >=3.11
19
+ Requires-Dist: numpy>=1.26
20
+ Requires-Dist: pandas>=2.2
21
+ Provides-Extra: dev
22
+ Requires-Dist: build>=1.2; extra == 'dev'
23
+ Requires-Dist: pylint>=4.0; extra == 'dev'
24
+ Requires-Dist: pyright>=1.1.409; extra == 'dev'
25
+ Requires-Dist: pytest>=8.0; extra == 'dev'
26
+ Requires-Dist: twine>=6.0; extra == 'dev'
27
+ Description-Content-Type: text/markdown
28
+
29
+ # perfattr
30
+
31
+ `perfattr` is a small, auditable portfolio performance-attribution calculation
32
+ library built with pandas and NumPy.
33
+
34
+ The initial release will provide a reusable Brinson-Fachler calculation core for
35
+ prepared reporting-period data. Source loading, portfolio accounting, vendor schemas,
36
+ calendar logic, and presentation are intentionally outside the package boundary.
37
+
38
+ The first functional alpha slice calculates one prepared reporting period, including
39
+ input validation, universe equalization, Brinson-Fachler allocation and selection,
40
+ and financial reconciliation. Multi-period linking remains the next calculation
41
+ milestone. The governing roadmap is available in
42
+ [`_extras/perfattr_roadmap.md`](_extras/perfattr_roadmap.md), and the complete portable
43
+ calculation contract is defined in [`docs/specification.md`](docs/specification.md).
44
+
45
+ ```python
46
+ from perfattr import calculate_attribution
47
+
48
+ result = calculate_attribution(portfolio, benchmark)
49
+ print(result.period_detail)
50
+ ```
51
+
52
+ ## Development
53
+
54
+ Create and activate a virtual environment:
55
+
56
+ ```bash
57
+ python3 -m venv .venv
58
+ source .venv/bin/activate
59
+ ```
60
+
61
+ Install the package and development dependencies:
62
+
63
+ ```bash
64
+ python -m pip install --editable ".[dev]"
65
+ ```
66
+
67
+ Run the initial checks:
68
+
69
+ ```bash
70
+ python -m pytest
71
+ python -m pylint src/perfattr tests
72
+ python -m pyright
73
+ ```
74
+
75
+ ## License
76
+
77
+ `perfattr` is distributed under the MIT License.
@@ -0,0 +1,49 @@
1
+ # perfattr
2
+
3
+ `perfattr` is a small, auditable portfolio performance-attribution calculation
4
+ library built with pandas and NumPy.
5
+
6
+ The initial release will provide a reusable Brinson-Fachler calculation core for
7
+ prepared reporting-period data. Source loading, portfolio accounting, vendor schemas,
8
+ calendar logic, and presentation are intentionally outside the package boundary.
9
+
10
+ The first functional alpha slice calculates one prepared reporting period, including
11
+ input validation, universe equalization, Brinson-Fachler allocation and selection,
12
+ and financial reconciliation. Multi-period linking remains the next calculation
13
+ milestone. The governing roadmap is available in
14
+ [`_extras/perfattr_roadmap.md`](_extras/perfattr_roadmap.md), and the complete portable
15
+ calculation contract is defined in [`docs/specification.md`](docs/specification.md).
16
+
17
+ ```python
18
+ from perfattr import calculate_attribution
19
+
20
+ result = calculate_attribution(portfolio, benchmark)
21
+ print(result.period_detail)
22
+ ```
23
+
24
+ ## Development
25
+
26
+ Create and activate a virtual environment:
27
+
28
+ ```bash
29
+ python3 -m venv .venv
30
+ source .venv/bin/activate
31
+ ```
32
+
33
+ Install the package and development dependencies:
34
+
35
+ ```bash
36
+ python -m pip install --editable ".[dev]"
37
+ ```
38
+
39
+ Run the initial checks:
40
+
41
+ ```bash
42
+ python -m pytest
43
+ python -m pylint src/perfattr tests
44
+ python -m pyright
45
+ ```
46
+
47
+ ## License
48
+
49
+ `perfattr` is distributed under the MIT License.