steamctypes 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.
Files changed (33) hide show
  1. steamctypes-0.1.0/.gitignore +31 -0
  2. steamctypes-0.1.0/LICENSE +202 -0
  3. steamctypes-0.1.0/PKG-INFO +134 -0
  4. steamctypes-0.1.0/README.md +115 -0
  5. steamctypes-0.1.0/pyproject.toml +53 -0
  6. steamctypes-0.1.0/src/steamctypes/__init__.py +32 -0
  7. steamctypes-0.1.0/src/steamctypes/_dispatch.py +379 -0
  8. steamctypes-0.1.0/src/steamctypes/_generated/__init__.py +39 -0
  9. steamctypes-0.1.0/src/steamctypes/_generated/callbacks.py +206 -0
  10. steamctypes-0.1.0/src/steamctypes/_generated/constants.py +226 -0
  11. steamctypes-0.1.0/src/steamctypes/_generated/enums.py +3044 -0
  12. steamctypes-0.1.0/src/steamctypes/_generated/functions.py +4562 -0
  13. steamctypes-0.1.0/src/steamctypes/_generated/interfaces.py +7864 -0
  14. steamctypes-0.1.0/src/steamctypes/_generated/structs.py +2727 -0
  15. steamctypes-0.1.0/src/steamctypes/_generated/typedefs.py +75 -0
  16. steamctypes-0.1.0/src/steamctypes/_loader.py +92 -0
  17. steamctypes-0.1.0/src/steamctypes/_native.py +51 -0
  18. steamctypes-0.1.0/src/steamctypes/_raw.py +213 -0
  19. steamctypes-0.1.0/src/steamctypes/_steam.py +237 -0
  20. steamctypes-0.1.0/src/steamctypes/apps.py +98 -0
  21. steamctypes-0.1.0/src/steamctypes/cloud.py +107 -0
  22. steamctypes-0.1.0/src/steamctypes/constants.py +7 -0
  23. steamctypes-0.1.0/src/steamctypes/enums.py +7 -0
  24. steamctypes-0.1.0/src/steamctypes/errors.py +50 -0
  25. steamctypes-0.1.0/src/steamctypes/friends.py +162 -0
  26. steamctypes-0.1.0/src/steamctypes/interfaces.py +7 -0
  27. steamctypes-0.1.0/src/steamctypes/leaderboards.py +193 -0
  28. steamctypes-0.1.0/src/steamctypes/overlay.py +85 -0
  29. steamctypes-0.1.0/src/steamctypes/py.typed +0 -0
  30. steamctypes-0.1.0/src/steamctypes/stats.py +143 -0
  31. steamctypes-0.1.0/src/steamctypes/structs.py +7 -0
  32. steamctypes-0.1.0/src/steamctypes/types.py +101 -0
  33. steamctypes-0.1.0/src/steamctypes/utils.py +112 -0
@@ -0,0 +1,31 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+
6
+ # uv and virtual environments
7
+ .venv/
8
+
9
+ # Build
10
+ build/
11
+ dist/
12
+ site/
13
+
14
+ # Tool caches
15
+ .pytest_cache/
16
+ .ruff_cache/
17
+
18
+ # IDE
19
+ .idea/
20
+ .vscode/
21
+ *.swp
22
+
23
+ # Local maintainer files
24
+ vendor/
25
+ steam_api.json
26
+ steam_appid.txt
27
+
28
+ # Steamworks binaries
29
+ *.dll
30
+ *.so
31
+ *.dylib
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,134 @@
1
+ Metadata-Version: 2.5
2
+ Name: steamctypes
3
+ Version: 0.1.0
4
+ Summary: Auto-generated, pure-Python Steamworks bindings.
5
+ License-Expression: Apache-2.0
6
+ License-File: LICENSE
7
+ Classifier: Development Status :: 3 - Alpha
8
+ Classifier: Operating System :: MacOS
9
+ Classifier: Operating System :: Microsoft :: Windows
10
+ Classifier: Operating System :: POSIX :: Linux
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Programming Language :: Python :: 3.14
15
+ Classifier: Topic :: Games/Entertainment
16
+ Classifier: Typing :: Typed
17
+ Requires-Python: >=3.11
18
+ Description-Content-Type: text/markdown
19
+
20
+ # steamctypes
21
+
22
+ [![CI](https://github.com/whoiskamchatka/steamctypes/actions/workflows/ci.yml/badge.svg)](https://github.com/whoiskamchatka/steamctypes/actions/workflows/ci.yml)
23
+ [![Docs](https://github.com/whoiskamchatka/steamctypes/actions/workflows/docs.yml/badge.svg)](https://whoiskamchatka.github.io/steamctypes/)
24
+
25
+ Pure-Python bindings for the Steamworks API, built on `ctypes`: no compiled extension and no
26
+ runtime dependencies. Install the package, ship the `steam_api` library with your app, and call
27
+ Steam from Python.
28
+
29
+ **[Documentation](https://whoiskamchatka.github.io/steamctypes/)**
30
+
31
+
32
+ ## How It Works
33
+
34
+ - **Generated from the SDK.** A generator turns the SDK's description of its API,
35
+ `steam_api.json`, into Python: structs, enums, constants, `ctypes` prototypes and interface
36
+ classes. The generated code is committed, so neither you nor CI need the SDK, and it is checked
37
+ against the SDK headers for every supported platform: struct layouts, function signatures and
38
+ exported symbols.
39
+ - **Steam's own library.** At runtime steamctypes loads the `steam_api` library your app ships and
40
+ calls it through `ctypes`. It never replaces or works around it.
41
+ - **Two layers.** A Pythonic API covers users and friends, achievements and stats, leaderboards,
42
+ Steam Cloud, the overlay, apps and DLC, and client utilities. `steam.raw` exposes every
43
+ Steamworks interface available to an app, with the SDK's names and Python values.
44
+ - **No background threads.** Callbacks and call results are delivered when you call
45
+ `run_callbacks()` or wait for a result, on that thread.
46
+
47
+ See [Architecture](https://whoiskamchatka.github.io/steamctypes/architecture/) for details.
48
+
49
+ ## Requirements
50
+
51
+ - 64-bit CPython 3.11 or newer
52
+ - Windows x64, Linux x64 or ARM64, or macOS
53
+ - The `steam_api` library from Steamworks SDK 1.65 (`steamctypes.SDK_VERSION`)
54
+ - A running Steam client
55
+
56
+ ## Installation
57
+
58
+ ```
59
+ pip install steamctypes
60
+ ```
61
+
62
+ steamctypes needs two files besides your code, and each must be in the right folder:
63
+
64
+ ```
65
+ my_app/
66
+ ├── main.py # the script you run: python main.py
67
+ ├── steam_api64.dll # the steam_api library, next to the script
68
+ └── steam_appid.txt # your app id, for development only
69
+ ```
70
+
71
+ - **The `steam_api` library** from the SDK's `redistributable_bin` folder: `steam_api64.dll` on
72
+ Windows, `libsteam_api.so` on Linux (x64 or ARM64), `libsteam_api.dylib` on macOS. steamctypes
73
+ looks for it next to the main script or the frozen executable, never in the current directory;
74
+ pass `lib_path` to `Steam()` or set `STEAMCTYPES_LIB` to use another place.
75
+ - **`steam_appid.txt`**, holding only your app id, while the app is not launched from Steam.
76
+ Steam reads it from the working directory, so run the app from its own folder. Use 480,
77
+ Spacewar, to try things out, and do not ship the file.
78
+
79
+ Steam itself must be running and logged in.
80
+ [Getting Started](https://whoiskamchatka.github.io/steamctypes/getting-started/) covers the
81
+ details.
82
+
83
+ ## Usage
84
+
85
+ ```python
86
+ from steamctypes import Steam
87
+ from steamctypes.structs import GameOverlayActivated_t
88
+
89
+ with Steam() as steam:
90
+ steam.stats.unlock("ACH_WIN_ONE_GAME") # answered by the local client at once
91
+ steam.stats.store()
92
+
93
+ board = steam.leaderboards.find("Feet Traveled").wait(timeout=10) # a server request
94
+
95
+ @steam.on(GameOverlayActivated_t)
96
+ def overlay_toggled(event: GameOverlayActivated_t) -> None:
97
+ app.paused = bool(event.m_bActive)
98
+
99
+ while app.running:
100
+ steam.run_callbacks() # delivers callbacks and call results
101
+ app.update()
102
+ ```
103
+
104
+ Each area of the API is an attribute of the session, and requests to Steam's servers return a
105
+ `CallResult`. Anything not wrapped yet is in `steam.raw` under its Steamworks names, such as
106
+ `steam.raw.ISteamUserStats.GetStatInt32("NumGames")`.
107
+
108
+ ## Development
109
+
110
+ ```
111
+ uv sync # set up the environment
112
+ uv run pytest # tests, without Steam or the SDK
113
+ uv run python -m tools.generator # maintainers: regenerate the bindings from the SDK
114
+ ```
115
+
116
+ The generated files in `src/steamctypes/_generated` are never edited by hand.
117
+ [CONTRIBUTING.md](CONTRIBUTING.md) covers the SDK setup, the other checks and moving to a new SDK
118
+ version.
119
+
120
+ ## Steamworks SDK
121
+
122
+ The Steamworks SDK is proprietary and is not included: this repository and its packages contain
123
+ no SDK headers, metadata or native libraries. Download the SDK from the
124
+ [Steamworks partner site](https://partner.steamgames.com/downloads/list) and use it under Valve's
125
+ terms; your app ships the SDK's redistributable library itself.
126
+
127
+ ## License
128
+
129
+ steamctypes is released under the [Apache License 2.0](LICENSE). The Steamworks SDK is licensed
130
+ separately by Valve.
131
+
132
+ steamctypes is an independent project, not affiliated with, endorsed by or sponsored by Valve
133
+ Corporation. Steam and Steamworks are trademarks and/or registered trademarks of Valve Corporation
134
+ in the U.S. and/or other countries.
@@ -0,0 +1,115 @@
1
+ # steamctypes
2
+
3
+ [![CI](https://github.com/whoiskamchatka/steamctypes/actions/workflows/ci.yml/badge.svg)](https://github.com/whoiskamchatka/steamctypes/actions/workflows/ci.yml)
4
+ [![Docs](https://github.com/whoiskamchatka/steamctypes/actions/workflows/docs.yml/badge.svg)](https://whoiskamchatka.github.io/steamctypes/)
5
+
6
+ Pure-Python bindings for the Steamworks API, built on `ctypes`: no compiled extension and no
7
+ runtime dependencies. Install the package, ship the `steam_api` library with your app, and call
8
+ Steam from Python.
9
+
10
+ **[Documentation](https://whoiskamchatka.github.io/steamctypes/)**
11
+
12
+
13
+ ## How It Works
14
+
15
+ - **Generated from the SDK.** A generator turns the SDK's description of its API,
16
+ `steam_api.json`, into Python: structs, enums, constants, `ctypes` prototypes and interface
17
+ classes. The generated code is committed, so neither you nor CI need the SDK, and it is checked
18
+ against the SDK headers for every supported platform: struct layouts, function signatures and
19
+ exported symbols.
20
+ - **Steam's own library.** At runtime steamctypes loads the `steam_api` library your app ships and
21
+ calls it through `ctypes`. It never replaces or works around it.
22
+ - **Two layers.** A Pythonic API covers users and friends, achievements and stats, leaderboards,
23
+ Steam Cloud, the overlay, apps and DLC, and client utilities. `steam.raw` exposes every
24
+ Steamworks interface available to an app, with the SDK's names and Python values.
25
+ - **No background threads.** Callbacks and call results are delivered when you call
26
+ `run_callbacks()` or wait for a result, on that thread.
27
+
28
+ See [Architecture](https://whoiskamchatka.github.io/steamctypes/architecture/) for details.
29
+
30
+ ## Requirements
31
+
32
+ - 64-bit CPython 3.11 or newer
33
+ - Windows x64, Linux x64 or ARM64, or macOS
34
+ - The `steam_api` library from Steamworks SDK 1.65 (`steamctypes.SDK_VERSION`)
35
+ - A running Steam client
36
+
37
+ ## Installation
38
+
39
+ ```
40
+ pip install steamctypes
41
+ ```
42
+
43
+ steamctypes needs two files besides your code, and each must be in the right folder:
44
+
45
+ ```
46
+ my_app/
47
+ ├── main.py # the script you run: python main.py
48
+ ├── steam_api64.dll # the steam_api library, next to the script
49
+ └── steam_appid.txt # your app id, for development only
50
+ ```
51
+
52
+ - **The `steam_api` library** from the SDK's `redistributable_bin` folder: `steam_api64.dll` on
53
+ Windows, `libsteam_api.so` on Linux (x64 or ARM64), `libsteam_api.dylib` on macOS. steamctypes
54
+ looks for it next to the main script or the frozen executable, never in the current directory;
55
+ pass `lib_path` to `Steam()` or set `STEAMCTYPES_LIB` to use another place.
56
+ - **`steam_appid.txt`**, holding only your app id, while the app is not launched from Steam.
57
+ Steam reads it from the working directory, so run the app from its own folder. Use 480,
58
+ Spacewar, to try things out, and do not ship the file.
59
+
60
+ Steam itself must be running and logged in.
61
+ [Getting Started](https://whoiskamchatka.github.io/steamctypes/getting-started/) covers the
62
+ details.
63
+
64
+ ## Usage
65
+
66
+ ```python
67
+ from steamctypes import Steam
68
+ from steamctypes.structs import GameOverlayActivated_t
69
+
70
+ with Steam() as steam:
71
+ steam.stats.unlock("ACH_WIN_ONE_GAME") # answered by the local client at once
72
+ steam.stats.store()
73
+
74
+ board = steam.leaderboards.find("Feet Traveled").wait(timeout=10) # a server request
75
+
76
+ @steam.on(GameOverlayActivated_t)
77
+ def overlay_toggled(event: GameOverlayActivated_t) -> None:
78
+ app.paused = bool(event.m_bActive)
79
+
80
+ while app.running:
81
+ steam.run_callbacks() # delivers callbacks and call results
82
+ app.update()
83
+ ```
84
+
85
+ Each area of the API is an attribute of the session, and requests to Steam's servers return a
86
+ `CallResult`. Anything not wrapped yet is in `steam.raw` under its Steamworks names, such as
87
+ `steam.raw.ISteamUserStats.GetStatInt32("NumGames")`.
88
+
89
+ ## Development
90
+
91
+ ```
92
+ uv sync # set up the environment
93
+ uv run pytest # tests, without Steam or the SDK
94
+ uv run python -m tools.generator # maintainers: regenerate the bindings from the SDK
95
+ ```
96
+
97
+ The generated files in `src/steamctypes/_generated` are never edited by hand.
98
+ [CONTRIBUTING.md](CONTRIBUTING.md) covers the SDK setup, the other checks and moving to a new SDK
99
+ version.
100
+
101
+ ## Steamworks SDK
102
+
103
+ The Steamworks SDK is proprietary and is not included: this repository and its packages contain
104
+ no SDK headers, metadata or native libraries. Download the SDK from the
105
+ [Steamworks partner site](https://partner.steamgames.com/downloads/list) and use it under Valve's
106
+ terms; your app ships the SDK's redistributable library itself.
107
+
108
+ ## License
109
+
110
+ steamctypes is released under the [Apache License 2.0](LICENSE). The Steamworks SDK is licensed
111
+ separately by Valve.
112
+
113
+ steamctypes is an independent project, not affiliated with, endorsed by or sponsored by Valve
114
+ Corporation. Steam and Steamworks are trademarks and/or registered trademarks of Valve Corporation
115
+ in the U.S. and/or other countries.
@@ -0,0 +1,53 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.27"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "steamctypes"
7
+ description = "Auto-generated, pure-Python Steamworks bindings."
8
+ readme = "README.md"
9
+ dynamic = ["version"]
10
+ requires-python = ">=3.11"
11
+ license = "Apache-2.0"
12
+ license-files = ["LICENSE"]
13
+ dependencies = []
14
+ classifiers = [
15
+ "Development Status :: 3 - Alpha",
16
+ "Operating System :: Microsoft :: Windows",
17
+ "Operating System :: POSIX :: Linux",
18
+ "Operating System :: MacOS",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Programming Language :: Python :: 3.13",
22
+ "Programming Language :: Python :: 3.14",
23
+ "Topic :: Games/Entertainment",
24
+ "Typing :: Typed",
25
+ ]
26
+
27
+ [dependency-groups]
28
+ dev = ["ruff", "pyright", "pytest"]
29
+ docs = ["mkdocs-material", "mkdocstrings[python]"]
30
+
31
+ [tool.hatch.version]
32
+ path = "src/steamctypes/__init__.py"
33
+
34
+ # Only what builds the wheel: hatch reads .gitignore but not .git/info/exclude, so a default sdist
35
+ # picks up local files, and tools/ needs the SDK anyway.
36
+ [tool.hatch.build.targets.sdist]
37
+ include = ["/src"]
38
+
39
+ [tool.ruff]
40
+ target-version = "py311"
41
+ line-length = 100
42
+
43
+ [tool.ruff.lint]
44
+ select = ["E", "F", "W", "I", "UP", "B", "SIM", "RUF"]
45
+
46
+ [tool.pyright]
47
+ typeCheckingMode = "strict"
48
+ pythonVersion = "3.11"
49
+ include = ["src", "tests", "tools"]
50
+
51
+ [tool.pytest.ini_options]
52
+ testpaths = ["tests"]
53
+ pythonpath = ["."]
@@ -0,0 +1,32 @@
1
+ from steamctypes._dispatch import CallResult
2
+ from steamctypes._generated import SDK_VERSION
3
+ from steamctypes._steam import Steam, restart_app_if_necessary
4
+ from steamctypes.errors import (
5
+ CallResultError,
6
+ IncompatibleLibraryError,
7
+ LibraryNotFoundError,
8
+ NoSteamClientError,
9
+ SteamError,
10
+ SteamInitError,
11
+ SteamWarning,
12
+ VersionMismatchError,
13
+ )
14
+ from steamctypes.types import SteamID
15
+
16
+ __version__ = "0.1.0"
17
+
18
+ __all__ = [
19
+ "SDK_VERSION",
20
+ "CallResult",
21
+ "CallResultError",
22
+ "IncompatibleLibraryError",
23
+ "LibraryNotFoundError",
24
+ "NoSteamClientError",
25
+ "Steam",
26
+ "SteamError",
27
+ "SteamID",
28
+ "SteamInitError",
29
+ "SteamWarning",
30
+ "VersionMismatchError",
31
+ "restart_app_if_necessary",
32
+ ]