polymarket-cli 0.2.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.
- polymarket_cli-0.2.0/LICENSE +21 -0
- polymarket_cli-0.2.0/PKG-INFO +96 -0
- polymarket_cli-0.2.0/README.md +75 -0
- polymarket_cli-0.2.0/polymarket_cli/__init__.py +2 -0
- polymarket_cli-0.2.0/polymarket_cli/__main__.py +4 -0
- polymarket_cli-0.2.0/polymarket_cli/api.py +652 -0
- polymarket_cli-0.2.0/polymarket_cli/cli.py +482 -0
- polymarket_cli-0.2.0/polymarket_cli/formatting.py +157 -0
- polymarket_cli-0.2.0/pyproject.toml +36 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ra1nty
|
|
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,96 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: polymarket-cli
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Production-oriented read-only CLI wrapper around Polymarket public Gamma + CLOB APIs
|
|
5
|
+
Author: ra1nty
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Topic :: Utilities
|
|
16
|
+
Requires-Python: >=3.11
|
|
17
|
+
Project-URL: Homepage, https://github.com/ra1nty/polymarket-cli
|
|
18
|
+
Project-URL: Repository, https://github.com/ra1nty/polymarket-cli
|
|
19
|
+
Project-URL: Issues, https://github.com/ra1nty/polymarket-cli/issues
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
22
|
+
# polymarket-cli
|
|
23
|
+
|
|
24
|
+
Read-only CLI for public Polymarket Gamma, CLOB, and Data API lookups.
|
|
25
|
+
|
|
26
|
+
This package stays intentionally narrow: public, unauthenticated reads only. It does not place orders, manage wallets, sign anything, or depend on private APIs.
|
|
27
|
+
|
|
28
|
+
The published Pypi package is `polymarket-cli`.
|
|
29
|
+
|
|
30
|
+
## What It Covers
|
|
31
|
+
|
|
32
|
+
- Market discovery via `search` and `list`
|
|
33
|
+
- Market detail lookup via `market`
|
|
34
|
+
- Order book and spot pricing via `book`, `midpoint`, and `price`
|
|
35
|
+
- Recent public trades via `trades`
|
|
36
|
+
- Public token price history via `history`
|
|
37
|
+
|
|
38
|
+
## Install
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
uv tool install polymarket-cli
|
|
42
|
+
polymarket-cli --help
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
For one-off execution:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
uvx polymarket-cli --help
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
If your `uv` tool bin directory is not on `PATH`, either run `uv tool update-shell` or call the binary directly from `$(uv tool dir --bin)`.
|
|
52
|
+
|
|
53
|
+
## Agent Skill Installation
|
|
54
|
+
|
|
55
|
+
Install the packaged skill with `npx skills`:
|
|
56
|
+
|
|
57
|
+
### OpenClaw
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npx skills add ra1nty/polymarket-cli -a openclaw
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Claude Code
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
npx skills add ra1nty/polymarket-cli -a claude-code
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
After installation, use the public command surface in agent prompts and automation:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
polymarket-cli search bitcoin --limit 5
|
|
73
|
+
polymarket-cli market --slug <market-slug> --json
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Usage
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
polymarket-cli search bitcoin --limit 5
|
|
80
|
+
polymarket-cli list --active-only --sort volume24hr --limit 20
|
|
81
|
+
polymarket-cli market --slug btc-updown-5m-1774165800
|
|
82
|
+
polymarket-cli book --slug btc-updown-5m-1774165800 --outcome Down
|
|
83
|
+
polymarket-cli price --slug btc-updown-5m-1774165800
|
|
84
|
+
polymarket-cli history --slug btc-updown-5m-1774165800 --window 6h --format summary --json
|
|
85
|
+
polymarket-cli trades --slug btc-updown-5m-1774165800 --limit 20
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Useful flags:
|
|
89
|
+
|
|
90
|
+
- `--json` is available on every command.
|
|
91
|
+
- `--hydrate` resolves search/list rows to full market detail before local ranking or filtering.
|
|
92
|
+
- `--with-odds` implies hydration and includes current outcome prices.
|
|
93
|
+
- `--with-market` implies hydration and embeds the resolved market payload in JSON output.
|
|
94
|
+
- Market selectors are explicit: `--slug`, `--id`, `--token-id`, `--condition-id`.
|
|
95
|
+
|
|
96
|
+
Supported history intervals: `max`, `all`, `1m`, `1h`, `6h`, `1d`, `1w`.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# polymarket-cli
|
|
2
|
+
|
|
3
|
+
Read-only CLI for public Polymarket Gamma, CLOB, and Data API lookups.
|
|
4
|
+
|
|
5
|
+
This package stays intentionally narrow: public, unauthenticated reads only. It does not place orders, manage wallets, sign anything, or depend on private APIs.
|
|
6
|
+
|
|
7
|
+
The published Pypi package is `polymarket-cli`.
|
|
8
|
+
|
|
9
|
+
## What It Covers
|
|
10
|
+
|
|
11
|
+
- Market discovery via `search` and `list`
|
|
12
|
+
- Market detail lookup via `market`
|
|
13
|
+
- Order book and spot pricing via `book`, `midpoint`, and `price`
|
|
14
|
+
- Recent public trades via `trades`
|
|
15
|
+
- Public token price history via `history`
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
uv tool install polymarket-cli
|
|
21
|
+
polymarket-cli --help
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
For one-off execution:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
uvx polymarket-cli --help
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
If your `uv` tool bin directory is not on `PATH`, either run `uv tool update-shell` or call the binary directly from `$(uv tool dir --bin)`.
|
|
31
|
+
|
|
32
|
+
## Agent Skill Installation
|
|
33
|
+
|
|
34
|
+
Install the packaged skill with `npx skills`:
|
|
35
|
+
|
|
36
|
+
### OpenClaw
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npx skills add ra1nty/polymarket-cli -a openclaw
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Claude Code
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npx skills add ra1nty/polymarket-cli -a claude-code
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
After installation, use the public command surface in agent prompts and automation:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
polymarket-cli search bitcoin --limit 5
|
|
52
|
+
polymarket-cli market --slug <market-slug> --json
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Usage
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
polymarket-cli search bitcoin --limit 5
|
|
59
|
+
polymarket-cli list --active-only --sort volume24hr --limit 20
|
|
60
|
+
polymarket-cli market --slug btc-updown-5m-1774165800
|
|
61
|
+
polymarket-cli book --slug btc-updown-5m-1774165800 --outcome Down
|
|
62
|
+
polymarket-cli price --slug btc-updown-5m-1774165800
|
|
63
|
+
polymarket-cli history --slug btc-updown-5m-1774165800 --window 6h --format summary --json
|
|
64
|
+
polymarket-cli trades --slug btc-updown-5m-1774165800 --limit 20
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Useful flags:
|
|
68
|
+
|
|
69
|
+
- `--json` is available on every command.
|
|
70
|
+
- `--hydrate` resolves search/list rows to full market detail before local ranking or filtering.
|
|
71
|
+
- `--with-odds` implies hydration and includes current outcome prices.
|
|
72
|
+
- `--with-market` implies hydration and embeds the resolved market payload in JSON output.
|
|
73
|
+
- Market selectors are explicit: `--slug`, `--id`, `--token-id`, `--condition-id`.
|
|
74
|
+
|
|
75
|
+
Supported history intervals: `max`, `all`, `1m`, `1h`, `6h`, `1d`, `1w`.
|