fetchnode 0.4.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 (37) hide show
  1. fetchnode-0.4.0/.gitignore +58 -0
  2. fetchnode-0.4.0/LICENSE +21 -0
  3. fetchnode-0.4.0/PKG-INFO +166 -0
  4. fetchnode-0.4.0/README.md +132 -0
  5. fetchnode-0.4.0/pyproject.toml +58 -0
  6. fetchnode-0.4.0/src/fetchnode/__init__.py +50 -0
  7. fetchnode-0.4.0/src/fetchnode/api.py +309 -0
  8. fetchnode-0.4.0/src/fetchnode/apps.py +36 -0
  9. fetchnode-0.4.0/src/fetchnode/capture.py +202 -0
  10. fetchnode-0.4.0/src/fetchnode/celery.py +138 -0
  11. fetchnode-0.4.0/src/fetchnode/conf.py +127 -0
  12. fetchnode-0.4.0/src/fetchnode/demo.py +3 -0
  13. fetchnode-0.4.0/src/fetchnode/excepthook.py +83 -0
  14. fetchnode-0.4.0/src/fetchnode/handlers.py +76 -0
  15. fetchnode-0.4.0/src/fetchnode/middleware.py +188 -0
  16. fetchnode-0.4.0/src/fetchnode/query.py +90 -0
  17. fetchnode-0.4.0/src/fetchnode/scope.py +81 -0
  18. fetchnode-0.4.0/src/fetchnode/scrub.py +87 -0
  19. fetchnode-0.4.0/src/fetchnode/sender.py +241 -0
  20. fetchnode-0.4.0/src/fetchnode/utils.py +78 -0
  21. fetchnode-0.4.0/src/fetchnode/version.py +3 -0
  22. fetchnode-0.4.0/src/fetchnode_client/__init__.py +4 -0
  23. fetchnode-0.4.0/src/fetchnode_client/api.py +1 -0
  24. fetchnode-0.4.0/src/fetchnode_client/apps.py +2 -0
  25. fetchnode-0.4.0/src/fetchnode_client/capture.py +1 -0
  26. fetchnode-0.4.0/src/fetchnode_client/celery.py +1 -0
  27. fetchnode-0.4.0/src/fetchnode_client/conf.py +1 -0
  28. fetchnode-0.4.0/src/fetchnode_client/demo.py +1 -0
  29. fetchnode-0.4.0/src/fetchnode_client/excepthook.py +1 -0
  30. fetchnode-0.4.0/src/fetchnode_client/handlers.py +1 -0
  31. fetchnode-0.4.0/src/fetchnode_client/middleware.py +1 -0
  32. fetchnode-0.4.0/src/fetchnode_client/query.py +1 -0
  33. fetchnode-0.4.0/src/fetchnode_client/scope.py +1 -0
  34. fetchnode-0.4.0/src/fetchnode_client/scrub.py +1 -0
  35. fetchnode-0.4.0/src/fetchnode_client/sender.py +1 -0
  36. fetchnode-0.4.0/src/fetchnode_client/utils.py +1 -0
  37. fetchnode-0.4.0/src/fetchnode_client/version.py +1 -0
@@ -0,0 +1,58 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # Virtual environments
7
+ .venv/
8
+ .venv-win/
9
+ venv/
10
+ env/
11
+ ENV/
12
+
13
+ # Packaging / build artifacts
14
+ build/
15
+ dist/
16
+ *.egg-info/
17
+ .eggs/
18
+ *.egg
19
+
20
+ # Installer logs
21
+ pip-log.txt
22
+ pip-delete-this-directory.txt
23
+
24
+ # Test / coverage caches
25
+ .pytest_cache/
26
+ .coverage
27
+ .coverage.*
28
+ htmlcov/
29
+ .tox/
30
+ .nox/
31
+
32
+ # Django / local runtime artifacts
33
+ db.sqlite3
34
+ db.sqlite3-journal
35
+ staticfiles/
36
+ media/
37
+ *.log
38
+
39
+ # Local environment / secrets
40
+ .env
41
+ .env.*
42
+ !.env.example
43
+
44
+ # Tooling caches
45
+ node_modules/
46
+ .mypy_cache/
47
+ .ruff_cache/
48
+ .pyre/
49
+
50
+ # Editor / OS files
51
+ .idea/
52
+ .vscode/
53
+ *.swp
54
+ *.swo
55
+ .DS_Store
56
+ Thumbs.db
57
+ .agents/
58
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 FetchNode (Remco van Wijk)
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,166 @@
1
+ Metadata-Version: 2.5
2
+ Name: fetchnode
3
+ Version: 0.4.0
4
+ Summary: Official Django and Python client SDK for FetchNode monitoring
5
+ Project-URL: Homepage, https://fetchnode.com
6
+ Project-URL: Repository, https://github.com/remcovanwijk040/fetchnode
7
+ Project-URL: Issues, https://github.com/remcovanwijk040/fetchnode/issues
8
+ Author-email: Remco van Wijk <remcovanwijk040@users.noreply.github.com>
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Web Environment
13
+ Classifier: Framework :: Django
14
+ Classifier: Framework :: Django :: 4.2
15
+ Classifier: Framework :: Django :: 5.0
16
+ Classifier: Framework :: Django :: 5.1
17
+ Classifier: Framework :: Django :: 5.2
18
+ Classifier: Intended Audience :: Developers
19
+ Classifier: License :: OSI Approved :: MIT License
20
+ Classifier: Operating System :: OS Independent
21
+ Classifier: Programming Language :: Python :: 3
22
+ Classifier: Programming Language :: Python :: 3.10
23
+ Classifier: Programming Language :: Python :: 3.11
24
+ Classifier: Programming Language :: Python :: 3.12
25
+ Classifier: Programming Language :: Python :: 3.13
26
+ Classifier: Programming Language :: Python :: 3.14
27
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
28
+ Classifier: Topic :: System :: Monitoring
29
+ Requires-Python: >=3.10
30
+ Requires-Dist: django>=4.2
31
+ Provides-Extra: celery
32
+ Requires-Dist: celery>=5.0; extra == 'celery'
33
+ Description-Content-Type: text/markdown
34
+
35
+ # FetchNode Python & Django SDK
36
+
37
+ [![PyPI](https://img.shields.io/pypi/v/fetchnode.svg)](https://pypi.org/project/fetchnode/)
38
+ [![Python Versions](https://img.shields.io/pypi/pyversions/fetchnode.svg)](https://pypi.org/project/fetchnode/)
39
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
40
+
41
+ Official Python and Django client SDK for [FetchNode](https://fetchnode.com), the focused operations and monitoring workspace for Django teams and portfolio operators.
42
+
43
+ FetchNode captures unhandled exceptions, error logs, slow database queries, Celery background tasks, and business conversions with zero configuration bloat and privacy-safe defaults.
44
+
45
+ ---
46
+
47
+ ## Installation
48
+
49
+ Install the package using `pip` or `uv`:
50
+
51
+ ```bash
52
+ pip install fetchnode
53
+ ```
54
+
55
+ *(Or `uv add fetchnode`)*
56
+
57
+ ---
58
+
59
+ ## Quickstart (Django)
60
+
61
+ ### 1. Add to `INSTALLED_APPS`
62
+
63
+ In your Django `settings.py`:
64
+
65
+ ```python
66
+ INSTALLED_APPS = [
67
+ # ...
68
+ "fetchnode",
69
+ ]
70
+ ```
71
+
72
+ ### 2. Add the Middleware
73
+
74
+ Add `FetchNodeMiddleware` near the top of your `MIDDLEWARE` list:
75
+
76
+ ```python
77
+ MIDDLEWARE = [
78
+ "fetchnode.middleware.FetchNodeMiddleware",
79
+ "django.middleware.security.SecurityMiddleware",
80
+ # ...
81
+ ]
82
+ ```
83
+
84
+ ### 3. Configure `settings.FETCHNODE`
85
+
86
+ ```python
87
+ FETCHNODE = {
88
+ "API_KEY": "fn_live_your_project_key_here",
89
+ "ENVIRONMENT": "production", # e.g. "production", "staging"
90
+
91
+ # Optional: override endpoint for self-hosted FetchNode instances
92
+ # Defaults to FetchNode Cloud: "https://monitor.fetchnode.com"
93
+ # "ENDPOINT": "https://monitor.fetchnode.com",
94
+ }
95
+ ```
96
+
97
+ You can also configure via environment variables:
98
+ * `FETCHNODE_API_KEY`
99
+ * `FETCHNODE_ENVIRONMENT`
100
+ * `FETCHNODE_RELEASE`
101
+ * `FETCHNODE_ENDPOINT`
102
+
103
+ ---
104
+
105
+ ## Usage
106
+
107
+ ### Milestone & Conversion Tracking
108
+
109
+ Track business events (form submits, leads, signups, payments) server-side with automatic visitor attribution:
110
+
111
+ ```python
112
+ import fetchnode
113
+
114
+ def contact_view(request):
115
+ form = ContactForm(request.POST)
116
+ if form.is_valid():
117
+ lead = form.save()
118
+
119
+ # Track authoritative conversion
120
+ fetchnode.track(
121
+ "lead_submitted",
122
+ request=request,
123
+ idempotency_key=str(lead.id),
124
+ properties={"email": lead.email},
125
+ conversion=True,
126
+ )
127
+ return redirect("thank_you")
128
+ ```
129
+
130
+ ### Manual Exception Capture
131
+
132
+ ```python
133
+ import fetchnode
134
+
135
+ try:
136
+ risky_operation()
137
+ except Exception as exc:
138
+ fetchnode.capture_exception(exc)
139
+ ```
140
+
141
+ ### Celery Task Monitoring
142
+
143
+ FetchNode automatically instruments Celery when installed. To manually monitor tasks or commands:
144
+
145
+ ```python
146
+ from fetchnode import capture_job
147
+
148
+ @capture_job(name="sync_external_inventory")
149
+ def sync_inventory():
150
+ ...
151
+ ```
152
+
153
+ ---
154
+
155
+ ## Privacy by Default
156
+
157
+ FetchNode is engineered with privacy-safe defaults:
158
+ * Sensitive keys (`password`, `token`, `secret`, `api_key`, `authorization`, `cookie`, `csrfmiddlewaretoken`) are scrubbed before payload transmission.
159
+ * Request bodies and raw IP addresses are excluded by default.
160
+ * Query string parameters and raw SQL values are normalized.
161
+
162
+ ---
163
+
164
+ ## License
165
+
166
+ MIT License. See [LICENSE](LICENSE) for details.
@@ -0,0 +1,132 @@
1
+ # FetchNode Python & Django SDK
2
+
3
+ [![PyPI](https://img.shields.io/pypi/v/fetchnode.svg)](https://pypi.org/project/fetchnode/)
4
+ [![Python Versions](https://img.shields.io/pypi/pyversions/fetchnode.svg)](https://pypi.org/project/fetchnode/)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+
7
+ Official Python and Django client SDK for [FetchNode](https://fetchnode.com), the focused operations and monitoring workspace for Django teams and portfolio operators.
8
+
9
+ FetchNode captures unhandled exceptions, error logs, slow database queries, Celery background tasks, and business conversions with zero configuration bloat and privacy-safe defaults.
10
+
11
+ ---
12
+
13
+ ## Installation
14
+
15
+ Install the package using `pip` or `uv`:
16
+
17
+ ```bash
18
+ pip install fetchnode
19
+ ```
20
+
21
+ *(Or `uv add fetchnode`)*
22
+
23
+ ---
24
+
25
+ ## Quickstart (Django)
26
+
27
+ ### 1. Add to `INSTALLED_APPS`
28
+
29
+ In your Django `settings.py`:
30
+
31
+ ```python
32
+ INSTALLED_APPS = [
33
+ # ...
34
+ "fetchnode",
35
+ ]
36
+ ```
37
+
38
+ ### 2. Add the Middleware
39
+
40
+ Add `FetchNodeMiddleware` near the top of your `MIDDLEWARE` list:
41
+
42
+ ```python
43
+ MIDDLEWARE = [
44
+ "fetchnode.middleware.FetchNodeMiddleware",
45
+ "django.middleware.security.SecurityMiddleware",
46
+ # ...
47
+ ]
48
+ ```
49
+
50
+ ### 3. Configure `settings.FETCHNODE`
51
+
52
+ ```python
53
+ FETCHNODE = {
54
+ "API_KEY": "fn_live_your_project_key_here",
55
+ "ENVIRONMENT": "production", # e.g. "production", "staging"
56
+
57
+ # Optional: override endpoint for self-hosted FetchNode instances
58
+ # Defaults to FetchNode Cloud: "https://monitor.fetchnode.com"
59
+ # "ENDPOINT": "https://monitor.fetchnode.com",
60
+ }
61
+ ```
62
+
63
+ You can also configure via environment variables:
64
+ * `FETCHNODE_API_KEY`
65
+ * `FETCHNODE_ENVIRONMENT`
66
+ * `FETCHNODE_RELEASE`
67
+ * `FETCHNODE_ENDPOINT`
68
+
69
+ ---
70
+
71
+ ## Usage
72
+
73
+ ### Milestone & Conversion Tracking
74
+
75
+ Track business events (form submits, leads, signups, payments) server-side with automatic visitor attribution:
76
+
77
+ ```python
78
+ import fetchnode
79
+
80
+ def contact_view(request):
81
+ form = ContactForm(request.POST)
82
+ if form.is_valid():
83
+ lead = form.save()
84
+
85
+ # Track authoritative conversion
86
+ fetchnode.track(
87
+ "lead_submitted",
88
+ request=request,
89
+ idempotency_key=str(lead.id),
90
+ properties={"email": lead.email},
91
+ conversion=True,
92
+ )
93
+ return redirect("thank_you")
94
+ ```
95
+
96
+ ### Manual Exception Capture
97
+
98
+ ```python
99
+ import fetchnode
100
+
101
+ try:
102
+ risky_operation()
103
+ except Exception as exc:
104
+ fetchnode.capture_exception(exc)
105
+ ```
106
+
107
+ ### Celery Task Monitoring
108
+
109
+ FetchNode automatically instruments Celery when installed. To manually monitor tasks or commands:
110
+
111
+ ```python
112
+ from fetchnode import capture_job
113
+
114
+ @capture_job(name="sync_external_inventory")
115
+ def sync_inventory():
116
+ ...
117
+ ```
118
+
119
+ ---
120
+
121
+ ## Privacy by Default
122
+
123
+ FetchNode is engineered with privacy-safe defaults:
124
+ * Sensitive keys (`password`, `token`, `secret`, `api_key`, `authorization`, `cookie`, `csrfmiddlewaretoken`) are scrubbed before payload transmission.
125
+ * Request bodies and raw IP addresses are excluded by default.
126
+ * Query string parameters and raw SQL values are normalized.
127
+
128
+ ---
129
+
130
+ ## License
131
+
132
+ MIT License. See [LICENSE](LICENSE) for details.
@@ -0,0 +1,58 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "fetchnode"
7
+ version = "0.4.0"
8
+ description = "Official Django and Python client SDK for FetchNode monitoring"
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ requires-python = ">=3.10"
12
+ authors = [
13
+ { name = "Remco van Wijk", email = "remcovanwijk040@users.noreply.github.com" },
14
+ ]
15
+ classifiers = [
16
+ "Development Status :: 4 - Beta",
17
+ "Environment :: Web Environment",
18
+ "Framework :: Django",
19
+ "Framework :: Django :: 4.2",
20
+ "Framework :: Django :: 5.0",
21
+ "Framework :: Django :: 5.1",
22
+ "Framework :: Django :: 5.2",
23
+ "Intended Audience :: Developers",
24
+ "License :: OSI Approved :: MIT License",
25
+ "Operating System :: OS Independent",
26
+ "Programming Language :: Python :: 3",
27
+ "Programming Language :: Python :: 3.10",
28
+ "Programming Language :: Python :: 3.11",
29
+ "Programming Language :: Python :: 3.12",
30
+ "Programming Language :: Python :: 3.13",
31
+ "Programming Language :: Python :: 3.14",
32
+ "Topic :: System :: Monitoring",
33
+ "Topic :: Software Development :: Libraries :: Python Modules",
34
+ ]
35
+ dependencies = [
36
+ "django>=4.2",
37
+ ]
38
+
39
+ [project.optional-dependencies]
40
+ celery = [
41
+ "celery>=5.0",
42
+ ]
43
+
44
+ [project.urls]
45
+ Homepage = "https://fetchnode.com"
46
+ Repository = "https://github.com/remcovanwijk040/fetchnode"
47
+ Issues = "https://github.com/remcovanwijk040/fetchnode/issues"
48
+
49
+ [tool.hatch.build.targets.wheel]
50
+ packages = ["src/fetchnode", "src/fetchnode_client"]
51
+
52
+ [tool.hatch.build.targets.sdist]
53
+ include = [
54
+ "/src",
55
+ "/README.md",
56
+ "/LICENSE",
57
+ "/pyproject.toml",
58
+ ]
@@ -0,0 +1,50 @@
1
+ default_app_config = "fetchnode.apps.FetchNodeConfig"
2
+
3
+ from fetchnode.version import SDK_VERSION
4
+
5
+ __version__ = SDK_VERSION
6
+
7
+ from fetchnode.api import capture_exception, capture_message, track, track_event
8
+ from fetchnode.capture import (
9
+ capture_context,
10
+ capture_django_task,
11
+ capture_exceptions,
12
+ capture_job,
13
+ capture_job_context,
14
+ capture_job_exception,
15
+ capture_management_command,
16
+ track_job_execution,
17
+ )
18
+ from fetchnode.excepthook import (
19
+ install_excepthook_instrumentation,
20
+ restore_excepthook,
21
+ uninstall_excepthook_instrumentation,
22
+ )
23
+ from fetchnode.scope import add_breadcrumb, clear_scope, set_context, set_tag, set_user
24
+ from fetchnode.sender import flush, transport_stats
25
+
26
+ __all__ = [
27
+ "__version__",
28
+ "capture_exception",
29
+ "capture_message",
30
+ "track",
31
+ "track_event",
32
+ "capture_exceptions",
33
+ "capture_context",
34
+ "capture_job_exception",
35
+ "capture_job_context",
36
+ "capture_job",
37
+ "capture_django_task",
38
+ "track_job_execution",
39
+ "capture_management_command",
40
+ "install_excepthook_instrumentation",
41
+ "uninstall_excepthook_instrumentation",
42
+ "restore_excepthook",
43
+ "add_breadcrumb",
44
+ "clear_scope",
45
+ "set_context",
46
+ "set_tag",
47
+ "set_user",
48
+ "flush",
49
+ "transport_stats",
50
+ ]