ledger-sdk 1.0.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 (34) hide show
  1. ledger_sdk-1.0.0/CHANGELOG.md +38 -0
  2. ledger_sdk-1.0.0/LICENSE +21 -0
  3. ledger_sdk-1.0.0/MANIFEST.in +12 -0
  4. ledger_sdk-1.0.0/PKG-INFO +678 -0
  5. ledger_sdk-1.0.0/README.md +626 -0
  6. ledger_sdk-1.0.0/examples/basic_app.py +135 -0
  7. ledger_sdk-1.0.0/pyproject.toml +218 -0
  8. ledger_sdk-1.0.0/setup.cfg +4 -0
  9. ledger_sdk-1.0.0/setup.py +4 -0
  10. ledger_sdk-1.0.0/src/ledger/__init__.py +4 -0
  11. ledger_sdk-1.0.0/src/ledger/_version.py +1 -0
  12. ledger_sdk-1.0.0/src/ledger/core/__init__.py +3 -0
  13. ledger_sdk-1.0.0/src/ledger/core/buffer.py +45 -0
  14. ledger_sdk-1.0.0/src/ledger/core/client.py +297 -0
  15. ledger_sdk-1.0.0/src/ledger/core/flusher.py +249 -0
  16. ledger_sdk-1.0.0/src/ledger/core/http_client.py +67 -0
  17. ledger_sdk-1.0.0/src/ledger/core/rate_limiter.py +78 -0
  18. ledger_sdk-1.0.0/src/ledger/core/settings.py +30 -0
  19. ledger_sdk-1.0.0/src/ledger/core/validator.py +124 -0
  20. ledger_sdk-1.0.0/src/ledger/integrations/__init__.py +3 -0
  21. ledger_sdk-1.0.0/src/ledger/integrations/fastapi.py +113 -0
  22. ledger_sdk-1.0.0/src/ledger/py.typed +0 -0
  23. ledger_sdk-1.0.0/src/ledger_sdk.egg-info/PKG-INFO +678 -0
  24. ledger_sdk-1.0.0/src/ledger_sdk.egg-info/SOURCES.txt +32 -0
  25. ledger_sdk-1.0.0/src/ledger_sdk.egg-info/dependency_links.txt +1 -0
  26. ledger_sdk-1.0.0/src/ledger_sdk.egg-info/requires.txt +27 -0
  27. ledger_sdk-1.0.0/src/ledger_sdk.egg-info/top_level.txt +1 -0
  28. ledger_sdk-1.0.0/tests/__init__.py +0 -0
  29. ledger_sdk-1.0.0/tests/conftest.py +22 -0
  30. ledger_sdk-1.0.0/tests/integrations/__init__.py +0 -0
  31. ledger_sdk-1.0.0/tests/integrations/test_fastapi.py +73 -0
  32. ledger_sdk-1.0.0/tests/test_buffer.py +66 -0
  33. ledger_sdk-1.0.0/tests/test_client.py +108 -0
  34. ledger_sdk-1.0.0/tests/test_validator.py +94 -0
@@ -0,0 +1,38 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project 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
+ ## [1.0.0] - 2025-01-11
9
+
10
+ ### Added
11
+
12
+ - Initial release of Ledger SDK for Python
13
+ - Core LedgerClient with automatic log buffering and batching
14
+ - FastAPI middleware integration for automatic request/response logging
15
+ - Non-blocking async operation with <0.1ms overhead
16
+ - Intelligent batching (every 5s or 100 logs)
17
+ - Dual rate limiting (per-minute and per-hour)
18
+ - Circuit breaker pattern (5 failure threshold, 60s timeout)
19
+ - Exponential backoff retry logic (max 3 retries)
20
+ - Comprehensive metrics and health checks
21
+ - Configuration validation on startup
22
+ - Graceful shutdown with connection draining
23
+ - Production-ready features for high-traffic APIs
24
+
25
+ ### Features
26
+
27
+ - Automatic exception capture with full stack traces
28
+ - Structured logging to stderr
29
+ - HTTP connection pooling (10 persistent connections)
30
+ - Redis-compatible settings management
31
+ - Field validation and truncation
32
+ - Background flusher with async processing
33
+
34
+ ### Integrations
35
+
36
+ - FastAPI (via LedgerMiddleware)
37
+
38
+ [1.0.0]: https://github.com/JakubTuta/ledger-sdk/releases/tag/v1.0.0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Ledger Team
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,12 @@
1
+ include README.md
2
+ include LICENSE
3
+ include CHANGELOG.md
4
+ include pyproject.toml
5
+ include src/ledger/py.typed
6
+
7
+ recursive-include examples *.py
8
+ recursive-include tests *.py
9
+
10
+ global-exclude __pycache__
11
+ global-exclude *.py[co]
12
+ global-exclude .DS_Store