atlasdata-sdk 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.
@@ -0,0 +1,32 @@
1
+ Metadata-Version: 2.4
2
+ Name: atlasdata-sdk
3
+ Version: 0.1.0
4
+ Summary: Client for the AtlasData crypto market-data API — x402 (USDC/Base) and L402 (Lightning) per-request payments, plus a free sample endpoint
5
+ Author: AtlasData
6
+ License: MIT
7
+ Project-URL: Homepage, https://atlasdata.surge.sh
8
+ Project-URL: Catalog, https://atlasdata.shares.zrok.io/llms.txt
9
+ Keywords: x402,l402,crypto,api,bitcoin,lightning,payments,agent
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Topic :: Software Development :: Libraries
12
+ Requires-Python: >=3.9
13
+ Description-Content-Type: text/markdown
14
+ Requires-Dist: requests>=2.28
15
+
16
+ # atlasdata-sdk
17
+
18
+ Client for the AtlasData crypto market-data API.
19
+
20
+ - 20 x402 endpoints paid in USDC on Base ($0.001–$0.50)
21
+ - 7 L402 endpoints paid over Lightning (10–200 sats)
22
+ - 1 free sample endpoint, no payment
23
+ - Paid research reports: x402 monetization, L402 playbook, agent micropayments market, mempool fee guide
24
+
25
+ Live: https://atlasdata.surge.sh · Catalog: https://atlasdata.shares.zrok.io/llms.txt
26
+
27
+ ```python
28
+ from atlasdata import AtlasData
29
+ a = AtlasData()
30
+ print(a.free_price("BTC")) # free
31
+ print(a.l402_challenge("/l402/gas")) # returns a BOLT11 invoice for 10 sats
32
+ ```
@@ -0,0 +1,17 @@
1
+ # atlasdata-sdk
2
+
3
+ Client for the AtlasData crypto market-data API.
4
+
5
+ - 20 x402 endpoints paid in USDC on Base ($0.001–$0.50)
6
+ - 7 L402 endpoints paid over Lightning (10–200 sats)
7
+ - 1 free sample endpoint, no payment
8
+ - Paid research reports: x402 monetization, L402 playbook, agent micropayments market, mempool fee guide
9
+
10
+ Live: https://atlasdata.surge.sh · Catalog: https://atlasdata.shares.zrok.io/llms.txt
11
+
12
+ ```python
13
+ from atlasdata import AtlasData
14
+ a = AtlasData()
15
+ print(a.free_price("BTC")) # free
16
+ print(a.l402_challenge("/l402/gas")) # returns a BOLT11 invoice for 10 sats
17
+ ```
@@ -0,0 +1,53 @@
1
+ """AtlasData SDK — paid crypto market-data API over x402 (USDC/Base) or L402 (Lightning).
2
+
3
+ Docs: https://atlasdata.surge.sh · catalog: https://atlasdata.shares.zrok.io/llms.txt
4
+ """
5
+ import requests
6
+
7
+ DEFAULT_BASE = "https://atlasdata.shares.zrok.io"
8
+
9
+ class AtlasData:
10
+ def __init__(self, base=DEFAULT_BASE):
11
+ self.base = base.rstrip("/")
12
+ self.s = requests.Session()
13
+
14
+ # ---- free sample ----
15
+ def free_price(self, symbol="BTC"):
16
+ return self.s.get(f"{self.base}/free/price/{symbol}", timeout=15).json()
17
+
18
+ # ---- L402 (pay invoice, pass preimage) ----
19
+ def l402_call(self, path, pay_invoice):
20
+ """One-call L402 helper. pay_invoice(bolt11)->preimage.
21
+
22
+ On 402, calls pay_invoice(invoice) to obtain the preimage,
23
+ then retries with the Authorization header. Works with any wallet
24
+ that can pay a BOLT11 and return the preimage.
25
+ """
26
+ r = self.s.get(self.base + path, timeout=15)
27
+ if r.status_code != 402:
28
+ return r.json()
29
+ d = r.json()
30
+ preimage = pay_invoice(d["invoice"])
31
+ r2 = self.s.get(self.base + path,
32
+ headers={"Authorization": f"L402 {d['token']}:{preimage}"}, timeout=15)
33
+ return r2.json()
34
+
35
+ def l402_challenge(self, path):
36
+ """Return the 402 challenge (invoice, price, token) without paying."""
37
+ r = self.s.get(self.base + path, timeout=15)
38
+ return r.json() if r.status_code == 402 else {"status": r.status_code, "body": r.json()}
39
+
40
+ # ---- x402 (USDC on Base) ----
41
+ def x402_challenge(self, path):
42
+ r = self.s.get(self.base + path, timeout=15)
43
+ return r.json() if r.status_code == 402 else {"status": r.status_code, "body": r.json()}
44
+
45
+ def x402_call(self, path, x_payment_header):
46
+ r = self.s.get(self.base + path, headers={"X-PAYMENT": x_payment_header}, timeout=15)
47
+ return r.json()
48
+
49
+ # ---- paid report store ----
50
+ def report(self, slug, x_payment_header=None):
51
+ return self.x402_call(f"/api/report/{slug}", x_payment_header) if x_payment_header else self.x402_challenge(f"/api/report/{slug}")
52
+
53
+ __all__ = ["AtlasData", "DEFAULT_BASE"]
@@ -0,0 +1,32 @@
1
+ Metadata-Version: 2.4
2
+ Name: atlasdata-sdk
3
+ Version: 0.1.0
4
+ Summary: Client for the AtlasData crypto market-data API — x402 (USDC/Base) and L402 (Lightning) per-request payments, plus a free sample endpoint
5
+ Author: AtlasData
6
+ License: MIT
7
+ Project-URL: Homepage, https://atlasdata.surge.sh
8
+ Project-URL: Catalog, https://atlasdata.shares.zrok.io/llms.txt
9
+ Keywords: x402,l402,crypto,api,bitcoin,lightning,payments,agent
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Topic :: Software Development :: Libraries
12
+ Requires-Python: >=3.9
13
+ Description-Content-Type: text/markdown
14
+ Requires-Dist: requests>=2.28
15
+
16
+ # atlasdata-sdk
17
+
18
+ Client for the AtlasData crypto market-data API.
19
+
20
+ - 20 x402 endpoints paid in USDC on Base ($0.001–$0.50)
21
+ - 7 L402 endpoints paid over Lightning (10–200 sats)
22
+ - 1 free sample endpoint, no payment
23
+ - Paid research reports: x402 monetization, L402 playbook, agent micropayments market, mempool fee guide
24
+
25
+ Live: https://atlasdata.surge.sh · Catalog: https://atlasdata.shares.zrok.io/llms.txt
26
+
27
+ ```python
28
+ from atlasdata import AtlasData
29
+ a = AtlasData()
30
+ print(a.free_price("BTC")) # free
31
+ print(a.l402_challenge("/l402/gas")) # returns a BOLT11 invoice for 10 sats
32
+ ```
@@ -0,0 +1,8 @@
1
+ README.md
2
+ pyproject.toml
3
+ atlasdata/__init__.py
4
+ atlasdata_sdk.egg-info/PKG-INFO
5
+ atlasdata_sdk.egg-info/SOURCES.txt
6
+ atlasdata_sdk.egg-info/dependency_links.txt
7
+ atlasdata_sdk.egg-info/requires.txt
8
+ atlasdata_sdk.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ requests>=2.28
@@ -0,0 +1 @@
1
+ atlasdata
@@ -0,0 +1,19 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "atlasdata-sdk"
7
+ version = "0.1.0"
8
+ description = "Client for the AtlasData crypto market-data API — x402 (USDC/Base) and L402 (Lightning) per-request payments, plus a free sample endpoint"
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = {text = "MIT"}
12
+ authors = [{name = "AtlasData"}]
13
+ keywords = ["x402", "l402", "crypto", "api", "bitcoin", "lightning", "payments", "agent"]
14
+ classifiers = ["Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries"]
15
+ dependencies = ["requests>=2.28"]
16
+
17
+ [project.urls]
18
+ Homepage = "https://atlasdata.surge.sh"
19
+ Catalog = "https://atlasdata.shares.zrok.io/llms.txt"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+