polymarket-us 0.1.1__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.
Files changed (52) hide show
  1. polymarket_us-0.1.1/.github/ISSUE_TEMPLATE/bug_report.yml +80 -0
  2. polymarket_us-0.1.1/.github/ISSUE_TEMPLATE/config.yml +8 -0
  3. polymarket_us-0.1.1/.github/ISSUE_TEMPLATE/feature_request.yml +36 -0
  4. polymarket_us-0.1.1/.github/pull_request_template.md +13 -0
  5. polymarket_us-0.1.1/.github/workflows/ci.yml +74 -0
  6. polymarket_us-0.1.1/.github/workflows/publish.yml +97 -0
  7. polymarket_us-0.1.1/.gitignore +85 -0
  8. polymarket_us-0.1.1/LICENSE +21 -0
  9. polymarket_us-0.1.1/PKG-INFO +356 -0
  10. polymarket_us-0.1.1/README.md +322 -0
  11. polymarket_us-0.1.1/examples/async_example.py +54 -0
  12. polymarket_us-0.1.1/examples/sync_example.py +52 -0
  13. polymarket_us-0.1.1/examples/websocket_example.py +119 -0
  14. polymarket_us-0.1.1/polymarket_us/__init__.py +43 -0
  15. polymarket_us-0.1.1/polymarket_us/async_client.py +270 -0
  16. polymarket_us-0.1.1/polymarket_us/auth.py +44 -0
  17. polymarket_us-0.1.1/polymarket_us/client.py +268 -0
  18. polymarket_us-0.1.1/polymarket_us/errors.py +65 -0
  19. polymarket_us-0.1.1/polymarket_us/py.typed +0 -0
  20. polymarket_us-0.1.1/polymarket_us/resource.py +64 -0
  21. polymarket_us-0.1.1/polymarket_us/resources/__init__.py +29 -0
  22. polymarket_us-0.1.1/polymarket_us/resources/account.py +28 -0
  23. polymarket_us-0.1.1/polymarket_us/resources/events.py +78 -0
  24. polymarket_us-0.1.1/polymarket_us/resources/markets.py +151 -0
  25. polymarket_us-0.1.1/polymarket_us/resources/orders.py +252 -0
  26. polymarket_us-0.1.1/polymarket_us/resources/portfolio.py +79 -0
  27. polymarket_us-0.1.1/polymarket_us/resources/search.py +34 -0
  28. polymarket_us-0.1.1/polymarket_us/resources/series.py +56 -0
  29. polymarket_us-0.1.1/polymarket_us/resources/sports.py +56 -0
  30. polymarket_us-0.1.1/polymarket_us/types/__init__.py +170 -0
  31. polymarket_us-0.1.1/polymarket_us/types/account.py +39 -0
  32. polymarket_us-0.1.1/polymarket_us/types/common.py +17 -0
  33. polymarket_us-0.1.1/polymarket_us/types/events.py +98 -0
  34. polymarket_us-0.1.1/polymarket_us/types/markets.py +128 -0
  35. polymarket_us-0.1.1/polymarket_us/types/orders.py +209 -0
  36. polymarket_us-0.1.1/polymarket_us/types/portfolio.py +119 -0
  37. polymarket_us-0.1.1/polymarket_us/types/search.py +21 -0
  38. polymarket_us-0.1.1/polymarket_us/types/series.py +42 -0
  39. polymarket_us-0.1.1/polymarket_us/types/sports.py +64 -0
  40. polymarket_us-0.1.1/polymarket_us/websocket/__init__.py +49 -0
  41. polymarket_us-0.1.1/polymarket_us/websocket/base.py +190 -0
  42. polymarket_us-0.1.1/polymarket_us/websocket/markets.py +82 -0
  43. polymarket_us-0.1.1/polymarket_us/websocket/private.py +93 -0
  44. polymarket_us-0.1.1/polymarket_us/websocket/types.py +213 -0
  45. polymarket_us-0.1.1/pyproject.toml +95 -0
  46. polymarket_us-0.1.1/tests/__init__.py +1 -0
  47. polymarket_us-0.1.1/tests/test_auth.py +76 -0
  48. polymarket_us-0.1.1/tests/test_client.py +118 -0
  49. polymarket_us-0.1.1/tests/test_errors.py +114 -0
  50. polymarket_us-0.1.1/tests/test_http_errors.py +115 -0
  51. polymarket_us-0.1.1/tests/test_orders.py +234 -0
  52. polymarket_us-0.1.1/uv.lock +635 -0
@@ -0,0 +1,80 @@
1
+ name: Bug Report
2
+ description: Report a bug in the SDK
3
+ labels: ["bug"]
4
+ body:
5
+ - type: markdown
6
+ attributes:
7
+ value: |
8
+ Thanks for taking the time to report a bug!
9
+
10
+ - type: input
11
+ id: sdk-version
12
+ attributes:
13
+ label: SDK Version
14
+ description: What version of the SDK are you using?
15
+ placeholder: "0.1.0"
16
+ validations:
17
+ required: true
18
+
19
+ - type: input
20
+ id: python-version
21
+ attributes:
22
+ label: Python Version
23
+ description: What version of Python are you using?
24
+ placeholder: "3.12.0"
25
+ validations:
26
+ required: true
27
+
28
+ - type: dropdown
29
+ id: os
30
+ attributes:
31
+ label: Operating System
32
+ options:
33
+ - macOS
34
+ - Linux
35
+ - Windows
36
+ validations:
37
+ required: true
38
+
39
+ - type: textarea
40
+ id: description
41
+ attributes:
42
+ label: Description
43
+ description: A clear description of the bug
44
+ validations:
45
+ required: true
46
+
47
+ - type: textarea
48
+ id: reproduction
49
+ attributes:
50
+ label: Steps to Reproduce
51
+ description: Steps to reproduce the behavior
52
+ placeholder: |
53
+ 1. Initialize client with...
54
+ 2. Call method...
55
+ 3. See error
56
+ validations:
57
+ required: true
58
+
59
+ - type: textarea
60
+ id: expected
61
+ attributes:
62
+ label: Expected Behavior
63
+ description: What did you expect to happen?
64
+ validations:
65
+ required: true
66
+
67
+ - type: textarea
68
+ id: actual
69
+ attributes:
70
+ label: Actual Behavior
71
+ description: What actually happened?
72
+ validations:
73
+ required: true
74
+
75
+ - type: textarea
76
+ id: code
77
+ attributes:
78
+ label: Code Sample
79
+ description: Minimal code to reproduce the issue
80
+ render: python
@@ -0,0 +1,8 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Documentation
4
+ url: https://docs.polymarket.us
5
+ about: Check the documentation for usage guides
6
+ - name: Discord
7
+ url: https://discord.gg/polymarket
8
+ about: Ask questions in our Discord community
@@ -0,0 +1,36 @@
1
+ name: Feature Request
2
+ description: Suggest a new feature
3
+ labels: ["enhancement"]
4
+ body:
5
+ - type: markdown
6
+ attributes:
7
+ value: |
8
+ Thanks for suggesting a feature!
9
+
10
+ - type: textarea
11
+ id: description
12
+ attributes:
13
+ label: Description
14
+ description: A clear description of the feature you'd like
15
+ validations:
16
+ required: true
17
+
18
+ - type: textarea
19
+ id: use-case
20
+ attributes:
21
+ label: Use Case
22
+ description: Why do you need this feature? What problem does it solve?
23
+ validations:
24
+ required: true
25
+
26
+ - type: textarea
27
+ id: alternatives
28
+ attributes:
29
+ label: Alternatives Considered
30
+ description: Any alternative solutions or workarounds you've considered
31
+
32
+ - type: textarea
33
+ id: additional
34
+ attributes:
35
+ label: Additional Context
36
+ description: Any other context, screenshots, or code samples
@@ -0,0 +1,13 @@
1
+ ## Changes
2
+
3
+ <!-- What does this PR do? -->
4
+
5
+ ## Testing
6
+
7
+ <!-- How was this tested? -->
8
+
9
+ ## Checklist
10
+
11
+ - [ ] Tests pass (`pytest`)
12
+ - [ ] Linting passes (`ruff check .`)
13
+ - [ ] Types check (`mypy polymarket_us`)
@@ -0,0 +1,74 @@
1
+ name: CI
2
+
3
+ permissions:
4
+ contents: read
5
+
6
+ on:
7
+ push:
8
+ branches: [main]
9
+ pull_request:
10
+ branches: [main]
11
+
12
+ jobs:
13
+ lint:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+
18
+ - name: Set up Python
19
+ uses: actions/setup-python@v5
20
+ with:
21
+ python-version: '3.12'
22
+
23
+ - name: Install uv
24
+ uses: astral-sh/setup-uv@v4
25
+
26
+ - name: Install dependencies
27
+ run: uv sync --all-extras
28
+
29
+ - name: Run ruff check
30
+ run: uv run ruff check .
31
+
32
+ - name: Run ruff format check
33
+ run: uv run ruff format --check .
34
+
35
+ typecheck:
36
+ runs-on: ubuntu-latest
37
+ steps:
38
+ - uses: actions/checkout@v4
39
+
40
+ - name: Set up Python
41
+ uses: actions/setup-python@v5
42
+ with:
43
+ python-version: '3.12'
44
+
45
+ - name: Install uv
46
+ uses: astral-sh/setup-uv@v4
47
+
48
+ - name: Install dependencies
49
+ run: uv sync --all-extras
50
+
51
+ - name: Run mypy
52
+ run: uv run mypy polymarket_us
53
+
54
+ test:
55
+ runs-on: ubuntu-latest
56
+ strategy:
57
+ matrix:
58
+ python-version: ['3.10', '3.11', '3.12', '3.13']
59
+ steps:
60
+ - uses: actions/checkout@v4
61
+
62
+ - name: Set up Python ${{ matrix.python-version }}
63
+ uses: actions/setup-python@v5
64
+ with:
65
+ python-version: ${{ matrix.python-version }}
66
+
67
+ - name: Install uv
68
+ uses: astral-sh/setup-uv@v4
69
+
70
+ - name: Install dependencies
71
+ run: uv sync --all-extras
72
+
73
+ - name: Run tests
74
+ run: uv run pytest
@@ -0,0 +1,97 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ publish:
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ contents: write
13
+ id-token: write
14
+
15
+ steps:
16
+ - name: Checkout
17
+ uses: actions/checkout@v4
18
+ with:
19
+ fetch-depth: 0
20
+ token: ${{ secrets.GH_PAT }}
21
+
22
+ - name: Set up Python
23
+ uses: actions/setup-python@v5
24
+ with:
25
+ python-version: '3.12'
26
+
27
+ - name: Install uv
28
+ uses: astral-sh/setup-uv@v4
29
+
30
+ - name: Install dependencies
31
+ run: uv sync --all-extras
32
+
33
+ - name: Run tests
34
+ run: uv run pytest
35
+
36
+ - name: Configure Git
37
+ run: |
38
+ git config user.name "github-actions[bot]"
39
+ git config user.email "github-actions[bot]@users.noreply.github.com"
40
+
41
+ - name: Determine version bump type
42
+ id: version
43
+ run: |
44
+ COMMIT_MSG=$(git log -1 --pretty=%B)
45
+ if echo "$COMMIT_MSG" | grep -iq "^feat!:\|BREAKING CHANGE"; then
46
+ echo "bump=major" >> $GITHUB_OUTPUT
47
+ elif echo "$COMMIT_MSG" | grep -iq "^feat:"; then
48
+ echo "bump=minor" >> $GITHUB_OUTPUT
49
+ else
50
+ echo "bump=patch" >> $GITHUB_OUTPUT
51
+ fi
52
+
53
+ - name: Bump version
54
+ run: |
55
+ # Get current version from pyproject.toml
56
+ CURRENT_VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
57
+ if [ -z "$CURRENT_VERSION" ]; then
58
+ echo "Error: Could not extract current version from pyproject.toml"
59
+ exit 1
60
+ fi
61
+
62
+ IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION"
63
+
64
+ BUMP_TYPE="${{ steps.version.outputs.bump }}"
65
+
66
+ if [ "$BUMP_TYPE" = "major" ]; then
67
+ MAJOR=$((MAJOR + 1))
68
+ MINOR=0
69
+ PATCH=0
70
+ elif [ "$BUMP_TYPE" = "minor" ]; then
71
+ MINOR=$((MINOR + 1))
72
+ PATCH=0
73
+ else
74
+ PATCH=$((PATCH + 1))
75
+ fi
76
+
77
+ NEW_VERSION="$MAJOR.$MINOR.$PATCH"
78
+
79
+ # Update version in pyproject.toml - use a pattern that matches any version
80
+ sed -i 's/^version = ".*"/version = "'"$NEW_VERSION"'"/' pyproject.toml
81
+
82
+ echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
83
+ echo "Bumped version from $CURRENT_VERSION to $NEW_VERSION"
84
+
85
+ - name: Commit and push version bump
86
+ run: |
87
+ git add pyproject.toml
88
+ git commit -m "chore: bump version to ${{ env.NEW_VERSION }} [skip ci]"
89
+ git push
90
+
91
+ - name: Build package
92
+ run: uv build
93
+
94
+ - name: Publish to PyPI
95
+ uses: pypa/gh-action-pypi-publish@release/v1
96
+ with:
97
+ password: ${{ secrets.PYPI_API_TOKEN }}
@@ -0,0 +1,85 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ *.manifest
31
+ *.spec
32
+
33
+ # Installer logs
34
+ pip-log.txt
35
+ pip-delete-this-directory.txt
36
+
37
+ # Unit test / coverage reports
38
+ htmlcov/
39
+ .tox/
40
+ .nox/
41
+ .coverage
42
+ .coverage.*
43
+ .cache
44
+ nosetests.xml
45
+ coverage.xml
46
+ *.cover
47
+ *.py,cover
48
+ .hypothesis/
49
+ .pytest_cache/
50
+
51
+ # Translations
52
+ *.mo
53
+ *.pot
54
+
55
+ # Environments
56
+ .env
57
+ .venv
58
+ env/
59
+ venv/
60
+ ENV/
61
+ env.bak/
62
+ venv.bak/
63
+
64
+ # IDEs
65
+ .idea/
66
+ .vscode/
67
+ *.swp
68
+ *.swo
69
+ *~
70
+
71
+ # mypy
72
+ .mypy_cache/
73
+ .dmypy.json
74
+ dmypy.json
75
+
76
+ # ruff
77
+ .ruff_cache/
78
+
79
+ # OS
80
+ .DS_Store
81
+ Thumbs.db
82
+
83
+ # Secrets
84
+ .env.local
85
+ .env.*.local
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Polymarket
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.