timber-common 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.
Files changed (100) hide show
  1. timber_common-0.1.0/CHANGELOG.md +165 -0
  2. timber_common-0.1.0/LICENSE +59 -0
  3. timber_common-0.1.0/PKG-INFO +651 -0
  4. timber_common-0.1.0/README.md +596 -0
  5. timber_common-0.1.0/common/__init__.py +327 -0
  6. timber_common-0.1.0/common/config/__init__.py +16 -0
  7. timber_common-0.1.0/common/config/model_loader.py +258 -0
  8. timber_common-0.1.0/common/engine/__init__.py +0 -0
  9. timber_common-0.1.0/common/engine/config_executor.py +317 -0
  10. timber_common-0.1.0/common/engine/operation_registry.py +173 -0
  11. timber_common-0.1.0/common/init.py +244 -0
  12. timber_common-0.1.0/common/models/__init__.py +22 -0
  13. timber_common-0.1.0/common/models/base.py +399 -0
  14. timber_common-0.1.0/common/models/configs/__init__.py +0 -0
  15. timber_common-0.1.0/common/models/core/__init.__.py +14 -0
  16. timber_common-0.1.0/common/models/core/tag.py +53 -0
  17. timber_common-0.1.0/common/models/core/user.py +299 -0
  18. timber_common-0.1.0/common/models/factory.py +654 -0
  19. timber_common-0.1.0/common/models/mixins.py +327 -0
  20. timber_common-0.1.0/common/models/registry.py +196 -0
  21. timber_common-0.1.0/common/services/__init__.py +41 -0
  22. timber_common-0.1.0/common/services/data_fetcher/__init__.py +49 -0
  23. timber_common-0.1.0/common/services/data_fetcher/alphavantage.py +190 -0
  24. timber_common-0.1.0/common/services/data_fetcher/base.py +127 -0
  25. timber_common-0.1.0/common/services/data_fetcher/curated_data.py +197 -0
  26. timber_common-0.1.0/common/services/data_fetcher/polygon.py +244 -0
  27. timber_common-0.1.0/common/services/data_fetcher/stock.py +268 -0
  28. timber_common-0.1.0/common/services/data_fetcher/yfinance.py +154 -0
  29. timber_common-0.1.0/common/services/data_processor/__init__.py +232 -0
  30. timber_common-0.1.0/common/services/data_processor/portfolio_metrics.py +261 -0
  31. timber_common-0.1.0/common/services/data_processor/returns.py +112 -0
  32. timber_common-0.1.0/common/services/data_processor/risk_metrics.py +231 -0
  33. timber_common-0.1.0/common/services/data_processor/standardization.py +129 -0
  34. timber_common-0.1.0/common/services/data_processor/technical_indicators.py +281 -0
  35. timber_common-0.1.0/common/services/db_service.py +268 -0
  36. timber_common-0.1.0/common/services/encryption/__init__.py +0 -0
  37. timber_common-0.1.0/common/services/encryption/field_encryption.py +349 -0
  38. timber_common-0.1.0/common/services/gdpr/__init__.py +13 -0
  39. timber_common-0.1.0/common/services/gdpr/deletion.py +433 -0
  40. timber_common-0.1.0/common/services/inventory/__init__.py +74 -0
  41. timber_common-0.1.0/common/services/inventory/available_capabilities.py +602 -0
  42. timber_common-0.1.0/common/services/inventory/cached_capabilities.py +557 -0
  43. timber_common-0.1.0/common/services/inventory/loader.py +331 -0
  44. timber_common-0.1.0/common/services/persistence/__init__.py +94 -0
  45. timber_common-0.1.0/common/services/persistence/base.py +300 -0
  46. timber_common-0.1.0/common/services/persistence/cache.py +405 -0
  47. timber_common-0.1.0/common/services/persistence/instances.py +109 -0
  48. timber_common-0.1.0/common/services/persistence/manager.py +218 -0
  49. timber_common-0.1.0/common/services/persistence/notification.py +400 -0
  50. timber_common-0.1.0/common/services/persistence/research.py +331 -0
  51. timber_common-0.1.0/common/services/persistence/session.py +676 -0
  52. timber_common-0.1.0/common/services/persistence/tracker.py +434 -0
  53. timber_common-0.1.0/common/services/security/__init__.py +0 -0
  54. timber_common-0.1.0/common/services/security/oauth_service.py +316 -0
  55. timber_common-0.1.0/common/services/vector/__init__.py +23 -0
  56. timber_common-0.1.0/common/services/vector/auto_ingestion.py +452 -0
  57. timber_common-0.1.0/common/services/vector/tag_embedding.py +394 -0
  58. timber_common-0.1.0/common/utils/__init__.py +57 -0
  59. timber_common-0.1.0/common/utils/config.py +296 -0
  60. timber_common-0.1.0/common/utils/db_utils.py +119 -0
  61. timber_common-0.1.0/common/utils/helpers.py +151 -0
  62. timber_common-0.1.0/common/utils/time_helpers.py +6 -0
  63. timber_common-0.1.0/common/utils/validators.py +211 -0
  64. timber_common-0.1.0/data/models/00_association_tables.yaml +37 -0
  65. timber_common-0.1.0/data/models/cache_models.yaml +302 -0
  66. timber_common-0.1.0/data/models/narrative_models.yaml +301 -0
  67. timber_common-0.1.0/data/models/notification_models.yaml +124 -0
  68. timber_common-0.1.0/data/models/oauth_models.yaml +266 -0
  69. timber_common-0.1.0/data/models/portfolio_models.yaml +110 -0
  70. timber_common-0.1.0/data/models/stock_research_models.yaml +214 -0
  71. timber_common-0.1.0/data/models/user_preferences_models.yaml +278 -0
  72. timber_common-0.1.0/data/models/vector_db_models.yaml +144 -0
  73. timber_common-0.1.0/documentation/DOCUMENTATION_INDEX.md +159 -0
  74. timber_common-0.1.0/documentation/DOCUMENTATION_SUMMARY.md +411 -0
  75. timber_common-0.1.0/documentation/PROGRESS_UPDATE.md +386 -0
  76. timber_common-0.1.0/documentation/best_practices/01_model_design_patterns.md +572 -0
  77. timber_common-0.1.0/documentation/best_practices/02_service_architecture.md +1233 -0
  78. timber_common-0.1.0/documentation/best_practices/03_data_fetching_strategies.md +660 -0
  79. timber_common-0.1.0/documentation/best_practices/04_caching_strategies.md +967 -0
  80. timber_common-0.1.0/documentation/best_practices/05_error_handling.md +684 -0
  81. timber_common-0.1.0/documentation/best_practices/06_performance_optimization.md +278 -0
  82. timber_common-0.1.0/documentation/best_practices/07_security_best_practices.md +420 -0
  83. timber_common-0.1.0/documentation/design_guides/01_system_architecture.md +1164 -0
  84. timber_common-0.1.0/documentation/design_guides/02_config_driven_models.md +1360 -0
  85. timber_common-0.1.0/documentation/design_guides/03_persistence_layer.md +1403 -0
  86. timber_common-0.1.0/documentation/design_guides/04_vector_integration.md +1315 -0
  87. timber_common-0.1.0/documentation/design_guides/05_multi_app_support.md +1281 -0
  88. timber_common-0.1.0/documentation/how_to/01_getting_started.md +409 -0
  89. timber_common-0.1.0/documentation/how_to/02_creating_models.md +638 -0
  90. timber_common-0.1.0/documentation/how_to/03_using_services.md +932 -0
  91. timber_common-0.1.0/documentation/how_to/04_financial_data_fetching.md +855 -0
  92. timber_common-0.1.0/documentation/how_to/05_encryption_and_security.md +1218 -0
  93. timber_common-0.1.0/documentation/how_to/06_vector_search.md +1444 -0
  94. timber_common-0.1.0/documentation/how_to/07_gdpr_compliance.md +1590 -0
  95. timber_common-0.1.0/documentation/how_to/08_testing_guide.md +1521 -0
  96. timber_common-0.1.0/modules/__init__.py +0 -0
  97. timber_common-0.1.0/modules/config/custom_analysis.yaml +30 -0
  98. timber_common-0.1.0/modules/config/investing_operations_config.yaml +182 -0
  99. timber_common-0.1.0/modules/investing_operations.py +431 -0
  100. timber_common-0.1.0/pyproject.toml +216 -0
@@ -0,0 +1,165 @@
1
+ # Changelog
2
+
3
+ All notable changes to Timber will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.1.0] - 2025-10-19
9
+
10
+ ### Added - Initial Release
11
+
12
+ #### Core Features
13
+ - **Config-Driven Models**: Define SQLAlchemy models using YAML configuration files
14
+ - **Dynamic Model Factory**: Automatically generate model classes from YAML at runtime
15
+ - **Model Registry**: Global model registry with `get_model()` accessor
16
+ - **Relationship Resolution**: Automatic relationship building with dependency management
17
+
18
+ #### Database Management
19
+ - **Connection Pooling**: Optimized PostgreSQL connection pooling with QueuePool
20
+ - **Session Management**: Context manager for automatic transaction handling
21
+ - **Transaction Support**: Automatic commit/rollback with `session_scope()`
22
+ - **Health Checks**: Database connectivity monitoring
23
+ - **Migration Support**: Schema evolution with Alembic integration
24
+
25
+ #### Service Layer
26
+ - **Session Service**: Manage user sessions across applications
27
+ - **Research Service**: Store and query research data and analysis
28
+ - **Notification Service**: User notification system with read tracking
29
+ - **Tracker Service**: Event tracking and user activity analytics
30
+ - **Stock Data Service**: Financial data fetching from multiple sources
31
+
32
+ #### Feature Services
33
+ - **Encryption Service**: Field-level encryption with Fernet
34
+ - **Cache Service**: Multi-level caching (Redis + local)
35
+ - **Vector Search Service**: Semantic search with embeddings
36
+ - **GDPR Service**: Data export and deletion for compliance
37
+
38
+ #### Vector Search Integration
39
+ - **Automatic Embedding Generation**: Using sentence-transformers
40
+ - **Vector Database Support**: Qdrant, Weaviate, Pinecone integration
41
+ - **Semantic Search**: Find similar documents by meaning
42
+ - **Hybrid Search**: Combine vector and keyword search
43
+ - **Batch Processing**: Efficient batch embedding generation
44
+
45
+ #### Data Sources
46
+ - **Yahoo Finance**: Historical and real-time stock data
47
+ - **Alpha Vantage**: Company fundamentals and financials
48
+ - **Polygon.io**: Market data and news
49
+ - **SEC Edgar**: Company filings and documents
50
+
51
+ #### Security & Compliance
52
+ - **Field-Level Encryption**: Automatic encryption of sensitive fields
53
+ - **GDPR Compliance**: Data export, deletion, and audit trails
54
+ - **Secure Configuration**: Environment variable management
55
+ - **Connection Security**: SSL/TLS support for database connections
56
+
57
+ #### Multi-Application Support
58
+ - **Application Context**: Separate contexts for different apps
59
+ - **Session Type Filtering**: Isolate data by application
60
+ - **Shared Infrastructure**: Common database, cache, and vector store
61
+ - **Independent Deployment**: Apps deploy separately
62
+
63
+ #### Documentation
64
+ - **How-To Guides**: Step-by-step instructions for common tasks
65
+ - Getting Started
66
+ - Creating Models
67
+ - Using Services
68
+ - **Design Guides**: Architecture and design documentation
69
+ - System Architecture
70
+ - Config-Driven Models
71
+ - Persistence Layer
72
+ - Vector Integration
73
+ - Multi-App Support
74
+ - **API Documentation**: Comprehensive API reference
75
+ - **Code Examples**: Working examples for all features
76
+
77
+ #### Developer Tools
78
+ - **Type Hints**: Full type annotation support
79
+ - **Testing Framework**: pytest integration with fixtures
80
+ - **Code Quality**: Black, isort, mypy configuration
81
+ - **Error Handling**: Consistent error types and handling patterns
82
+
83
+ ### Technical Details
84
+
85
+ #### Supported Python Versions
86
+ - Python 3.13+
87
+
88
+ #### Supported Databases
89
+ - PostgreSQL 12+
90
+ - pgvector extension for vector support
91
+
92
+ #### Supported Vector Stores
93
+ - Qdrant (recommended)
94
+ - Weaviate
95
+ - Pinecone
96
+
97
+ #### Embedding Models
98
+ - BAAI/bge-small-en-v1.5 (default)
99
+ - sentence-transformers/all-MiniLM-L6-v2
100
+ - Custom models supported
101
+
102
+ ### Dependencies
103
+ - SQLAlchemy 2.0.36+
104
+ - PostgreSQL driver (psycopg2-binary)
105
+ - Redis 6.4.0+
106
+ - Pydantic 2.11.9+
107
+ - FastEmbed 0.7.3+
108
+ - Cryptography 46.0.2+
109
+ - See pyproject.toml for complete dependency list
110
+
111
+ ### Known Limitations
112
+ - Requires PostgreSQL (other databases not yet supported)
113
+ - Python 3.13+ only
114
+ - Vector search requires external vector database
115
+
116
+ ### Breaking Changes
117
+ - None (initial release)
118
+
119
+ ### Migration Guide
120
+ - None (initial release)
121
+
122
+ ---
123
+
124
+ ## [Unreleased]
125
+
126
+ ### Planned Features
127
+ - MySQL and SQLite support
128
+ - Built-in vector store option (no external database required)
129
+ - GraphQL API generation
130
+ - Real-time data streaming
131
+ - Advanced analytics dashboard
132
+ - CLI tools for model management
133
+ - Docker deployment templates
134
+ - Kubernetes manifests
135
+
136
+ ---
137
+
138
+ ## Version History
139
+
140
+ - **0.1.0** (2025-10-19) - Initial public release
141
+
142
+ ---
143
+
144
+ ## Copyright
145
+
146
+ Copyright (c) 2025 Pumulo Sikaneta. All rights reserved.
147
+
148
+ This software is released under the MIT License.
149
+ See LICENSE file for details.
150
+
151
+ ## Author
152
+
153
+ **Pumulo Sikaneta**
154
+ - Email: pumulo@gmail.com
155
+ - GitHub: [@pumulo](https://github.com/pumulo)
156
+
157
+ ## Contributing
158
+
159
+ Contributions are welcome! Please read CONTRIBUTING.md for guidelines.
160
+
161
+ ## Support
162
+
163
+ For bugs, feature requests, or questions:
164
+ - GitHub Issues: https://github.com/pumulo/timber-common/issues
165
+ - Email: pumulo@gmail.com
@@ -0,0 +1,59 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Pumulo Sikaneta
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.
22
+
23
+ ---
24
+
25
+ ATTRIBUTION NOTICE
26
+ ==================
27
+
28
+ This software was created by Pumulo Sikaneta (pumulo@gmail.com).
29
+
30
+ When using this software in derivative works or commercial applications,
31
+ please provide appropriate attribution by including:
32
+
33
+ 1. The original author's name: Pumulo Sikaneta
34
+ 2. A link to the original repository: https://github.com/pumulo/timber-common
35
+ 3. A copy of this license
36
+
37
+ ---
38
+
39
+ ANTI-PLAGIARISM NOTICE
40
+ ======================
41
+
42
+ This codebase, its documentation, architecture, and design patterns are the
43
+ intellectual property of Pumulo Sikaneta.
44
+
45
+ While the MIT License permits modification and redistribution, users are
46
+ expected to:
47
+
48
+ - Maintain proper attribution as specified above
49
+ - Not claim authorship of the original work
50
+ - Not present derivative works as entirely original creations
51
+ - Comply with academic and professional standards regarding attribution
52
+
53
+ Failure to provide proper attribution may constitute:
54
+ - Copyright infringement
55
+ - Plagiarism under academic standards
56
+ - Breach of professional ethics
57
+ - Violation of the terms of this license
58
+
59
+ For questions regarding attribution requirements, contact: pumulo@gmail.com