shivanshu-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.
@@ -0,0 +1,93 @@
1
+ Metadata-Version: 2.4
2
+ Name: shivanshu-sdk
3
+ Version: 1.0.0
4
+ Summary: Official Python SDK for Shivanshu Tiwari Portfolio APIs, project intelligence, and autonomous agent evaluation
5
+ Home-page: https://github.com/SHT4BHARAT/NoIntroNeeded
6
+ Author: Shivanshu Tiwari
7
+ Author-email: Shivanshu Tiwari <sht4bharat@gmail.com>
8
+ License: MIT
9
+ Project-URL: Homepage, https://shivanshutiwari.in
10
+ Project-URL: Documentation, https://shivanshutiwari.in/developers/sdk
11
+ Project-URL: Repository, https://github.com/SHT4BHARAT/NoIntroNeeded
12
+ Keywords: shivanshutiwari,sdk,api-client,ai-agents,mcp,portfolio
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
17
+ Requires-Python: >=3.9
18
+ Description-Content-Type: text/markdown
19
+ Dynamic: author
20
+ Dynamic: home-page
21
+ Dynamic: requires-python
22
+
23
+ # Shivanshu Tiwari Python SDK (`shivanshu-sdk`)
24
+
25
+ Official Python client library for integrating with **Shivanshu Tiwari Portfolio APIs**, project catalogs, asynchronous background jobs, Model Context Protocol (MCP), and sandbox testing.
26
+
27
+ [![PyPI version](https://img.shields.io/badge/pypi-v1.0.0-blue.svg)](https://pypi.org/project/shivanshu-sdk/)
28
+ [![Python 3.9+](https://img.shields.io/badge/python-3.9+-brightgreen.svg)](https://www.python.org/)
29
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
30
+
31
+ ## Installation
32
+
33
+ ```bash
34
+ pip install shivanshu-sdk
35
+ ```
36
+
37
+ *Note: The SDK relies solely on the Python standard library with zero external dependencies.*
38
+
39
+ ## Quick Start
40
+
41
+ ```python
42
+ from shivanshu import ShivanshuClient
43
+
44
+ # Initialize client (uses https://shivanshutiwari.in by default)
45
+ client = ShivanshuClient()
46
+
47
+ # 1. Query engineering projects
48
+ res = client.list_projects(domain="ai-agents")
49
+ print(f"Total projects: {len(res['data'])}")
50
+ for proj in res["data"]:
51
+ print(f"- {proj['title']} ({proj['slug']})")
52
+
53
+ # 2. Inspect project architecture and technical tradeoffs
54
+ project = client.get_project("agentic-honey-pot")
55
+ print("Architecture:", project.get("architecture", {}).get("summary"))
56
+
57
+ # 3. Test sandbox environment
58
+ sandbox = client.ping_sandbox()
59
+ print("Sandbox status:", sandbox)
60
+
61
+ # 4. Generate ephemeral sandbox key
62
+ key_data = client.generate_key()
63
+ print("Test API key:", key_data["apiKey"])
64
+ ```
65
+
66
+ ## Features
67
+
68
+ - **Zero Dependencies:** Pure Python 3.9+ using standard `urllib` and `json`.
69
+ - **Project Intelligence:** Query 19 engineering projects, architecture diagrams, and honest limitation disclosures.
70
+ - **Batch Processing:** Run multi-step operations in an atomic batch.
71
+ - **Async Polling:** Built-in `wait_for_job(job_id)` helper.
72
+ - **AI Agent Friendly:** Built for ingestion by autonomous agents, LangChain tools, and AutoGen systems.
73
+
74
+ ## API Reference
75
+
76
+ - `client.list_projects(limit=20, cursor=None, domain=None)`
77
+ - `client.get_project(slug)`
78
+ - `client.compare_projects(slug_a, slug_b)`
79
+ - `client.generate_key()`
80
+ - `client.ping_sandbox()`
81
+ - `client.sandbox_contact(name, email, message)`
82
+ - `client.run_batch(operations)`
83
+ - `client.create_job(task, payload=None)`
84
+ - `client.get_job(job_id)`
85
+ - `client.wait_for_job(job_id, poll_interval=1.0, timeout=30.0)`
86
+ - `client.submit_contact(name, email, message, idempotency_key=None)`
87
+ - `client.get_docs(path="llms.txt")`
88
+
89
+ ## Links
90
+
91
+ - **Developer Portal:** [https://shivanshutiwari.in/developers](https://shivanshutiwari.in/developers)
92
+ - **CLI Tool:** [https://shivanshutiwari.in/developers/cli](https://shivanshutiwari.in/developers/cli)
93
+ - **OpenAPI Spec:** [https://shivanshutiwari.in/openapi.json](https://shivanshutiwari.in/openapi.json)
@@ -0,0 +1,71 @@
1
+ # Shivanshu Tiwari Python SDK (`shivanshu-sdk`)
2
+
3
+ Official Python client library for integrating with **Shivanshu Tiwari Portfolio APIs**, project catalogs, asynchronous background jobs, Model Context Protocol (MCP), and sandbox testing.
4
+
5
+ [![PyPI version](https://img.shields.io/badge/pypi-v1.0.0-blue.svg)](https://pypi.org/project/shivanshu-sdk/)
6
+ [![Python 3.9+](https://img.shields.io/badge/python-3.9+-brightgreen.svg)](https://www.python.org/)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ pip install shivanshu-sdk
13
+ ```
14
+
15
+ *Note: The SDK relies solely on the Python standard library with zero external dependencies.*
16
+
17
+ ## Quick Start
18
+
19
+ ```python
20
+ from shivanshu import ShivanshuClient
21
+
22
+ # Initialize client (uses https://shivanshutiwari.in by default)
23
+ client = ShivanshuClient()
24
+
25
+ # 1. Query engineering projects
26
+ res = client.list_projects(domain="ai-agents")
27
+ print(f"Total projects: {len(res['data'])}")
28
+ for proj in res["data"]:
29
+ print(f"- {proj['title']} ({proj['slug']})")
30
+
31
+ # 2. Inspect project architecture and technical tradeoffs
32
+ project = client.get_project("agentic-honey-pot")
33
+ print("Architecture:", project.get("architecture", {}).get("summary"))
34
+
35
+ # 3. Test sandbox environment
36
+ sandbox = client.ping_sandbox()
37
+ print("Sandbox status:", sandbox)
38
+
39
+ # 4. Generate ephemeral sandbox key
40
+ key_data = client.generate_key()
41
+ print("Test API key:", key_data["apiKey"])
42
+ ```
43
+
44
+ ## Features
45
+
46
+ - **Zero Dependencies:** Pure Python 3.9+ using standard `urllib` and `json`.
47
+ - **Project Intelligence:** Query 19 engineering projects, architecture diagrams, and honest limitation disclosures.
48
+ - **Batch Processing:** Run multi-step operations in an atomic batch.
49
+ - **Async Polling:** Built-in `wait_for_job(job_id)` helper.
50
+ - **AI Agent Friendly:** Built for ingestion by autonomous agents, LangChain tools, and AutoGen systems.
51
+
52
+ ## API Reference
53
+
54
+ - `client.list_projects(limit=20, cursor=None, domain=None)`
55
+ - `client.get_project(slug)`
56
+ - `client.compare_projects(slug_a, slug_b)`
57
+ - `client.generate_key()`
58
+ - `client.ping_sandbox()`
59
+ - `client.sandbox_contact(name, email, message)`
60
+ - `client.run_batch(operations)`
61
+ - `client.create_job(task, payload=None)`
62
+ - `client.get_job(job_id)`
63
+ - `client.wait_for_job(job_id, poll_interval=1.0, timeout=30.0)`
64
+ - `client.submit_contact(name, email, message, idempotency_key=None)`
65
+ - `client.get_docs(path="llms.txt")`
66
+
67
+ ## Links
68
+
69
+ - **Developer Portal:** [https://shivanshutiwari.in/developers](https://shivanshutiwari.in/developers)
70
+ - **CLI Tool:** [https://shivanshutiwari.in/developers/cli](https://shivanshutiwari.in/developers/cli)
71
+ - **OpenAPI Spec:** [https://shivanshutiwari.in/openapi.json](https://shivanshutiwari.in/openapi.json)
@@ -0,0 +1,27 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "shivanshu-sdk"
7
+ version = "1.0.0"
8
+ description = "Official Python SDK for Shivanshu Tiwari Portfolio APIs, project intelligence, and autonomous agent evaluation"
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = { text = "MIT" }
12
+ authors = [
13
+ { name = "Shivanshu Tiwari", email = "sht4bharat@gmail.com" }
14
+ ]
15
+ keywords = ["shivanshutiwari", "sdk", "api-client", "ai-agents", "mcp", "portfolio"]
16
+ classifiers = [
17
+ "Programming Language :: Python :: 3",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Operating System :: OS Independent",
20
+ "Topic :: Software Development :: Libraries :: Python Modules"
21
+ ]
22
+ dependencies = []
23
+
24
+ [project.urls]
25
+ Homepage = "https://shivanshutiwari.in"
26
+ Documentation = "https://shivanshutiwari.in/developers/sdk"
27
+ Repository = "https://github.com/SHT4BHARAT/NoIntroNeeded"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,19 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name="shivanshu-sdk",
5
+ version="1.0.0",
6
+ packages=find_packages(),
7
+ description="Official Python SDK for Shivanshu Tiwari Portfolio APIs, project intelligence, and autonomous agent evaluation",
8
+ long_description=open("README.md", encoding="utf-8").read(),
9
+ long_description_content_type="text/markdown",
10
+ author="Shivanshu Tiwari",
11
+ author_email="sht4bharat@gmail.com",
12
+ url="https://github.com/SHT4BHARAT/NoIntroNeeded",
13
+ classifiers=[
14
+ "Programming Language :: Python :: 3",
15
+ "License :: OSI Approved :: MIT License",
16
+ "Operating System :: OS Independent",
17
+ ],
18
+ python_requires=">=3.9",
19
+ )
@@ -0,0 +1,8 @@
1
+ """
2
+ Shivanshu Tiwari Official Python SDK
3
+ """
4
+
5
+ from .client import ShivanshuClient, ShivanshuAPIError
6
+
7
+ __version__ = "1.0.0"
8
+ __all__ = ["ShivanshuClient", "ShivanshuAPIError"]
@@ -0,0 +1,182 @@
1
+ """
2
+ Official Python Client for Shivanshu Tiwari Portfolio APIs
3
+ """
4
+
5
+ import json
6
+ import time
7
+ import urllib.parse
8
+ import urllib.request
9
+ import urllib.error
10
+ from typing import Any, Dict, List, Optional, Union
11
+
12
+
13
+ class ShivanshuAPIError(Exception):
14
+ """Exception raised for errors in the Shivanshu Tiwari API."""
15
+
16
+ def __init__(self, message: str, status: int, body: Any = None):
17
+ super().__init__(f"[{status}] {message}")
18
+ self.status = status
19
+ self.body = body
20
+
21
+
22
+ class ShivanshuClient:
23
+ """Official Python Client for shivanshutiwari.in APIs and services."""
24
+
25
+ def __init__(
26
+ self,
27
+ base_url: str = "https://shivanshutiwari.in",
28
+ api_key: Optional[str] = None,
29
+ timeout: float = 10.0,
30
+ ):
31
+ self.base_url = base_url.rstrip("/")
32
+ self.api_key = api_key
33
+ self.timeout = timeout
34
+
35
+ def _request(
36
+ self,
37
+ endpoint: str,
38
+ method: str = "GET",
39
+ params: Optional[Dict[str, Any]] = None,
40
+ data: Optional[Dict[str, Any]] = None,
41
+ headers: Optional[Dict[str, str]] = None,
42
+ ) -> Any:
43
+ url = f"{self.base_url}/{endpoint.lstrip('/')}"
44
+ if params:
45
+ query = urllib.parse.urlencode({k: v for k, v in params.items() if v is not None})
46
+ if query:
47
+ url = f"{url}?{query}"
48
+
49
+ req_headers = {
50
+ "Accept": "application/json",
51
+ "User-Agent": "shivanshu-python-sdk/1.0.0",
52
+ }
53
+ if self.api_key:
54
+ req_headers["Authorization"] = f"Bearer {self.api_key}"
55
+ if headers:
56
+ req_headers.update(headers)
57
+
58
+ body_bytes = None
59
+ if data is not None:
60
+ body_bytes = json.dumps(data).encode("utf-8")
61
+ req_headers["Content-Type"] = "application/json"
62
+
63
+ req = urllib.request.Request(url, data=body_bytes, headers=req_headers, method=method)
64
+
65
+ try:
66
+ with urllib.request.urlopen(req, timeout=self.timeout) as response:
67
+ content = response.read().decode("utf-8")
68
+ content_type = response.headers.get("Content-Type", "")
69
+ if "application/json" in content_type:
70
+ return json.loads(content)
71
+ return content
72
+ except urllib.error.HTTPError as exc:
73
+ err_content = exc.read().decode("utf-8")
74
+ try:
75
+ err_body = json.loads(err_content)
76
+ except Exception:
77
+ err_body = err_content
78
+ raise ShivanshuAPIError(
79
+ f"Request to {endpoint} failed", status=exc.code, body=err_body
80
+ ) from exc
81
+ except urllib.error.URLError as exc:
82
+ raise ShivanshuAPIError(f"Connection failed to {url}: {exc.reason}", status=0) from exc
83
+
84
+ # Projects
85
+ def list_projects(
86
+ self,
87
+ limit: int = 20,
88
+ cursor: Optional[str] = None,
89
+ domain: Optional[str] = None,
90
+ ) -> Dict[str, Any]:
91
+ """List engineering projects with optional pagination and domain filtering."""
92
+ return self._request(
93
+ "/api/v1/projects",
94
+ params={"limit": limit, "cursor": cursor, "domain": domain},
95
+ )
96
+
97
+ def get_project(self, slug: str) -> Dict[str, Any]:
98
+ """Retrieve detailed architecture, decisions, and outcomes for a single project slug."""
99
+ return self._request(f"/api/v1/projects/{urllib.parse.quote(slug)}")
100
+
101
+ def compare_projects(self, slug_a: str, slug_b: str) -> Dict[str, Any]:
102
+ """Compare two projects side-by-side."""
103
+ proj_a = self.get_project(slug_a)
104
+ proj_b = self.get_project(slug_b)
105
+ return {"project_a": proj_a, "project_b": proj_b}
106
+
107
+ # Keys & Sandbox
108
+ def generate_key(self) -> Dict[str, Any]:
109
+ """Generate an ephemeral self-serve test API key valid for 24 hours."""
110
+ return self._request("/api/v1/keys", method="POST")
111
+
112
+ def ping_sandbox(self) -> Dict[str, Any]:
113
+ """Verify connectivity to the sandbox testing environment."""
114
+ return self._request("/api/v1/sandbox/ping")
115
+
116
+ def sandbox_contact(self, name: str, email: str, message: str) -> Dict[str, Any]:
117
+ """Submit a sandbox test contact message without triggering live alerts."""
118
+ return self._request(
119
+ "/api/v1/sandbox/contact",
120
+ method="POST",
121
+ data={"name": name, "email": email, "message": message},
122
+ )
123
+
124
+ # Batch & Jobs
125
+ def run_batch(self, operations: List[Dict[str, Any]]) -> Dict[str, Any]:
126
+ """Execute multiple API operations in an atomic batch."""
127
+ return self._request(
128
+ "/api/v1/batch",
129
+ method="POST",
130
+ data={"operations": operations},
131
+ )
132
+
133
+ def create_job(self, task: str, payload: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
134
+ """Dispatch an asynchronous long-running task."""
135
+ return self._request(
136
+ "/api/v1/jobs",
137
+ method="POST",
138
+ data={"task": task, "payload": payload or {}},
139
+ )
140
+
141
+ def get_job(self, job_id: str) -> Dict[str, Any]:
142
+ """Poll the status of an asynchronous background job."""
143
+ return self._request(f"/api/v1/jobs/{urllib.parse.quote(job_id)}")
144
+
145
+ def wait_for_job(
146
+ self, job_id: str, poll_interval: float = 1.0, timeout: float = 30.0
147
+ ) -> Dict[str, Any]:
148
+ """Helper to poll a background job until completion or timeout."""
149
+ start_time = time.time()
150
+ while time.time() - start_time < timeout:
151
+ job = self.get_job(job_id)
152
+ if job.get("status") in ("completed", "failed"):
153
+ return job
154
+ time.sleep(poll_interval)
155
+ raise TimeoutError(f"Job {job_id} exceeded timeout of {timeout} seconds")
156
+
157
+ # Contact
158
+ def submit_contact(
159
+ self,
160
+ name: str,
161
+ email: str,
162
+ message: str,
163
+ idempotency_key: Optional[str] = None,
164
+ ) -> Dict[str, Any]:
165
+ """Submit an inquiry with idempotency protection."""
166
+ headers = {}
167
+ if idempotency_key:
168
+ headers["Idempotency-Key"] = idempotency_key
169
+ return self._request(
170
+ "/api/v1/contact",
171
+ method="POST",
172
+ data={"name": name, "email": email, "message": message},
173
+ headers=headers,
174
+ )
175
+
176
+ # Docs & MCP
177
+ def get_docs(self, path: str = "llms.txt") -> str:
178
+ """Fetch raw markdown twin or curated LLM index."""
179
+ url = f"{self.base_url}/{path.lstrip('/')}"
180
+ req = urllib.request.Request(url, headers={"Accept": "text/markdown, text/plain, */*"})
181
+ with urllib.request.urlopen(req, timeout=self.timeout) as response:
182
+ return response.read().decode("utf-8")
@@ -0,0 +1,93 @@
1
+ Metadata-Version: 2.4
2
+ Name: shivanshu-sdk
3
+ Version: 1.0.0
4
+ Summary: Official Python SDK for Shivanshu Tiwari Portfolio APIs, project intelligence, and autonomous agent evaluation
5
+ Home-page: https://github.com/SHT4BHARAT/NoIntroNeeded
6
+ Author: Shivanshu Tiwari
7
+ Author-email: Shivanshu Tiwari <sht4bharat@gmail.com>
8
+ License: MIT
9
+ Project-URL: Homepage, https://shivanshutiwari.in
10
+ Project-URL: Documentation, https://shivanshutiwari.in/developers/sdk
11
+ Project-URL: Repository, https://github.com/SHT4BHARAT/NoIntroNeeded
12
+ Keywords: shivanshutiwari,sdk,api-client,ai-agents,mcp,portfolio
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
17
+ Requires-Python: >=3.9
18
+ Description-Content-Type: text/markdown
19
+ Dynamic: author
20
+ Dynamic: home-page
21
+ Dynamic: requires-python
22
+
23
+ # Shivanshu Tiwari Python SDK (`shivanshu-sdk`)
24
+
25
+ Official Python client library for integrating with **Shivanshu Tiwari Portfolio APIs**, project catalogs, asynchronous background jobs, Model Context Protocol (MCP), and sandbox testing.
26
+
27
+ [![PyPI version](https://img.shields.io/badge/pypi-v1.0.0-blue.svg)](https://pypi.org/project/shivanshu-sdk/)
28
+ [![Python 3.9+](https://img.shields.io/badge/python-3.9+-brightgreen.svg)](https://www.python.org/)
29
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
30
+
31
+ ## Installation
32
+
33
+ ```bash
34
+ pip install shivanshu-sdk
35
+ ```
36
+
37
+ *Note: The SDK relies solely on the Python standard library with zero external dependencies.*
38
+
39
+ ## Quick Start
40
+
41
+ ```python
42
+ from shivanshu import ShivanshuClient
43
+
44
+ # Initialize client (uses https://shivanshutiwari.in by default)
45
+ client = ShivanshuClient()
46
+
47
+ # 1. Query engineering projects
48
+ res = client.list_projects(domain="ai-agents")
49
+ print(f"Total projects: {len(res['data'])}")
50
+ for proj in res["data"]:
51
+ print(f"- {proj['title']} ({proj['slug']})")
52
+
53
+ # 2. Inspect project architecture and technical tradeoffs
54
+ project = client.get_project("agentic-honey-pot")
55
+ print("Architecture:", project.get("architecture", {}).get("summary"))
56
+
57
+ # 3. Test sandbox environment
58
+ sandbox = client.ping_sandbox()
59
+ print("Sandbox status:", sandbox)
60
+
61
+ # 4. Generate ephemeral sandbox key
62
+ key_data = client.generate_key()
63
+ print("Test API key:", key_data["apiKey"])
64
+ ```
65
+
66
+ ## Features
67
+
68
+ - **Zero Dependencies:** Pure Python 3.9+ using standard `urllib` and `json`.
69
+ - **Project Intelligence:** Query 19 engineering projects, architecture diagrams, and honest limitation disclosures.
70
+ - **Batch Processing:** Run multi-step operations in an atomic batch.
71
+ - **Async Polling:** Built-in `wait_for_job(job_id)` helper.
72
+ - **AI Agent Friendly:** Built for ingestion by autonomous agents, LangChain tools, and AutoGen systems.
73
+
74
+ ## API Reference
75
+
76
+ - `client.list_projects(limit=20, cursor=None, domain=None)`
77
+ - `client.get_project(slug)`
78
+ - `client.compare_projects(slug_a, slug_b)`
79
+ - `client.generate_key()`
80
+ - `client.ping_sandbox()`
81
+ - `client.sandbox_contact(name, email, message)`
82
+ - `client.run_batch(operations)`
83
+ - `client.create_job(task, payload=None)`
84
+ - `client.get_job(job_id)`
85
+ - `client.wait_for_job(job_id, poll_interval=1.0, timeout=30.0)`
86
+ - `client.submit_contact(name, email, message, idempotency_key=None)`
87
+ - `client.get_docs(path="llms.txt")`
88
+
89
+ ## Links
90
+
91
+ - **Developer Portal:** [https://shivanshutiwari.in/developers](https://shivanshutiwari.in/developers)
92
+ - **CLI Tool:** [https://shivanshutiwari.in/developers/cli](https://shivanshutiwari.in/developers/cli)
93
+ - **OpenAPI Spec:** [https://shivanshutiwari.in/openapi.json](https://shivanshutiwari.in/openapi.json)
@@ -0,0 +1,9 @@
1
+ README.md
2
+ pyproject.toml
3
+ setup.py
4
+ shivanshu/__init__.py
5
+ shivanshu/client.py
6
+ shivanshu_sdk.egg-info/PKG-INFO
7
+ shivanshu_sdk.egg-info/SOURCES.txt
8
+ shivanshu_sdk.egg-info/dependency_links.txt
9
+ shivanshu_sdk.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ shivanshu