indieward 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.
- indieward-0.1.0/LICENSE +21 -0
- indieward-0.1.0/PKG-INFO +178 -0
- indieward-0.1.0/README.md +152 -0
- indieward-0.1.0/pyproject.toml +47 -0
- indieward-0.1.0/setup.cfg +4 -0
- indieward-0.1.0/src/indieward/__init__.py +3 -0
- indieward-0.1.0/src/indieward/certificate.py +202 -0
- indieward-0.1.0/src/indieward/check.py +631 -0
- indieward-0.1.0/src/indieward/cli.py +410 -0
- indieward-0.1.0/src/indieward/common_index.py +97 -0
- indieward-0.1.0/src/indieward/data/common.json +631 -0
- indieward-0.1.0/src/indieward/doctor.py +159 -0
- indieward-0.1.0/src/indieward/fp_audio.py +69 -0
- indieward-0.1.0/src/indieward/fp_code.py +168 -0
- indieward-0.1.0/src/indieward/fp_image.py +161 -0
- indieward-0.1.0/src/indieward/fp_text.py +117 -0
- indieward-0.1.0/src/indieward/fp_video.py +35 -0
- indieward-0.1.0/src/indieward/hooks.py +347 -0
- indieward-0.1.0/src/indieward/inject.py +445 -0
- indieward-0.1.0/src/indieward/mcp_server.py +354 -0
- indieward-0.1.0/src/indieward/mediaio.py +147 -0
- indieward-0.1.0/src/indieward/notice.py +115 -0
- indieward-0.1.0/src/indieward/package.py +313 -0
- indieward-0.1.0/src/indieward/payload.py +43 -0
- indieward-0.1.0/src/indieward/registry.py +174 -0
- indieward-0.1.0/src/indieward/signals.py +42 -0
- indieward-0.1.0/src/indieward/stores.py +69 -0
- indieward-0.1.0/src/indieward/timestamp.py +182 -0
- indieward-0.1.0/src/indieward/traps.py +517 -0
- indieward-0.1.0/src/indieward/util.py +91 -0
- indieward-0.1.0/src/indieward/vault.py +208 -0
- indieward-0.1.0/src/indieward/verify.py +175 -0
- indieward-0.1.0/src/indieward/watch.py +189 -0
- indieward-0.1.0/src/indieward/wm_audio.py +172 -0
- indieward-0.1.0/src/indieward/wm_core.py +161 -0
- indieward-0.1.0/src/indieward/wm_image.py +215 -0
- indieward-0.1.0/src/indieward/wm_trustmark.py +146 -0
- indieward-0.1.0/src/indieward/wm_video.py +142 -0
- indieward-0.1.0/src/indieward.egg-info/PKG-INFO +178 -0
- indieward-0.1.0/src/indieward.egg-info/SOURCES.txt +60 -0
- indieward-0.1.0/src/indieward.egg-info/dependency_links.txt +1 -0
- indieward-0.1.0/src/indieward.egg-info/entry_points.txt +4 -0
- indieward-0.1.0/src/indieward.egg-info/requires.txt +21 -0
- indieward-0.1.0/src/indieward.egg-info/top_level.txt +1 -0
- indieward-0.1.0/tests/test_common_index.py +169 -0
- indieward-0.1.0/tests/test_doctor.py +157 -0
- indieward-0.1.0/tests/test_end_to_end.py +484 -0
- indieward-0.1.0/tests/test_fp_code.py +105 -0
- indieward-0.1.0/tests/test_fp_image_matrix.py +82 -0
- indieward-0.1.0/tests/test_inject.py +338 -0
- indieward-0.1.0/tests/test_launch_posts.py +30 -0
- indieward-0.1.0/tests/test_live.py +77 -0
- indieward-0.1.0/tests/test_mcp_watch_inject.py +115 -0
- indieward-0.1.0/tests/test_notice.py +115 -0
- indieward-0.1.0/tests/test_plugin.py +310 -0
- indieward-0.1.0/tests/test_rbxl_fixture.py +45 -0
- indieward-0.1.0/tests/test_release.py +83 -0
- indieward-0.1.0/tests/test_site.py +77 -0
- indieward-0.1.0/tests/test_timestamp_ots.py +89 -0
- indieward-0.1.0/tests/test_ue5.py +62 -0
- indieward-0.1.0/tests/test_watch.py +179 -0
- indieward-0.1.0/tests/test_wm_trustmark.py +199 -0
indieward-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 IndieWard contributors
|
|
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.
|
indieward-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: indieward
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Anti-clone toolkit for indie game developers: signed timestamped proof, watermarks, trap markers, plagiarism checks and takedown drafts. Runs locally; never sends anything.
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Requires-Dist: numpy>=1.24
|
|
10
|
+
Requires-Dist: scipy>=1.10
|
|
11
|
+
Requires-Dist: pillow>=10.0
|
|
12
|
+
Requires-Dist: cryptography>=41
|
|
13
|
+
Requires-Dist: reportlab>=4.0
|
|
14
|
+
Provides-Extra: mcp
|
|
15
|
+
Requires-Dist: mcp>=1.2; extra == "mcp"
|
|
16
|
+
Provides-Extra: roblox
|
|
17
|
+
Requires-Dist: zstandard>=0.22; extra == "roblox"
|
|
18
|
+
Provides-Extra: trustmark
|
|
19
|
+
Requires-Dist: trustmark>=0.9; extra == "trustmark"
|
|
20
|
+
Provides-Extra: site
|
|
21
|
+
Requires-Dist: markdown-it-py>=3; extra == "site"
|
|
22
|
+
Provides-Extra: dev
|
|
23
|
+
Requires-Dist: pytest>=8; extra == "dev"
|
|
24
|
+
Requires-Dist: markdown-it-py>=3; extra == "dev"
|
|
25
|
+
Dynamic: license-file
|
|
26
|
+
|
|
27
|
+
# IndieWard
|
|
28
|
+
|
|
29
|
+
Free, open-source anti-clone toolkit for indie game developers. It runs on your own machine and never sends anything for you.
|
|
30
|
+
|
|
31
|
+
- **Prove you had it first:** register art, audio, video, code, story text and builds. Each gets a SHA-256 hash in a certificate signed with your key and timestamped by two independent services (an RFC 3161 authority, and OpenTimestamps, which anchors in Bitcoin once you upgrade the proof with the official `ots` client).
|
|
32
|
+
- **Mark what you publish:** invisible watermarks for images, audio and video (IW-Mark v1, an open format; each mark carries an ID plus a MAC only your key can produce). Optional [TrustMark](https://github.com/adobe/trustmark) image backend (`pip install "indieward[trustmark]"`, then `register --backend trustmark`) so others can read the ID without your vault. Visible burn-in marks and low-res previews for footage.
|
|
33
|
+
- **Trap markers in builds:** inert made-up strings, constants, a dead function and a tiny hidden image, recorded privately. Finding one inside a suspect's files is near-proof they ripped your build, even with redrawn art.
|
|
34
|
+
- **Check a suspect:** traps, watermarks, and fingerprints (code winnowing, perceptual image hashes, audio landmarks, text matching, video frames) produce a 0-100 score per category, each labeled **Strong**, **Supporting** or **Weak** as a basis for filing, with matches shown side by side.
|
|
35
|
+
- **Takedown package:** signed certificate, evidence, a pre-filled DMCA (or trademark) notice, and a pre-addressed `.eml` draft plus checklist for Steam, itch.io and Roblox. **You** review and send it.
|
|
36
|
+
- **Claude plugin:** skills, an evidence-review agent and guardrail hooks that guide you through all of it (`plugin/`).
|
|
37
|
+
|
|
38
|
+
## What it can't do (read this)
|
|
39
|
+
|
|
40
|
+
- **Nothing stops an AI, or a person, from decompiling a shipped game or rebuilding one from footage.** A build has to run on the player's machine, so everything needed to read it is there. Footage is pixels. IndieWard makes proof cheap and filing fast; it doesn't block anything.
|
|
41
|
+
- Watermarks can be stripped and don't survive AI regeneration or redraws. Traps can be found and removed by a careful cloner. Fingerprints miss full re-implementations.
|
|
42
|
+
- A score measures similarity to your registered work. It **can't show whether an AI was used** or what any AI read: nobody can see another party's prompts or logs. It's evidence for you to weigh, **not a legal finding**.
|
|
43
|
+
- Game mechanics aren't protected by copyright. Reports built only on mechanics say so and advise against filing.
|
|
44
|
+
- Not legal advice.
|
|
45
|
+
|
|
46
|
+
## Install
|
|
47
|
+
|
|
48
|
+
Needs Python 3.10+, [FFmpeg](https://ffmpeg.org/download.html) (for audio and video) and `openssl` (for RFC 3161 timestamps). `indieward doctor` checks all of them and prints the command to fix anything missing. It never installs anything itself.
|
|
49
|
+
|
|
50
|
+
### Windows
|
|
51
|
+
|
|
52
|
+
In PowerShell or Command Prompt:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
winget install Python.Python.3.12
|
|
56
|
+
winget install Gyan.FFmpeg
|
|
57
|
+
winget install Git.Git
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Open a **new** terminal (so PATH updates), then:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
py -m pip install --user pipx
|
|
64
|
+
py -m pipx ensurepath
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Open another new terminal, then:
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
pipx install "indieward[mcp]"
|
|
71
|
+
indieward doctor
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Git for Windows ships `openssl.exe`, but its default install usually leaves it off PATH. If `doctor` says so, add `C:\Program Files\Git\mingw64\bin` to your PATH (Start → "Edit the system environment variables" → Environment Variables → Path → New) and open a new terminal.
|
|
75
|
+
|
|
76
|
+
### macOS
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
brew install python@3.12 ffmpeg pipx
|
|
80
|
+
pipx ensurepath
|
|
81
|
+
pipx install "indieward[mcp]"
|
|
82
|
+
indieward doctor
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Linux (Debian/Ubuntu)
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
sudo apt install python3 pipx ffmpeg openssl
|
|
89
|
+
pipx ensurepath
|
|
90
|
+
pipx install "indieward[mcp]"
|
|
91
|
+
indieward doctor
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
If `indieward` isn't on PyPI yet when you read this, install straight from GitHub instead: `pipx install "indieward[mcp] @ git+https://github.com/JEBANERD/indieward"`.
|
|
95
|
+
|
|
96
|
+
Optional: `pipx inject --include-apps indieward opentimestamps-client` adds the official `ots` client, which upgrades your OpenTimestamps proofs once Bitcoin confirms them. The official client may not start on Windows (it fails while loading OpenSSL); your proof stays safe and pending, and you can upgrade the same `.ots` file later on macOS, Linux or WSL. `indieward doctor` tells you if it can't start.
|
|
97
|
+
|
|
98
|
+
### From source
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
git clone https://github.com/JEBANERD/indieward && cd indieward
|
|
102
|
+
pip install -e ".[mcp,dev]"
|
|
103
|
+
indieward doctor
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Quick start
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
cd MyGame
|
|
110
|
+
indieward init --name "My Game" --creator "My Studio LLC" --email me@example.com
|
|
111
|
+
indieward status # shows your verification code
|
|
112
|
+
# paste the code into your game's public store description, then:
|
|
113
|
+
indieward verify page --store itch --url https://you.itch.io/my-game
|
|
114
|
+
indieward published 2026-10-01 # first publication date (tracks the 3-month copyright window)
|
|
115
|
+
indieward register art --category art
|
|
116
|
+
indieward register ui --category ui
|
|
117
|
+
indieward register music trailers src dialogue
|
|
118
|
+
indieward cert # signed + timestamped certificate (JSON + PDF)
|
|
119
|
+
indieward notice # visible copyright line, SPDX headers, metadata, AGENTS.md notice
|
|
120
|
+
indieward watch run # opt-in: is your trap file archived publicly? (hash lookup; --sources github,npm to text-search)
|
|
121
|
+
|
|
122
|
+
indieward traps new --label "v1.0 release" --engine godot --out traps_v1
|
|
123
|
+
# ...copy the snippet into the project as its comments say, export the build...
|
|
124
|
+
indieward build register --build <build_id> path/to/export
|
|
125
|
+
|
|
126
|
+
# a clone shows up
|
|
127
|
+
indieward check path/to/suspect_build.zip --store-url https://store.example/clone
|
|
128
|
+
indieward package --check <check_id> --url https://clone.itch.io/game # targets only the stores your URLs are on
|
|
129
|
+
# -> .indieward/packages/<check>_copyright/ (read BEFORE_YOU_SEND.md, then send from your own email)
|
|
130
|
+
indieward takedown sent --check <check_id> --store itch
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Back up the `.indieward/` folder privately. It holds your keys and trap records; it's git-ignored automatically, which also means `git clean -x` and `git stash --all` delete it. Use `git clean -fd` instead.
|
|
134
|
+
|
|
135
|
+
**Upgrading from a version before 2026-10-31:** code fingerprints now use each language's own comment rules, so minified JavaScript is fully read. Fingerprints of JS, TS, C#, Lua and Python files changed. Builds you registered earlier still match, but on fewer tokens. Run `indieward build register` on them again for the strongest code comparison.
|
|
136
|
+
|
|
137
|
+
## The Claude plugin
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
/plugin marketplace add JEBANERD/indieward
|
|
141
|
+
/plugin install indieward@indieward
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
In Cowork: Customize → Plugins → Add marketplace → `JEBANERD/indieward`. Then open your game folder and say "protect my game". See [plugin/README.md](plugin/README.md).
|
|
145
|
+
|
|
146
|
+
## Tests (the end-to-end demo)
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
pip install -e ".[mcp,dev]"
|
|
150
|
+
pytest -q # core suite
|
|
151
|
+
pytest -q -m engine # engine exports (needs godot / rojo / npm on PATH)
|
|
152
|
+
INDIEWARD_LIVE=1 pytest -q -m live # real outside services
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
`tests/test_end_to_end.py` builds a synthetic game, registers it as a verified creator, watermarks an image, an audio clip and a video, adds trap markers to the build, survives screenshots and re-encodes, issues a certificate timestamped by a throwaway local RFC 3161 authority, then checks a planted clone (variables renamed, functions reordered, art recolored and resized, dialogue reworded, watermarks stripped, traps left in) against an unrelated game, and builds the takedown package. Network calls are stubbed; nothing leaves the machine.
|
|
156
|
+
|
|
157
|
+
## Headless build loop
|
|
158
|
+
|
|
159
|
+
`docs/headless/` holds a queue of task cards for the rest of the roadmap. `.github/workflows/claude-headless.yml` works one card per weekday run with Claude Code and opens a pull request for review; `ci.yml`, `engines.yml` (Godot, Rojo, Vite exports) and `live.yml` (real timestamp and store services) check the results. One-time setup: [docs/headless/SETUP.md](docs/headless/SETUP.md).
|
|
160
|
+
|
|
161
|
+
## Layout
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
src/indieward/ engine (CLI, MCP server, hooks)
|
|
165
|
+
plugin/ Claude plugin (skills, agent, hooks, MCP config)
|
|
166
|
+
docs/ creator guide, IW-Mark v1 spec, threat model
|
|
167
|
+
tests/ end-to-end and plugin tests
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Open and private
|
|
171
|
+
|
|
172
|
+
All code is open source (MIT). What stays private is each creator's own data on their own machine: signing and MAC keys, trap values, fingerprints and asset copies. See [docs/threat-model.md](docs/threat-model.md).
|
|
173
|
+
|
|
174
|
+
## License
|
|
175
|
+
|
|
176
|
+
MIT. See [LICENSE](LICENSE). Forks are welcome; the IndieWard name is reserved for builds that keep its safety rules (see [TRADEMARKS.md](TRADEMARKS.md)).
|
|
177
|
+
|
|
178
|
+
**What IndieWard makes for you is yours.** The trap snippets and files from `indieward traps`, the keys `traps inject` adds to your data files, your watermarked copies, notices, certificates and takedown drafts can go into any game or project, open or closed source, without crediting IndieWard or including its licence. Where that output contains text from IndieWard's own templates, the IndieWard contributors license that text to you under [MIT-0](https://opensource.org/license/mit-0), which is MIT without the requirement to keep the notice. The MIT licence covers IndieWard's own code.
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# IndieWard
|
|
2
|
+
|
|
3
|
+
Free, open-source anti-clone toolkit for indie game developers. It runs on your own machine and never sends anything for you.
|
|
4
|
+
|
|
5
|
+
- **Prove you had it first:** register art, audio, video, code, story text and builds. Each gets a SHA-256 hash in a certificate signed with your key and timestamped by two independent services (an RFC 3161 authority, and OpenTimestamps, which anchors in Bitcoin once you upgrade the proof with the official `ots` client).
|
|
6
|
+
- **Mark what you publish:** invisible watermarks for images, audio and video (IW-Mark v1, an open format; each mark carries an ID plus a MAC only your key can produce). Optional [TrustMark](https://github.com/adobe/trustmark) image backend (`pip install "indieward[trustmark]"`, then `register --backend trustmark`) so others can read the ID without your vault. Visible burn-in marks and low-res previews for footage.
|
|
7
|
+
- **Trap markers in builds:** inert made-up strings, constants, a dead function and a tiny hidden image, recorded privately. Finding one inside a suspect's files is near-proof they ripped your build, even with redrawn art.
|
|
8
|
+
- **Check a suspect:** traps, watermarks, and fingerprints (code winnowing, perceptual image hashes, audio landmarks, text matching, video frames) produce a 0-100 score per category, each labeled **Strong**, **Supporting** or **Weak** as a basis for filing, with matches shown side by side.
|
|
9
|
+
- **Takedown package:** signed certificate, evidence, a pre-filled DMCA (or trademark) notice, and a pre-addressed `.eml` draft plus checklist for Steam, itch.io and Roblox. **You** review and send it.
|
|
10
|
+
- **Claude plugin:** skills, an evidence-review agent and guardrail hooks that guide you through all of it (`plugin/`).
|
|
11
|
+
|
|
12
|
+
## What it can't do (read this)
|
|
13
|
+
|
|
14
|
+
- **Nothing stops an AI, or a person, from decompiling a shipped game or rebuilding one from footage.** A build has to run on the player's machine, so everything needed to read it is there. Footage is pixels. IndieWard makes proof cheap and filing fast; it doesn't block anything.
|
|
15
|
+
- Watermarks can be stripped and don't survive AI regeneration or redraws. Traps can be found and removed by a careful cloner. Fingerprints miss full re-implementations.
|
|
16
|
+
- A score measures similarity to your registered work. It **can't show whether an AI was used** or what any AI read: nobody can see another party's prompts or logs. It's evidence for you to weigh, **not a legal finding**.
|
|
17
|
+
- Game mechanics aren't protected by copyright. Reports built only on mechanics say so and advise against filing.
|
|
18
|
+
- Not legal advice.
|
|
19
|
+
|
|
20
|
+
## Install
|
|
21
|
+
|
|
22
|
+
Needs Python 3.10+, [FFmpeg](https://ffmpeg.org/download.html) (for audio and video) and `openssl` (for RFC 3161 timestamps). `indieward doctor` checks all of them and prints the command to fix anything missing. It never installs anything itself.
|
|
23
|
+
|
|
24
|
+
### Windows
|
|
25
|
+
|
|
26
|
+
In PowerShell or Command Prompt:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
winget install Python.Python.3.12
|
|
30
|
+
winget install Gyan.FFmpeg
|
|
31
|
+
winget install Git.Git
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Open a **new** terminal (so PATH updates), then:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
py -m pip install --user pipx
|
|
38
|
+
py -m pipx ensurepath
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Open another new terminal, then:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
pipx install "indieward[mcp]"
|
|
45
|
+
indieward doctor
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Git for Windows ships `openssl.exe`, but its default install usually leaves it off PATH. If `doctor` says so, add `C:\Program Files\Git\mingw64\bin` to your PATH (Start → "Edit the system environment variables" → Environment Variables → Path → New) and open a new terminal.
|
|
49
|
+
|
|
50
|
+
### macOS
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
brew install python@3.12 ffmpeg pipx
|
|
54
|
+
pipx ensurepath
|
|
55
|
+
pipx install "indieward[mcp]"
|
|
56
|
+
indieward doctor
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Linux (Debian/Ubuntu)
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
sudo apt install python3 pipx ffmpeg openssl
|
|
63
|
+
pipx ensurepath
|
|
64
|
+
pipx install "indieward[mcp]"
|
|
65
|
+
indieward doctor
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
If `indieward` isn't on PyPI yet when you read this, install straight from GitHub instead: `pipx install "indieward[mcp] @ git+https://github.com/JEBANERD/indieward"`.
|
|
69
|
+
|
|
70
|
+
Optional: `pipx inject --include-apps indieward opentimestamps-client` adds the official `ots` client, which upgrades your OpenTimestamps proofs once Bitcoin confirms them. The official client may not start on Windows (it fails while loading OpenSSL); your proof stays safe and pending, and you can upgrade the same `.ots` file later on macOS, Linux or WSL. `indieward doctor` tells you if it can't start.
|
|
71
|
+
|
|
72
|
+
### From source
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
git clone https://github.com/JEBANERD/indieward && cd indieward
|
|
76
|
+
pip install -e ".[mcp,dev]"
|
|
77
|
+
indieward doctor
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Quick start
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
cd MyGame
|
|
84
|
+
indieward init --name "My Game" --creator "My Studio LLC" --email me@example.com
|
|
85
|
+
indieward status # shows your verification code
|
|
86
|
+
# paste the code into your game's public store description, then:
|
|
87
|
+
indieward verify page --store itch --url https://you.itch.io/my-game
|
|
88
|
+
indieward published 2026-10-01 # first publication date (tracks the 3-month copyright window)
|
|
89
|
+
indieward register art --category art
|
|
90
|
+
indieward register ui --category ui
|
|
91
|
+
indieward register music trailers src dialogue
|
|
92
|
+
indieward cert # signed + timestamped certificate (JSON + PDF)
|
|
93
|
+
indieward notice # visible copyright line, SPDX headers, metadata, AGENTS.md notice
|
|
94
|
+
indieward watch run # opt-in: is your trap file archived publicly? (hash lookup; --sources github,npm to text-search)
|
|
95
|
+
|
|
96
|
+
indieward traps new --label "v1.0 release" --engine godot --out traps_v1
|
|
97
|
+
# ...copy the snippet into the project as its comments say, export the build...
|
|
98
|
+
indieward build register --build <build_id> path/to/export
|
|
99
|
+
|
|
100
|
+
# a clone shows up
|
|
101
|
+
indieward check path/to/suspect_build.zip --store-url https://store.example/clone
|
|
102
|
+
indieward package --check <check_id> --url https://clone.itch.io/game # targets only the stores your URLs are on
|
|
103
|
+
# -> .indieward/packages/<check>_copyright/ (read BEFORE_YOU_SEND.md, then send from your own email)
|
|
104
|
+
indieward takedown sent --check <check_id> --store itch
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Back up the `.indieward/` folder privately. It holds your keys and trap records; it's git-ignored automatically, which also means `git clean -x` and `git stash --all` delete it. Use `git clean -fd` instead.
|
|
108
|
+
|
|
109
|
+
**Upgrading from a version before 2026-10-31:** code fingerprints now use each language's own comment rules, so minified JavaScript is fully read. Fingerprints of JS, TS, C#, Lua and Python files changed. Builds you registered earlier still match, but on fewer tokens. Run `indieward build register` on them again for the strongest code comparison.
|
|
110
|
+
|
|
111
|
+
## The Claude plugin
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
/plugin marketplace add JEBANERD/indieward
|
|
115
|
+
/plugin install indieward@indieward
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
In Cowork: Customize → Plugins → Add marketplace → `JEBANERD/indieward`. Then open your game folder and say "protect my game". See [plugin/README.md](plugin/README.md).
|
|
119
|
+
|
|
120
|
+
## Tests (the end-to-end demo)
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
pip install -e ".[mcp,dev]"
|
|
124
|
+
pytest -q # core suite
|
|
125
|
+
pytest -q -m engine # engine exports (needs godot / rojo / npm on PATH)
|
|
126
|
+
INDIEWARD_LIVE=1 pytest -q -m live # real outside services
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
`tests/test_end_to_end.py` builds a synthetic game, registers it as a verified creator, watermarks an image, an audio clip and a video, adds trap markers to the build, survives screenshots and re-encodes, issues a certificate timestamped by a throwaway local RFC 3161 authority, then checks a planted clone (variables renamed, functions reordered, art recolored and resized, dialogue reworded, watermarks stripped, traps left in) against an unrelated game, and builds the takedown package. Network calls are stubbed; nothing leaves the machine.
|
|
130
|
+
|
|
131
|
+
## Headless build loop
|
|
132
|
+
|
|
133
|
+
`docs/headless/` holds a queue of task cards for the rest of the roadmap. `.github/workflows/claude-headless.yml` works one card per weekday run with Claude Code and opens a pull request for review; `ci.yml`, `engines.yml` (Godot, Rojo, Vite exports) and `live.yml` (real timestamp and store services) check the results. One-time setup: [docs/headless/SETUP.md](docs/headless/SETUP.md).
|
|
134
|
+
|
|
135
|
+
## Layout
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
src/indieward/ engine (CLI, MCP server, hooks)
|
|
139
|
+
plugin/ Claude plugin (skills, agent, hooks, MCP config)
|
|
140
|
+
docs/ creator guide, IW-Mark v1 spec, threat model
|
|
141
|
+
tests/ end-to-end and plugin tests
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Open and private
|
|
145
|
+
|
|
146
|
+
All code is open source (MIT). What stays private is each creator's own data on their own machine: signing and MAC keys, trap values, fingerprints and asset copies. See [docs/threat-model.md](docs/threat-model.md).
|
|
147
|
+
|
|
148
|
+
## License
|
|
149
|
+
|
|
150
|
+
MIT. See [LICENSE](LICENSE). Forks are welcome; the IndieWard name is reserved for builds that keep its safety rules (see [TRADEMARKS.md](TRADEMARKS.md)).
|
|
151
|
+
|
|
152
|
+
**What IndieWard makes for you is yours.** The trap snippets and files from `indieward traps`, the keys `traps inject` adds to your data files, your watermarked copies, notices, certificates and takedown drafts can go into any game or project, open or closed source, without crediting IndieWard or including its licence. Where that output contains text from IndieWard's own templates, the IndieWard contributors license that text to you under [MIT-0](https://opensource.org/license/mit-0), which is MIT without the requirement to keep the notice. The MIT licence covers IndieWard's own code.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "indieward"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Anti-clone toolkit for indie game developers: signed timestamped proof, watermarks, trap markers, plagiarism checks and takedown drafts. Runs locally; never sends anything."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
requires-python = ">=3.10"
|
|
13
|
+
dependencies = [
|
|
14
|
+
"numpy>=1.24",
|
|
15
|
+
"scipy>=1.10",
|
|
16
|
+
"pillow>=10.0",
|
|
17
|
+
"cryptography>=41",
|
|
18
|
+
"reportlab>=4.0",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
[project.optional-dependencies]
|
|
22
|
+
mcp = ["mcp>=1.2"] # 1.x (FastMCP) and 2.x (MCPServer) both supported
|
|
23
|
+
roblox = ["zstandard>=0.22"]
|
|
24
|
+
trustmark = ["trustmark>=0.9"] # Adobe TrustMark (MIT); pulls in PyTorch (CPU is fine)
|
|
25
|
+
site = ["markdown-it-py>=3"] # guide site builder (site/build.py)
|
|
26
|
+
dev = ["pytest>=8", "markdown-it-py>=3"]
|
|
27
|
+
|
|
28
|
+
[project.scripts]
|
|
29
|
+
indieward = "indieward.cli:main"
|
|
30
|
+
indieward-mcp = "indieward.mcp_server:main"
|
|
31
|
+
indieward-hook = "indieward.hooks:main"
|
|
32
|
+
|
|
33
|
+
[tool.setuptools.packages.find]
|
|
34
|
+
where = ["src"]
|
|
35
|
+
|
|
36
|
+
[tool.setuptools.package-data]
|
|
37
|
+
indieward = ["data/*.json"]
|
|
38
|
+
|
|
39
|
+
[tool.pytest.ini_options]
|
|
40
|
+
testpaths = ["tests"]
|
|
41
|
+
addopts = "-m 'not engine and not live and not slow'"
|
|
42
|
+
markers = [
|
|
43
|
+
"engine: needs a game engine or build tool on PATH (engines workflow)",
|
|
44
|
+
"live: talks to real outside services (live workflow; set INDIEWARD_LIVE=1)",
|
|
45
|
+
"slow: benchmarks, run by hand with -m slow",
|
|
46
|
+
"trustmark: needs the optional trustmark extra (skipped when it isn't installed)",
|
|
47
|
+
]
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
"""Signed, timestamped proof-of-ownership certificates (IndieWard certificate v1).
|
|
2
|
+
|
|
3
|
+
A certificate lists the project's verified store links, every registered
|
|
4
|
+
asset (SHA-256, size, registration time, watermark ID) and every build (its
|
|
5
|
+
trap commitment, not the traps themselves). The body is canonical JSON signed
|
|
6
|
+
with the creator's Ed25519 key; the digest of the signed body is then
|
|
7
|
+
timestamped by an RFC 3161 authority and OpenTimestamps.
|
|
8
|
+
|
|
9
|
+
What it proves: these exact files existed and were held by the holder of this
|
|
10
|
+
key by the timestamp's date, and that key holder had shown control of the
|
|
11
|
+
listed store pages. It does not prove authorship. A US copyright
|
|
12
|
+
registration is stronger evidence of that.
|
|
13
|
+
"""
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
from pathlib import Path
|
|
18
|
+
|
|
19
|
+
from cryptography.exceptions import InvalidSignature
|
|
20
|
+
from cryptography.hazmat.primitives import serialization
|
|
21
|
+
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PublicKey
|
|
22
|
+
|
|
23
|
+
from . import payload as pl, timestamp, util
|
|
24
|
+
from .vault import Vault
|
|
25
|
+
|
|
26
|
+
STATEMENT = (
|
|
27
|
+
"This certificate shows that the listed files (identified by SHA-256) were held by the holder of the "
|
|
28
|
+
"signing key by the time of the attached third-party timestamps, and that this key holder showed control "
|
|
29
|
+
"of the listed store pages. It is evidence of possession at a point in time, not proof of authorship. It "
|
|
30
|
+
"is not a copyright registration and not legal advice."
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def build_body(vault: Vault) -> dict:
|
|
35
|
+
proj = vault.project()
|
|
36
|
+
pub_raw = util.unb64(proj["public_key"])
|
|
37
|
+
ver = [
|
|
38
|
+
{"store": r["store"], "url": r["url"], "method": r["method"], "verified_at": r["verified_at"],
|
|
39
|
+
"evidence_sha256": r["evidence_sha256"], "detail": json.loads(r["detail"] or "{}")}
|
|
40
|
+
for r in vault.verifications() if r["status"] == "verified"
|
|
41
|
+
]
|
|
42
|
+
assets = []
|
|
43
|
+
for r in vault.db.execute("SELECT * FROM assets ORDER BY id").fetchall():
|
|
44
|
+
a = {"record": pl.fmt(r["record_id"]), "kind": r["kind"], "category": r["category"], "name": r["name"],
|
|
45
|
+
"sha256": r["sha256"], "size": r["size"], "registered_at": r["registered_at"]}
|
|
46
|
+
if r["wm_payload"]:
|
|
47
|
+
a["watermark"] = {"format": "IW-Mark v1", "backend": r["wm_backend"],
|
|
48
|
+
"marked_file_sha256": r["wm_output_sha256"]}
|
|
49
|
+
assets.append(a)
|
|
50
|
+
builds = [
|
|
51
|
+
{"build_id": r["id"], "label": r["label"], "engine": r["engine"], "registered_at": r["registered_at"],
|
|
52
|
+
"manifest_sha256": r["manifest_sha256"], "trap_commitment": r["trap_commitment"]}
|
|
53
|
+
for r in vault.db.execute("SELECT * FROM builds ORDER BY registered_at").fetchall()
|
|
54
|
+
]
|
|
55
|
+
docs = [{"kind": r["kind"], "title": r["title"], "sha256": r["sha256"], "added_at": r["added_at"]}
|
|
56
|
+
for r in vault.db.execute("SELECT * FROM docs ORDER BY id").fetchall()]
|
|
57
|
+
return {
|
|
58
|
+
"format": "IndieWard certificate v1",
|
|
59
|
+
"issued_at": util.now_iso(),
|
|
60
|
+
"creator": {"name": proj["creator"], "contact": proj["contact_email"],
|
|
61
|
+
"public_key_ed25519": proj["public_key"],
|
|
62
|
+
"key_fingerprint": util.sha256_bytes(pub_raw)[:32]},
|
|
63
|
+
"project": {"id": proj["id"], "name": proj["name"], "first_published": proj["first_published"],
|
|
64
|
+
"verification_code": proj["verify_code"]},
|
|
65
|
+
"verified_store_links": ver,
|
|
66
|
+
"assets": assets,
|
|
67
|
+
"builds": builds,
|
|
68
|
+
"documents": docs,
|
|
69
|
+
"statement": STATEMENT,
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def issue(vault: Vault, out_dir=None, do_stamp: bool = True, passphrase: str | None = None) -> dict:
|
|
74
|
+
vault.require_verified("issue certificates")
|
|
75
|
+
body = build_body(vault)
|
|
76
|
+
canon = util.canonical_json(body)
|
|
77
|
+
sig = vault.signing_key(passphrase).sign(canon)
|
|
78
|
+
digest = util.sha256_bytes(canon + sig)
|
|
79
|
+
cert = {**body, "signature": {"alg": "Ed25519", "value": util.b64(sig)}, "digest_sha256": digest}
|
|
80
|
+
if do_stamp:
|
|
81
|
+
ts = timestamp.stamp(vault, f"certificate {digest[:12]}", digest)
|
|
82
|
+
cert["timestamps"] = {k: {kk: vv for kk, vv in v.items() if kk != "error"} | (
|
|
83
|
+
{"error": v["error"]} if v.get("error") else {}) for k, v in ts.items()}
|
|
84
|
+
for k, v in ts.items():
|
|
85
|
+
tok = v.get("token")
|
|
86
|
+
if tok:
|
|
87
|
+
cert["timestamps"][k]["token_b64"] = util.b64(vault.path("certs", "timestamps", tok).read_bytes())
|
|
88
|
+
out_dir = Path(out_dir) if out_dir else vault.path("certs")
|
|
89
|
+
out_dir.mkdir(parents=True, exist_ok=True)
|
|
90
|
+
jpath = out_dir / f"certificate_{digest[:12]}.json"
|
|
91
|
+
jpath.write_text(json.dumps(cert, indent=2, ensure_ascii=False))
|
|
92
|
+
pdf = out_dir / f"certificate_{digest[:12]}.pdf"
|
|
93
|
+
render_pdf(cert, pdf)
|
|
94
|
+
return {"json": str(jpath), "pdf": str(pdf), "digest": digest,
|
|
95
|
+
"timestamps": {k: v.get("status") for k, v in cert.get("timestamps", {}).items()}}
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def summary(cert: dict, json_path=None, pdf_path=None) -> dict:
|
|
99
|
+
ts = cert.get("timestamps", {})
|
|
100
|
+
r = ts.get("rfc3161", {})
|
|
101
|
+
if r.get("status") == "stamped":
|
|
102
|
+
stamp = f"independently timestamped by {r.get('service')} at {r.get('time')} (RFC 3161)"
|
|
103
|
+
else:
|
|
104
|
+
stamp = "independent timestamp still pending, so the issue date above is self-reported"
|
|
105
|
+
return {"digest": cert["digest_sha256"], "issued_at": cert["issued_at"], "json": json_path, "pdf": pdf_path,
|
|
106
|
+
"timestamps": {k: v.get("status") for k, v in ts.items()}, "stamp_sentence": stamp,
|
|
107
|
+
"builds": {b["build_id"] for b in cert.get("builds", [])}, "n_assets": len(cert.get("assets", []))}
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
def earliest_covering(vault: Vault, build_ids: set[str]) -> dict | None:
|
|
111
|
+
"""Earliest stamped certificate in the vault that lists these builds and at least one asset."""
|
|
112
|
+
found = []
|
|
113
|
+
for p in sorted(vault.path("certs").glob("certificate_*.json")):
|
|
114
|
+
try:
|
|
115
|
+
c = json.loads(p.read_text())
|
|
116
|
+
except Exception:
|
|
117
|
+
continue
|
|
118
|
+
if not verify(c)["valid"]:
|
|
119
|
+
continue
|
|
120
|
+
s = summary(c, str(p), str(p.with_suffix(".pdf")))
|
|
121
|
+
if s["n_assets"] and build_ids <= s["builds"] and Path(s["pdf"]).exists():
|
|
122
|
+
found.append(s)
|
|
123
|
+
stamped = [s for s in found if s["timestamps"].get("rfc3161") == "stamped"]
|
|
124
|
+
pool = stamped or found
|
|
125
|
+
return min(pool, key=lambda s: s["issued_at"]) if pool else None
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def verify(cert_or_path, tsa_ca=None) -> dict:
|
|
129
|
+
cert = json.loads(Path(cert_or_path).read_text()) if not isinstance(cert_or_path, dict) else cert_or_path
|
|
130
|
+
body = {k: v for k, v in cert.items() if k not in ("signature", "digest_sha256", "timestamps")}
|
|
131
|
+
canon = util.canonical_json(body)
|
|
132
|
+
sig = util.unb64(cert["signature"]["value"])
|
|
133
|
+
pub = Ed25519PublicKey.from_public_bytes(util.unb64(cert["creator"]["public_key_ed25519"]))
|
|
134
|
+
try:
|
|
135
|
+
pub.verify(sig, canon)
|
|
136
|
+
sig_ok = True
|
|
137
|
+
except InvalidSignature:
|
|
138
|
+
sig_ok = False
|
|
139
|
+
digest_ok = util.sha256_bytes(canon + sig) == cert.get("digest_sha256")
|
|
140
|
+
out = {"signature_valid": sig_ok, "digest_matches": digest_ok, "valid": sig_ok and digest_ok,
|
|
141
|
+
"timestamps": {k: v.get("status") for k, v in cert.get("timestamps", {}).items()}}
|
|
142
|
+
tok = cert.get("timestamps", {}).get("rfc3161", {}).get("token_b64")
|
|
143
|
+
if tok:
|
|
144
|
+
out["rfc3161_token"] = timestamp.check_token(util.unb64(tok), cert.get("digest_sha256", ""), tsa_ca)
|
|
145
|
+
return out
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
def render_pdf(cert: dict, path) -> None:
|
|
149
|
+
from reportlab.lib import colors
|
|
150
|
+
from reportlab.lib.pagesizes import letter
|
|
151
|
+
from reportlab.lib.styles import getSampleStyleSheet
|
|
152
|
+
from reportlab.lib.units import inch
|
|
153
|
+
from reportlab.platypus import Paragraph, SimpleDocTemplate, Spacer, Table, TableStyle
|
|
154
|
+
|
|
155
|
+
styles = getSampleStyleSheet()
|
|
156
|
+
small = styles["BodyText"].clone("small", fontSize=7.5, leading=9)
|
|
157
|
+
body = styles["BodyText"].clone("b", fontSize=9.5, leading=12)
|
|
158
|
+
story = [Paragraph("Proof-of-ownership certificate", styles["Title"]),
|
|
159
|
+
Paragraph(f"<b>Project:</b> {cert['project']['name']} <b>Creator:</b> {cert['creator']['name']}", body),
|
|
160
|
+
Paragraph(f"<b>Issued:</b> {cert['issued_at']} <b>Certificate digest:</b> {cert['digest_sha256']}", small),
|
|
161
|
+
Paragraph(f"<b>Signing key fingerprint:</b> {cert['creator']['key_fingerprint']}", small),
|
|
162
|
+
Spacer(1, 8)]
|
|
163
|
+
ts = cert.get("timestamps", {})
|
|
164
|
+
rows = [["Timestamp", "Status", "Service", "Time"]]
|
|
165
|
+
for k, v in ts.items():
|
|
166
|
+
rows.append([k, v.get("status", ""), v.get("service", "") or "", v.get("time", "") or ""])
|
|
167
|
+
if len(rows) > 1:
|
|
168
|
+
story += [Paragraph("<b>Independent timestamps</b>", body), _tbl(rows, small, Table, TableStyle, colors),
|
|
169
|
+
Spacer(1, 8)]
|
|
170
|
+
vrows = [["Store", "URL", "Method", "Verified at"]] + [
|
|
171
|
+
[v["store"], Paragraph(v["url"], small), v["method"], v["verified_at"]] for v in cert["verified_store_links"]]
|
|
172
|
+
story += [Paragraph("<b>Verified store links</b>", body), _tbl(vrows, small, Table, TableStyle, colors),
|
|
173
|
+
Spacer(1, 8)]
|
|
174
|
+
arows = [["Record", "Category", "File", "SHA-256", "Registered"]] + [
|
|
175
|
+
[a["record"], a["category"], Paragraph(a["name"], small), Paragraph(a["sha256"], small), a["registered_at"]]
|
|
176
|
+
for a in cert["assets"]]
|
|
177
|
+
story += [Paragraph(f"<b>Registered assets ({len(cert['assets'])})</b>", body),
|
|
178
|
+
_tbl(arows, small, Table, TableStyle, colors, widths=[1.0, 0.6, 1.4, 2.6, 1.2]), Spacer(1, 8)]
|
|
179
|
+
if cert["builds"]:
|
|
180
|
+
brows = [["Build", "Label", "Engine", "Trap commitment", "Registered"]] + [
|
|
181
|
+
[b["build_id"], b["label"], b["engine"], Paragraph(b["trap_commitment"], small), b["registered_at"]]
|
|
182
|
+
for b in cert["builds"]]
|
|
183
|
+
story += [Paragraph("<b>Builds with trap markers</b>", body), _tbl(brows, small, Table, TableStyle, colors),
|
|
184
|
+
Spacer(1, 8)]
|
|
185
|
+
story += [Paragraph("<b>What this shows</b>", body), Paragraph(cert["statement"], small), Spacer(1, 6),
|
|
186
|
+
Paragraph("Verify the signature and digest with <font face='Courier'>indieward cert verify "
|
|
187
|
+
"certificate.json</font>, or any Ed25519 tool over the canonical JSON body. The RFC 3161 "
|
|
188
|
+
"token and OpenTimestamps proof are embedded in the JSON file.", small)]
|
|
189
|
+
SimpleDocTemplate(str(path), pagesize=letter, leftMargin=0.6 * inch, rightMargin=0.6 * inch,
|
|
190
|
+
topMargin=0.6 * inch, bottomMargin=0.6 * inch, title="IndieWard certificate").build(story)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
def _tbl(rows, style, Table, TableStyle, colors, widths=None):
|
|
194
|
+
from reportlab.lib.units import inch
|
|
195
|
+
from reportlab.platypus import Paragraph
|
|
196
|
+
|
|
197
|
+
data = [[c if not isinstance(c, str) else Paragraph(c, style) for c in r] for r in rows]
|
|
198
|
+
t = Table(data, colWidths=[w * inch for w in widths] if widths else None, repeatRows=1)
|
|
199
|
+
t.setStyle(TableStyle([("GRID", (0, 0), (-1, -1), 0.4, colors.grey),
|
|
200
|
+
("BACKGROUND", (0, 0), (-1, 0), colors.HexColor("#eeeeee")),
|
|
201
|
+
("VALIGN", (0, 0), (-1, -1), "TOP")]))
|
|
202
|
+
return t
|