deed-page 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,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Avatar 8 LLC
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,85 @@
1
+ Metadata-Version: 2.4
2
+ Name: deed-page
3
+ Version: 0.1.0
4
+ Summary: Official deed.page CLI and client: publish a file or folder to a permanent https://{slug}.deed.page/ URL. No account needed.
5
+ Author-email: Avatar 8 LLC <ops@avatar33.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://deed.page
8
+ Project-URL: Documentation, https://deed.page/docs
9
+ Project-URL: Source, https://github.com/f-o-x11/deed-page-python
10
+ Project-URL: Issues, https://github.com/f-o-x11/deed-page-python/issues
11
+ Keywords: deed.page,static-hosting,publish,deploy,cli,ai-agents,hosting
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Environment :: Console
15
+ Classifier: Topic :: Internet :: WWW/HTTP :: Site Management
16
+ Requires-Python: >=3.8
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Dynamic: license-file
20
+
21
+ # deed-page
22
+
23
+ The official [deed.page](https://deed.page) CLI and Python client. Publish a file or a folder to a permanent `https://{slug}.deed.page/` URL. You don't need an account, an email address or a claim link, and nothing expires after 24 hours.
24
+
25
+ ## Quickstart
26
+
27
+ ```bash
28
+ pip install deed-page # or: pipx install deed-page / uvx deed-page
29
+ deed-page publish ./site --slug my-launch-7f3k
30
+ # https://my-launch-7f3k.deed.page/ (version v1)
31
+ # New owner token saved to ~/.config/deed-page/token
32
+ ```
33
+
34
+ To update the site, run the same command again. Every publish is saved as a new version:
35
+
36
+ ```bash
37
+ deed-page update ./site --slug my-launch-7f3k
38
+ deed-page list
39
+ deed-page delete my-launch-7f3k
40
+ ```
41
+
42
+ It needs Python 3.8 or later and uses only the standard library. `python -m deed_page` works too.
43
+
44
+ ## Token
45
+
46
+ The first publish without a token creates an owner token. The CLI saves it to `~/.config/deed-page/token` (directory mode 700, file mode 600) and never prints it. Later commands read the token from:
47
+
48
+ 1. `DEED_PAGE_TOKEN` (or `DEEDPAGE_TOKEN`)
49
+ 2. `~/.config/deed-page/token` (`$XDG_CONFIG_HOME/deed-page/token` if that is set)
50
+
51
+ The token is the only key that can update or delete your sites. deed.page stores only its SHA-256 hash. To manage billing or attach an optional recovery email, open https://deed.page/account.
52
+
53
+ ## Commands
54
+
55
+ | Command | What it does |
56
+ | --- | --- |
57
+ | `publish <path> --slug <slug>` | Publishes a file or folder. A single `.html` file becomes `index.html`. |
58
+ | `update <path> --slug <slug>` | Same as `publish`, but fails if no token is found. |
59
+ | `list` | Lists the sites you own. |
60
+ | `delete <slug>` | Deletes a site you own. |
61
+ | `whoami` | Shows your plan and usage. |
62
+
63
+ Options: `--merge` replaces only the paths you send, `--spa` turns on single-page-app routing, `--ttl <seconds>` makes the site expire, and `--json` prints the raw response with tokens redacted.
64
+
65
+ ## Library
66
+
67
+ ```python
68
+ from deed_page import DeedPage
69
+
70
+ dp = DeedPage() # reads DEED_PAGE_TOKEN or ~/.config/deed-page/token
71
+ site = dp.publish("./dist", slug="my-launch-7f3k")
72
+ print(site["url"])
73
+
74
+ # Files held in memory work too:
75
+ dp.publish({"index.html": "<!doctype html><h1>Hi</h1>"}, slug="my-launch-7f3k")
76
+ dp.delete("my-launch-7f3k")
77
+ ```
78
+
79
+ ## Limits
80
+
81
+ The Free plan gives you 25 sites, 25 MB per site and 60 publishes an hour. Free sites show a small "Published with deed.page" badge. Each request is capped at 4 MB, and this CLI refuses larger uploads before sending them. For bigger sites, use the manifest upload in the [docs](https://deed.page/docs). Plans and prices are at https://deed.page/pricing.
82
+
83
+ ## License
84
+
85
+ MIT © Avatar 8 LLC. Support: ops@avatar33.com
@@ -0,0 +1,65 @@
1
+ # deed-page
2
+
3
+ The official [deed.page](https://deed.page) CLI and Python client. Publish a file or a folder to a permanent `https://{slug}.deed.page/` URL. You don't need an account, an email address or a claim link, and nothing expires after 24 hours.
4
+
5
+ ## Quickstart
6
+
7
+ ```bash
8
+ pip install deed-page # or: pipx install deed-page / uvx deed-page
9
+ deed-page publish ./site --slug my-launch-7f3k
10
+ # https://my-launch-7f3k.deed.page/ (version v1)
11
+ # New owner token saved to ~/.config/deed-page/token
12
+ ```
13
+
14
+ To update the site, run the same command again. Every publish is saved as a new version:
15
+
16
+ ```bash
17
+ deed-page update ./site --slug my-launch-7f3k
18
+ deed-page list
19
+ deed-page delete my-launch-7f3k
20
+ ```
21
+
22
+ It needs Python 3.8 or later and uses only the standard library. `python -m deed_page` works too.
23
+
24
+ ## Token
25
+
26
+ The first publish without a token creates an owner token. The CLI saves it to `~/.config/deed-page/token` (directory mode 700, file mode 600) and never prints it. Later commands read the token from:
27
+
28
+ 1. `DEED_PAGE_TOKEN` (or `DEEDPAGE_TOKEN`)
29
+ 2. `~/.config/deed-page/token` (`$XDG_CONFIG_HOME/deed-page/token` if that is set)
30
+
31
+ The token is the only key that can update or delete your sites. deed.page stores only its SHA-256 hash. To manage billing or attach an optional recovery email, open https://deed.page/account.
32
+
33
+ ## Commands
34
+
35
+ | Command | What it does |
36
+ | --- | --- |
37
+ | `publish <path> --slug <slug>` | Publishes a file or folder. A single `.html` file becomes `index.html`. |
38
+ | `update <path> --slug <slug>` | Same as `publish`, but fails if no token is found. |
39
+ | `list` | Lists the sites you own. |
40
+ | `delete <slug>` | Deletes a site you own. |
41
+ | `whoami` | Shows your plan and usage. |
42
+
43
+ Options: `--merge` replaces only the paths you send, `--spa` turns on single-page-app routing, `--ttl <seconds>` makes the site expire, and `--json` prints the raw response with tokens redacted.
44
+
45
+ ## Library
46
+
47
+ ```python
48
+ from deed_page import DeedPage
49
+
50
+ dp = DeedPage() # reads DEED_PAGE_TOKEN or ~/.config/deed-page/token
51
+ site = dp.publish("./dist", slug="my-launch-7f3k")
52
+ print(site["url"])
53
+
54
+ # Files held in memory work too:
55
+ dp.publish({"index.html": "<!doctype html><h1>Hi</h1>"}, slug="my-launch-7f3k")
56
+ dp.delete("my-launch-7f3k")
57
+ ```
58
+
59
+ ## Limits
60
+
61
+ The Free plan gives you 25 sites, 25 MB per site and 60 publishes an hour. Free sites show a small "Published with deed.page" badge. Each request is capped at 4 MB, and this CLI refuses larger uploads before sending them. For bigger sites, use the manifest upload in the [docs](https://deed.page/docs). Plans and prices are at https://deed.page/pricing.
62
+
63
+ ## License
64
+
65
+ MIT © Avatar 8 LLC. Support: ops@avatar33.com
@@ -0,0 +1,33 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "deed-page"
7
+ version = "0.1.0"
8
+ description = "Official deed.page CLI and client: publish a file or folder to a permanent https://{slug}.deed.page/ URL. No account needed."
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ authors = [{ name = "Avatar 8 LLC", email = "ops@avatar33.com" }]
14
+ keywords = ["deed.page", "static-hosting", "publish", "deploy", "cli", "ai-agents", "hosting"]
15
+ classifiers = [
16
+ "Programming Language :: Python :: 3",
17
+ "Operating System :: OS Independent",
18
+ "Environment :: Console",
19
+ "Topic :: Internet :: WWW/HTTP :: Site Management",
20
+ ]
21
+ dependencies = []
22
+
23
+ [project.urls]
24
+ Homepage = "https://deed.page"
25
+ Documentation = "https://deed.page/docs"
26
+ Source = "https://github.com/f-o-x11/deed-page-python"
27
+ Issues = "https://github.com/f-o-x11/deed-page-python/issues"
28
+
29
+ [project.scripts]
30
+ deed-page = "deed_page.cli:main"
31
+
32
+ [tool.setuptools.packages.find]
33
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,5 @@
1
+ """Official client for the public deed.page API (https://deed.page/docs)."""
2
+ from .client import DeedPage, DeedPageError, collect_files, load_token, save_token, token_path, redact
3
+
4
+ __version__ = "0.1.0"
5
+ __all__ = ["DeedPage", "DeedPageError", "collect_files", "load_token", "save_token", "token_path", "redact", "__version__"]
@@ -0,0 +1,3 @@
1
+ import sys
2
+ from .cli import main
3
+ sys.exit(main())
@@ -0,0 +1,93 @@
1
+ """deed-page command line interface."""
2
+ import argparse
3
+ import json
4
+ import sys
5
+
6
+ from . import __version__
7
+ from .client import DeedPage, DeedPageError, redact, token_path, TOKEN_RE
8
+
9
+
10
+ def _parser():
11
+ p = argparse.ArgumentParser(
12
+ prog="deed-page",
13
+ description="Publish files to a permanent https://{slug}.deed.page/ URL.",
14
+ epilog="Token: DEED_PAGE_TOKEN (or DEEDPAGE_TOKEN), else %s. The first publish without a token "
15
+ "creates one and saves it there (mode 600). The token is never printed. Docs: https://deed.page/docs"
16
+ % token_path(),
17
+ )
18
+ p.add_argument("-v", "--version", action="version", version=__version__)
19
+ p.add_argument("--json", action="store_true", help="print the raw JSON response (tokens redacted)")
20
+ p.add_argument("--client", help="X-Client name sent to deed.page (default deed-page-pypi/%s)" % __version__)
21
+ sub = p.add_subparsers(dest="cmd")
22
+ for name, helptext in (("publish", "publish a file or folder"), ("update", "update a site you own")):
23
+ s = sub.add_parser(name, help=helptext)
24
+ s.add_argument("path")
25
+ s.add_argument("--slug", required=True)
26
+ s.add_argument("--merge", action="store_true", help="replace only the paths you send")
27
+ s.add_argument("--spa", action="store_true", help="single-page-app routing")
28
+ s.add_argument("--ttl", type=int, help="expire the site after this many seconds")
29
+ sub.add_parser("list", help="list the sites you own")
30
+ d = sub.add_parser("delete", help="delete a site you own")
31
+ d.add_argument("slug")
32
+ sub.add_parser("whoami", help="show your plan and usage")
33
+ return p
34
+
35
+
36
+ def main(argv=None):
37
+ parser = _parser()
38
+ # allow --json / --client after the subcommand too
39
+ argv = list(sys.argv[1:] if argv is None else argv)
40
+ pre = [a for a in argv if a == "--json"]
41
+ argv = pre + [a for a in argv if a != "--json"]
42
+ args = parser.parse_args(argv)
43
+ if not args.cmd:
44
+ parser.print_help()
45
+ return 0
46
+ dp = DeedPage(client=args.client)
47
+
48
+ def out(data, line):
49
+ print(json.dumps(redact(data), indent=2) if args.json else line)
50
+
51
+ try:
52
+ if args.cmd in ("publish", "update"):
53
+ fn = dp.update if args.cmd == "update" else dp.publish
54
+ r = fn(args.path, args.slug, merge=args.merge, spa=args.spa, ttl=args.ttl)
55
+ line = "%s (version %s)" % (r.get("url"), r.get("version"))
56
+ if r.get("token_saved_to"):
57
+ line += ("\nNew owner token saved to %s. Keep it private: it is the only key to update or "
58
+ "delete this site." % r["token_saved_to"])
59
+ badge = r.get("badge") or {}
60
+ if badge.get("shown"):
61
+ line += ('\nFree sites show a small "Published with deed.page" badge. Remove it: %s'
62
+ % (badge.get("upgrade_url") or "https://deed.page/pricing"))
63
+ out(r, line)
64
+ elif args.cmd == "list":
65
+ r = dp.list()
66
+ sites = r.get("sites") or []
67
+ if args.json:
68
+ out(r, "")
69
+ elif not sites:
70
+ print("No sites.")
71
+ else:
72
+ for s in sites:
73
+ print("%s\t%s\t%s" % (s.get("slug"), s.get("url") or "https://%s.deed.page/" % s.get("slug"),
74
+ s.get("version", "")))
75
+ elif args.cmd == "delete":
76
+ out(dp.delete(args.slug), "Deleted %s" % args.slug)
77
+ elif args.cmd == "whoami":
78
+ r = dp.whoami()
79
+ plan = r.get("plan")
80
+ plan = (plan.get("name") or plan.get("id")) if isinstance(plan, dict) else (plan or r.get("stripe_plan"))
81
+ out(r, "plan: %s sites: %s/%s domains: %s/%s" % (plan, r.get("sites", "?"), r.get("site_limit", "?"),
82
+ r.get("domains", "?"), r.get("domain_limit", "?")))
83
+ except (DeedPageError, OSError, ValueError) as e:
84
+ msg = TOKEN_RE.sub("<redacted>", str(e))
85
+ if isinstance(e, DeedPageError) and e.status:
86
+ msg += " (HTTP %s%s)" % (e.status, " " + e.code if e.code else "")
87
+ print("deed-page: %s" % msg, file=sys.stderr)
88
+ return 1
89
+ return 0
90
+
91
+
92
+ if __name__ == "__main__":
93
+ sys.exit(main())
@@ -0,0 +1,181 @@
1
+ """deed.page API client using only the Python standard library."""
2
+ import base64
3
+ import json
4
+ import os
5
+ import re
6
+ import urllib.error
7
+ import urllib.parse
8
+ import urllib.request
9
+ from pathlib import Path
10
+
11
+ VERSION = "0.1.0"
12
+ DEFAULT_BASE = "https://deed.page"
13
+ BODY_LIMIT = 4 * 1000 * 1000 # per-request cap documented at https://deed.page/llms.txt
14
+ SLUG_RE = re.compile(r"^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$")
15
+ TOKEN_RE = re.compile(r"deed_tok_[A-Za-z0-9_\-]+")
16
+ TEXT_EXT = {".html", ".htm", ".css", ".js", ".mjs", ".json", ".txt", ".md", ".svg", ".xml", ".csv",
17
+ ".map", ".webmanifest", ".yml", ".yaml", ".toml"}
18
+ SKIP = {".git", "node_modules", ".DS_Store", ".deed-page", "__pycache__"}
19
+
20
+
21
+ class DeedPageError(Exception):
22
+ def __init__(self, message, status=None, body=None):
23
+ super().__init__(message)
24
+ self.status = status
25
+ self.body = body or {}
26
+ self.code = self.body.get("error") or self.body.get("code") if isinstance(self.body, dict) else None
27
+
28
+
29
+ def config_dir():
30
+ base = os.environ.get("XDG_CONFIG_HOME") or os.path.join(os.path.expanduser("~"), ".config")
31
+ return Path(base) / "deed-page"
32
+
33
+
34
+ def token_path():
35
+ return config_dir() / "token"
36
+
37
+
38
+ def load_token():
39
+ """Token order: DEED_PAGE_TOKEN, DEEDPAGE_TOKEN, then ~/.config/deed-page/token."""
40
+ env = (os.environ.get("DEED_PAGE_TOKEN") or os.environ.get("DEEDPAGE_TOKEN") or "").strip()
41
+ if env:
42
+ return env
43
+ try:
44
+ return token_path().read_text().strip() or None
45
+ except OSError:
46
+ return None
47
+
48
+
49
+ def save_token(token):
50
+ """Save a newly minted token (dir 700, file 600). Never overwrites with an empty value."""
51
+ if not token:
52
+ return None
53
+ d = config_dir()
54
+ d.mkdir(parents=True, exist_ok=True, mode=0o700)
55
+ os.chmod(d, 0o700)
56
+ p = token_path()
57
+ fd = os.open(str(p), os.O_WRONLY | os.O_CREAT | os.O_TRUNC, 0o600)
58
+ with os.fdopen(fd, "w") as f:
59
+ f.write(token)
60
+ os.chmod(p, 0o600)
61
+ return str(p)
62
+
63
+
64
+ def redact(value):
65
+ """Replace any deed_tok_ value so a token is never printed."""
66
+ return json.loads(TOKEN_RE.sub("<redacted>", json.dumps(value)))
67
+
68
+
69
+ def _encode(path):
70
+ data = Path(path).read_bytes()
71
+ if Path(path).suffix.lower() in TEXT_EXT:
72
+ try:
73
+ return data.decode("utf-8")
74
+ except UnicodeDecodeError:
75
+ pass
76
+ return {"base64": base64.b64encode(data).decode("ascii")}
77
+
78
+
79
+ def collect_files(target):
80
+ """Read a file or folder into a deed.page JSON file map."""
81
+ target = Path(target)
82
+ if target.is_file():
83
+ name = "index.html" if target.suffix.lower() in (".html", ".htm") else target.name
84
+ return {name: _encode(target)}
85
+ if not target.is_dir():
86
+ raise FileNotFoundError("Not a file or folder: %s" % target)
87
+ files = {}
88
+ for root, dirs, names in os.walk(target):
89
+ dirs[:] = sorted(d for d in dirs if d not in SKIP and not os.path.islink(os.path.join(root, d)))
90
+ for n in sorted(names):
91
+ p = Path(root) / n
92
+ if n in SKIP or p.is_symlink() or not p.is_file():
93
+ continue
94
+ files[p.relative_to(target).as_posix()] = _encode(p)
95
+ if not files:
96
+ raise ValueError("No files found in %s" % target)
97
+ return files
98
+
99
+
100
+ class DeedPage:
101
+ """Publish, update, list and delete deed.page sites."""
102
+
103
+ def __init__(self, token=None, base_url=None, client=None, save_new_token=True, timeout=60):
104
+ self.base = (base_url or os.environ.get("DEED_PAGE_API") or DEFAULT_BASE).rstrip("/")
105
+ self.token = token if token is not None else load_token()
106
+ self.client = client or "deed-page-pypi/%s" % VERSION
107
+ self.save_new_token = save_new_token
108
+ self.timeout = timeout
109
+ self.new_token = None
110
+
111
+ def _request(self, method, path, body=None, headers=None, auth=True):
112
+ h = {"X-Client": self.client, "User-Agent": "deed-page-pypi/%s" % VERSION, "Accept": "application/json"}
113
+ h.update(headers or {})
114
+ if auth and self.token:
115
+ h["Authorization"] = "Bearer %s" % self.token
116
+ req = urllib.request.Request(self.base + path, data=body, headers=h, method=method)
117
+ try:
118
+ with urllib.request.urlopen(req, timeout=self.timeout) as res:
119
+ status, text = res.status, res.read().decode("utf-8", "replace")
120
+ except urllib.error.HTTPError as e:
121
+ status, text = e.code, e.read().decode("utf-8", "replace")
122
+ try:
123
+ data = json.loads(text) if text else {}
124
+ except ValueError:
125
+ data = {"message": text}
126
+ if status >= 400:
127
+ msg = data.get("message_for_user") or data.get("message") or data.get("error") or "HTTP %s" % status
128
+ raise DeedPageError(TOKEN_RE.sub("<redacted>", str(msg)), status, data)
129
+ return data
130
+
131
+ def _need_token(self):
132
+ if not self.token:
133
+ raise DeedPageError("No token found. Set DEED_PAGE_TOKEN or save it to %s" % token_path())
134
+
135
+ def publish(self, source, slug, merge=False, spa=False, ttl=None, ref="pypi", heard_from=None):
136
+ """Publish a path or a {path: content} map to https://{slug}.deed.page/. Re-publishing updates it."""
137
+ if not slug or not SLUG_RE.match(slug):
138
+ raise ValueError('Invalid slug "%s": 1-63 lowercase letters, digits, hyphens; no leading/trailing hyphen' % slug)
139
+ files = collect_files(source) if isinstance(source, (str, os.PathLike)) else source
140
+ payload = {"slug": slug, "files": files}
141
+ if heard_from and not self.token:
142
+ payload["heard_from"] = heard_from
143
+ body = json.dumps(payload).encode("utf-8")
144
+ if len(body) > BODY_LIMIT:
145
+ raise DeedPageError("Upload is %.1f MB, over the 4 MB per-request cap. Use the manifest upload: "
146
+ "https://deed.page/docs" % (len(body) / 1e6))
147
+ headers = {"Content-Type": "application/json"}
148
+ if merge:
149
+ headers["X-Merge"] = "1"
150
+ if spa:
151
+ headers["X-Spa"] = "1"
152
+ if ttl:
153
+ headers["X-Ttl"] = str(ttl)
154
+ data = self._request("POST", "/v1/sites?ref=%s" % urllib.parse.quote(ref), body, headers)
155
+ minted = data.get("token")
156
+ if minted:
157
+ self.token = minted
158
+ self.new_token = None if self.save_new_token else minted
159
+ data["token_saved_to"] = save_token(minted) if self.save_new_token else None
160
+ data["token"] = "<saved>"
161
+ return data
162
+
163
+ def update(self, source, slug, **kw):
164
+ """Update a site you own. Same as publish, but refuses to run without a token."""
165
+ self._need_token()
166
+ return self.publish(source, slug, **kw)
167
+
168
+ def list(self):
169
+ self._need_token()
170
+ return self._request("GET", "/v1/sites")
171
+
172
+ def get(self, slug):
173
+ return self._request("GET", "/v1/sites/%s" % urllib.parse.quote(slug))
174
+
175
+ def delete(self, slug):
176
+ self._need_token()
177
+ return self._request("DELETE", "/v1/sites/%s" % urllib.parse.quote(slug))
178
+
179
+ def whoami(self):
180
+ self._need_token()
181
+ return self._request("GET", "/v1/whoami")
@@ -0,0 +1,85 @@
1
+ Metadata-Version: 2.4
2
+ Name: deed-page
3
+ Version: 0.1.0
4
+ Summary: Official deed.page CLI and client: publish a file or folder to a permanent https://{slug}.deed.page/ URL. No account needed.
5
+ Author-email: Avatar 8 LLC <ops@avatar33.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://deed.page
8
+ Project-URL: Documentation, https://deed.page/docs
9
+ Project-URL: Source, https://github.com/f-o-x11/deed-page-python
10
+ Project-URL: Issues, https://github.com/f-o-x11/deed-page-python/issues
11
+ Keywords: deed.page,static-hosting,publish,deploy,cli,ai-agents,hosting
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Environment :: Console
15
+ Classifier: Topic :: Internet :: WWW/HTTP :: Site Management
16
+ Requires-Python: >=3.8
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Dynamic: license-file
20
+
21
+ # deed-page
22
+
23
+ The official [deed.page](https://deed.page) CLI and Python client. Publish a file or a folder to a permanent `https://{slug}.deed.page/` URL. You don't need an account, an email address or a claim link, and nothing expires after 24 hours.
24
+
25
+ ## Quickstart
26
+
27
+ ```bash
28
+ pip install deed-page # or: pipx install deed-page / uvx deed-page
29
+ deed-page publish ./site --slug my-launch-7f3k
30
+ # https://my-launch-7f3k.deed.page/ (version v1)
31
+ # New owner token saved to ~/.config/deed-page/token
32
+ ```
33
+
34
+ To update the site, run the same command again. Every publish is saved as a new version:
35
+
36
+ ```bash
37
+ deed-page update ./site --slug my-launch-7f3k
38
+ deed-page list
39
+ deed-page delete my-launch-7f3k
40
+ ```
41
+
42
+ It needs Python 3.8 or later and uses only the standard library. `python -m deed_page` works too.
43
+
44
+ ## Token
45
+
46
+ The first publish without a token creates an owner token. The CLI saves it to `~/.config/deed-page/token` (directory mode 700, file mode 600) and never prints it. Later commands read the token from:
47
+
48
+ 1. `DEED_PAGE_TOKEN` (or `DEEDPAGE_TOKEN`)
49
+ 2. `~/.config/deed-page/token` (`$XDG_CONFIG_HOME/deed-page/token` if that is set)
50
+
51
+ The token is the only key that can update or delete your sites. deed.page stores only its SHA-256 hash. To manage billing or attach an optional recovery email, open https://deed.page/account.
52
+
53
+ ## Commands
54
+
55
+ | Command | What it does |
56
+ | --- | --- |
57
+ | `publish <path> --slug <slug>` | Publishes a file or folder. A single `.html` file becomes `index.html`. |
58
+ | `update <path> --slug <slug>` | Same as `publish`, but fails if no token is found. |
59
+ | `list` | Lists the sites you own. |
60
+ | `delete <slug>` | Deletes a site you own. |
61
+ | `whoami` | Shows your plan and usage. |
62
+
63
+ Options: `--merge` replaces only the paths you send, `--spa` turns on single-page-app routing, `--ttl <seconds>` makes the site expire, and `--json` prints the raw response with tokens redacted.
64
+
65
+ ## Library
66
+
67
+ ```python
68
+ from deed_page import DeedPage
69
+
70
+ dp = DeedPage() # reads DEED_PAGE_TOKEN or ~/.config/deed-page/token
71
+ site = dp.publish("./dist", slug="my-launch-7f3k")
72
+ print(site["url"])
73
+
74
+ # Files held in memory work too:
75
+ dp.publish({"index.html": "<!doctype html><h1>Hi</h1>"}, slug="my-launch-7f3k")
76
+ dp.delete("my-launch-7f3k")
77
+ ```
78
+
79
+ ## Limits
80
+
81
+ The Free plan gives you 25 sites, 25 MB per site and 60 publishes an hour. Free sites show a small "Published with deed.page" badge. Each request is capped at 4 MB, and this CLI refuses larger uploads before sending them. For bigger sites, use the manifest upload in the [docs](https://deed.page/docs). Plans and prices are at https://deed.page/pricing.
82
+
83
+ ## License
84
+
85
+ MIT © Avatar 8 LLC. Support: ops@avatar33.com
@@ -0,0 +1,13 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/deed_page/__init__.py
5
+ src/deed_page/__main__.py
6
+ src/deed_page/cli.py
7
+ src/deed_page/client.py
8
+ src/deed_page.egg-info/PKG-INFO
9
+ src/deed_page.egg-info/SOURCES.txt
10
+ src/deed_page.egg-info/dependency_links.txt
11
+ src/deed_page.egg-info/entry_points.txt
12
+ src/deed_page.egg-info/top_level.txt
13
+ tests/test_offline.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ deed-page = deed_page.cli:main
@@ -0,0 +1 @@
1
+ deed_page
@@ -0,0 +1,27 @@
1
+ import os, stat, tempfile, unittest
2
+ from pathlib import Path
3
+
4
+ class T(unittest.TestCase):
5
+ def setUp(self):
6
+ self.tmp = Path(tempfile.mkdtemp())
7
+ os.environ["XDG_CONFIG_HOME"] = str(self.tmp / "cfg")
8
+ os.environ.pop("DEED_PAGE_TOKEN", None); os.environ.pop("DEEDPAGE_TOKEN", None)
9
+
10
+ def test_collect_and_token(self):
11
+ import deed_page as dp
12
+ s = self.tmp / "site"; (s / "css").mkdir(parents=True)
13
+ (s / "index.html").write_text("<h1>x</h1>"); (s / "css/a.css").write_text("h1{}")
14
+ (s / "logo.png").write_bytes(b"\x89PNG")
15
+ m = dp.collect_files(s)
16
+ self.assertEqual(m["index.html"], "<h1>x</h1>"); self.assertEqual(m["css/a.css"], "h1{}")
17
+ self.assertEqual(m["logo.png"], {"base64": "iVBORw=="})
18
+ self.assertEqual(list(dp.collect_files(s / "index.html")), ["index.html"])
19
+ self.assertIsNone(dp.load_token())
20
+ p = dp.save_token("deed_tok_test123")
21
+ self.assertEqual(stat.S_IMODE(os.stat(p).st_mode), 0o600)
22
+ self.assertEqual(dp.load_token(), "deed_tok_test123")
23
+ os.environ["DEED_PAGE_TOKEN"] = "deed_tok_env"; self.assertEqual(dp.load_token(), "deed_tok_env")
24
+ self.assertEqual(dp.redact({"token": "deed_tok_a-1"}), {"token": "<redacted>"})
25
+
26
+ if __name__ == "__main__":
27
+ unittest.main()