justanalytics-python 0.1.0__py3-none-any.whl

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,173 @@
1
+ Metadata-Version: 2.4
2
+ Name: justanalytics-python
3
+ Version: 0.1.0
4
+ Summary: Official Python SDK for JustAnalytics — end-to-end observability (traces, errors, logs, metrics)
5
+ Project-URL: Homepage, https://justanalytics.up.railway.app
6
+ Project-URL: Documentation, https://justanalytics.up.railway.app/docs
7
+ Project-URL: Repository, https://github.com/velocitydigitallabs/justanalytics
8
+ Author-email: Velocity Digital Labs LLC <support@velocitydigitallabs.com>
9
+ License-Expression: MIT
10
+ Keywords: analytics,apm,errors,logs,monitoring,observability,tracing
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Classifier: Topic :: System :: Monitoring
22
+ Classifier: Typing :: Typed
23
+ Requires-Python: >=3.9
24
+ Requires-Dist: urllib3>=1.26
25
+ Provides-Extra: dev
26
+ Requires-Dist: flask>=2.0; extra == 'dev'
27
+ Requires-Dist: pytest-asyncio>=0.21; extra == 'dev'
28
+ Requires-Dist: pytest>=7.0; extra == 'dev'
29
+ Requires-Dist: requests>=2.20; extra == 'dev'
30
+ Provides-Extra: django
31
+ Requires-Dist: django>=3.2; extra == 'django'
32
+ Provides-Extra: fastapi
33
+ Requires-Dist: starlette>=0.20; extra == 'fastapi'
34
+ Provides-Extra: flask
35
+ Requires-Dist: flask>=2.0; extra == 'flask'
36
+ Provides-Extra: requests
37
+ Requires-Dist: requests>=2.20; extra == 'requests'
38
+ Description-Content-Type: text/markdown
39
+
40
+ # justanalytics-python
41
+
42
+ Official Python SDK for [JustAnalytics](https://justanalytics.up.railway.app) — end-to-end observability (traces, errors, logs, metrics).
43
+
44
+ ## Installation
45
+
46
+ ```bash
47
+ pip install justanalytics-python
48
+ ```
49
+
50
+ With framework extras:
51
+
52
+ ```bash
53
+ pip install justanalytics-python[django]
54
+ pip install justanalytics-python[flask]
55
+ pip install justanalytics-python[fastapi]
56
+ pip install justanalytics-python[requests]
57
+ ```
58
+
59
+ ## Quick Start
60
+
61
+ ```python
62
+ import justanalytics
63
+
64
+ justanalytics.init(
65
+ site_id="site_abc123",
66
+ api_key="ja_sk_your_api_key_here",
67
+ service_name="api-server",
68
+ environment="production",
69
+ )
70
+
71
+ # Traced spans (context manager)
72
+ with justanalytics.start_span("process-order") as span:
73
+ span.set_attribute("order.id", "12345")
74
+ result = process_order()
75
+
76
+ # Decorator
77
+ @justanalytics.span(op="db.query")
78
+ def get_user(user_id: str):
79
+ return db.query(...)
80
+
81
+ # Error capture
82
+ try:
83
+ risky_operation()
84
+ except Exception as e:
85
+ justanalytics.capture_exception(e, tags={"module": "payments"})
86
+
87
+ # Message capture
88
+ justanalytics.capture_message("Deployment complete", level="info")
89
+
90
+ # User context
91
+ justanalytics.set_user(id="user-123", email="alice@example.com")
92
+
93
+ # Tags
94
+ justanalytics.set_tag("feature", "checkout")
95
+
96
+ # Structured logging
97
+ justanalytics.log("info", "User logged in", {"userId": "u123"})
98
+
99
+ # Metrics
100
+ justanalytics.record_metric("custom.queue_size", 42, {"queue": "emails"})
101
+
102
+ # Flush before shutdown
103
+ justanalytics.flush()
104
+ justanalytics.close()
105
+ ```
106
+
107
+ ## Framework Integrations
108
+
109
+ ### Django
110
+
111
+ ```python
112
+ # settings.py
113
+ MIDDLEWARE = [
114
+ "justanalytics.integrations.django.JustAnalyticsMiddleware",
115
+ # ... other middleware
116
+ ]
117
+ ```
118
+
119
+ ### Flask
120
+
121
+ ```python
122
+ from flask import Flask
123
+ from justanalytics.integrations.flask import JustAnalyticsMiddleware
124
+
125
+ app = Flask(__name__)
126
+ JustAnalyticsMiddleware(app)
127
+ ```
128
+
129
+ ### FastAPI
130
+
131
+ ```python
132
+ from fastapi import FastAPI
133
+ from justanalytics.integrations.fastapi import JustAnalyticsMiddleware
134
+
135
+ app = FastAPI()
136
+ app.add_middleware(JustAnalyticsMiddleware)
137
+ ```
138
+
139
+ ### requests library
140
+
141
+ ```python
142
+ from justanalytics.integrations.requests import RequestsIntegration
143
+
144
+ integration = RequestsIntegration(service_name="my-service")
145
+ integration.enable()
146
+ # All requests.get/post calls are now traced
147
+ ```
148
+
149
+ ### Python logging bridge
150
+
151
+ ```python
152
+ import logging
153
+ from justanalytics.integrations.logging import JustAnalyticsHandler
154
+
155
+ handler = JustAnalyticsHandler(level=logging.WARNING)
156
+ logging.getLogger().addHandler(handler)
157
+ ```
158
+
159
+ ## W3C Trace Context
160
+
161
+ ```python
162
+ from justanalytics import parse_traceparent, serialize_traceparent
163
+
164
+ # Parse incoming header
165
+ data = parse_traceparent("00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01")
166
+
167
+ # Serialize outgoing header
168
+ header = serialize_traceparent(trace_id, span_id, sampled=True)
169
+ ```
170
+
171
+ ## License
172
+
173
+ MIT
@@ -0,0 +1,17 @@
1
+ justanalytics/__init__.py,sha256=pn0YwLcjKy3G1XV2xLCm4-hLnIPHsK4Y3VAUKJ_q2wk,10825
2
+ justanalytics/client.py,sha256=riDQdP63OsXE3sLhYfooXysY4kh0KSamr4LQztWxRgE,21183
3
+ justanalytics/context.py,sha256=4YMy3wB_Zwk_0sNFwiznQ_Tj1NGKTMsMQmUS-G8IdnM,3585
4
+ justanalytics/span.py,sha256=zkFEFascnvkGLMyEdl34rTtWrTjj2MGDL23b-TDrrUs,9066
5
+ justanalytics/trace_context.py,sha256=rAUpdqO2DVBV0ZSQQqUF-0zv_zVYuIA_01fwXowLWdw,3284
6
+ justanalytics/transport.py,sha256=mrPB4dFAWlnMy2y55J1nUtLX3qUn_DZibS99vXvE5Xk,14752
7
+ justanalytics/types.py,sha256=zC6P5u3vlLJnQ9Gwe2aU-JH90xuSS0cPQxxiaWPtMkI,5723
8
+ justanalytics/integrations/__init__.py,sha256=MWHbIY7-uojOiemtu3b6C0P1rJn9huuOkEuTjlaZ2jk,646
9
+ justanalytics/integrations/django.py,sha256=k6nmS5w7EoMNvaXR3SD3ubYuvjesJBMEKZiPUPdGsH0,5832
10
+ justanalytics/integrations/fastapi.py,sha256=yXf0Me3M2c5Ai59Xc5m02RKboOR58vVlhCTUd2hF6sQ,6280
11
+ justanalytics/integrations/flask.py,sha256=Tsy4MImNrsV3kvwHWPadrTgHkV__wcOvBGJd-UXicRk,6452
12
+ justanalytics/integrations/logging.py,sha256=0kTfudxwMVXUNbPlC9D90tSwRAFbBM10jJftW5mz7OQ,6016
13
+ justanalytics/integrations/requests.py,sha256=oV6l0XyY5-kstqo6SJmc6n5t2d-6c2NDDvMoS1dizOg,5232
14
+ justanalytics/integrations/urllib3.py,sha256=pnDlc4vg_BpVMSs85351we0FNT0dHjKo6r5bJ2RgmvY,5363
15
+ justanalytics_python-0.1.0.dist-info/METADATA,sha256=LqpMbiAVoA91p8r5TKNUTfyQAs0GfECUdl3JLSeRLMI,4515
16
+ justanalytics_python-0.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
17
+ justanalytics_python-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.27.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any