@formaggio-software/rhtop-windows-amd64 0.0.0-stage → 0.0.6
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.
- package/package.json +16 -4
- package/payload/LICENSE.txt +95 -0
- package/payload/NOTICE +14 -0
- package/payload/THIRD_PARTY_NOTICES/altgraph-0.17.5.dist-info/LICENSE +18 -0
- package/payload/THIRD_PARTY_NOTICES/altgraph-0.17.5.dist-info/METADATA +307 -0
- package/payload/THIRD_PARTY_NOTICES/annotated_types-0.8.0.dist-info/METADATA +295 -0
- package/payload/THIRD_PARTY_NOTICES/annotated_types-0.8.0.dist-info/licenses/LICENSE +21 -0
- package/payload/THIRD_PARTY_NOTICES/anyio-4.16.0.dist-info/METADATA +108 -0
- package/payload/THIRD_PARTY_NOTICES/anyio-4.16.0.dist-info/licenses/LICENSE +20 -0
- package/payload/THIRD_PARTY_NOTICES/attrs-26.1.0.dist-info/METADATA +199 -0
- package/payload/THIRD_PARTY_NOTICES/attrs-26.1.0.dist-info/licenses/LICENSE +21 -0
- package/payload/THIRD_PARTY_NOTICES/backports.tarfile-1.2.0.dist-info/LICENSE +17 -0
- package/payload/THIRD_PARTY_NOTICES/backports.tarfile-1.2.0.dist-info/METADATA +46 -0
- package/payload/THIRD_PARTY_NOTICES/build-1.6.1.dist-info/METADATA +142 -0
- package/payload/THIRD_PARTY_NOTICES/build-1.6.1.dist-info/licenses/LICENSE +20 -0
- package/payload/THIRD_PARTY_NOTICES/cffi-2.1.1.dist-info/METADATA +67 -0
- package/payload/THIRD_PARTY_NOTICES/cffi-2.1.1.dist-info/licenses/LICENSE +23 -0
- package/payload/THIRD_PARTY_NOTICES/click-8.5.1.dist-info/METADATA +83 -0
- package/payload/THIRD_PARTY_NOTICES/click-8.5.1.dist-info/licenses/LICENSE.txt +28 -0
- package/payload/THIRD_PARTY_NOTICES/colorama-0.4.6.dist-info/METADATA +441 -0
- package/payload/THIRD_PARTY_NOTICES/colorama-0.4.6.dist-info/licenses/LICENSE.txt +27 -0
- package/payload/THIRD_PARTY_NOTICES/cryptography-50.0.2.dist-info/METADATA +111 -0
- package/payload/THIRD_PARTY_NOTICES/cryptography-50.0.2.dist-info/licenses/LICENSE +3 -0
- package/payload/THIRD_PARTY_NOTICES/cryptography-50.0.2.dist-info/licenses/LICENSE.APACHE +202 -0
- package/payload/THIRD_PARTY_NOTICES/cryptography-50.0.2.dist-info/licenses/LICENSE.BSD +27 -0
- package/payload/THIRD_PARTY_NOTICES/h11-0.16.0.dist-info/METADATA +202 -0
- package/payload/THIRD_PARTY_NOTICES/h11-0.16.0.dist-info/licenses/LICENSE.txt +22 -0
- package/payload/THIRD_PARTY_NOTICES/hatchling-1.33.0.dist-info/METADATA +81 -0
- package/payload/THIRD_PARTY_NOTICES/hatchling-1.33.0.dist-info/licenses/LICENSE.txt +9 -0
- package/payload/THIRD_PARTY_NOTICES/httpcore2-2.16.2.dist-info/METADATA +798 -0
- package/payload/THIRD_PARTY_NOTICES/httpcore2-2.16.2.dist-info/licenses/LICENSE.md +28 -0
- package/payload/THIRD_PARTY_NOTICES/httpx2-2.16.2.dist-info/METADATA +227 -0
- package/payload/THIRD_PARTY_NOTICES/httpx2-2.16.2.dist-info/licenses/LICENSE.md +13 -0
- package/payload/THIRD_PARTY_NOTICES/idna-3.20.dist-info/METADATA +176 -0
- package/payload/THIRD_PARTY_NOTICES/idna-3.20.dist-info/licenses/LICENSE.md +31 -0
- package/payload/THIRD_PARTY_NOTICES/importlib_metadata-10.2.0.dist-info/METADATA +131 -0
- package/payload/THIRD_PARTY_NOTICES/importlib_metadata-10.2.0.dist-info/licenses/LICENSE +73 -0
- package/payload/THIRD_PARTY_NOTICES/iniconfig-2.3.1.dist-info/METADATA +84 -0
- package/payload/THIRD_PARTY_NOTICES/iniconfig-2.3.1.dist-info/licenses/LICENSE +21 -0
- package/payload/THIRD_PARTY_NOTICES/jaraco.classes-3.4.0.dist-info/LICENSE +17 -0
- package/payload/THIRD_PARTY_NOTICES/jaraco.classes-3.4.0.dist-info/METADATA +60 -0
- package/payload/THIRD_PARTY_NOTICES/jaraco_context-6.1.2.dist-info/METADATA +81 -0
- package/payload/THIRD_PARTY_NOTICES/jaraco_context-6.1.2.dist-info/licenses/LICENSE +18 -0
- package/payload/THIRD_PARTY_NOTICES/jaraco_functools-4.6.0.dist-info/METADATA +68 -0
- package/payload/THIRD_PARTY_NOTICES/jaraco_functools-4.6.0.dist-info/licenses/LICENSE +18 -0
- package/payload/THIRD_PARTY_NOTICES/jsonschema-4.26.0.dist-info/METADATA +170 -0
- package/payload/THIRD_PARTY_NOTICES/jsonschema-4.26.0.dist-info/licenses/COPYING +19 -0
- package/payload/THIRD_PARTY_NOTICES/jsonschema_specifications-2025.9.1.dist-info/METADATA +54 -0
- package/payload/THIRD_PARTY_NOTICES/jsonschema_specifications-2025.9.1.dist-info/licenses/COPYING +19 -0
- package/payload/THIRD_PARTY_NOTICES/keyring-25.7.0.dist-info/METADATA +554 -0
- package/payload/THIRD_PARTY_NOTICES/keyring-25.7.0.dist-info/licenses/LICENSE +18 -0
- package/payload/THIRD_PARTY_NOTICES/lazy_importer-0.1.0.dist-info/METADATA +174 -0
- package/payload/THIRD_PARTY_NOTICES/lazy_importer-0.1.0.dist-info/licenses/LICENSE +202 -0
- package/payload/THIRD_PARTY_NOTICES/linkify_it_py-2.2.0.dist-info/METADATA +262 -0
- package/payload/THIRD_PARTY_NOTICES/linkify_it_py-2.2.0.dist-info/licenses/LICENSE +48 -0
- package/payload/THIRD_PARTY_NOTICES/markdown_it_py-4.3.0.dist-info/METADATA +237 -0
- package/payload/THIRD_PARTY_NOTICES/markdown_it_py-4.3.0.dist-info/licenses/LICENSE +21 -0
- package/payload/THIRD_PARTY_NOTICES/markdown_it_py-4.3.0.dist-info/licenses/LICENSE.markdown-it +22 -0
- package/payload/THIRD_PARTY_NOTICES/mcp-2.3.0.dist-info/METADATA +172 -0
- package/payload/THIRD_PARTY_NOTICES/mcp-2.3.0.dist-info/licenses/LICENSE +21 -0
- package/payload/THIRD_PARTY_NOTICES/mcp_types-2.3.0.dist-info/METADATA +43 -0
- package/payload/THIRD_PARTY_NOTICES/mcp_types-2.3.0.dist-info/licenses/LICENSE +21 -0
- package/payload/THIRD_PARTY_NOTICES/mdit_py_plugins-0.7.0.dist-info/METADATA +60 -0
- package/payload/THIRD_PARTY_NOTICES/mdit_py_plugins-0.7.0.dist-info/licenses/LICENSE +21 -0
- package/payload/THIRD_PARTY_NOTICES/mdurl-0.1.2.dist-info/LICENSE +46 -0
- package/payload/THIRD_PARTY_NOTICES/mdurl-0.1.2.dist-info/METADATA +32 -0
- package/payload/THIRD_PARTY_NOTICES/more_itertools-11.2.1.dist-info/METADATA +302 -0
- package/payload/THIRD_PARTY_NOTICES/more_itertools-11.2.1.dist-info/licenses/LICENSE +19 -0
- package/payload/THIRD_PARTY_NOTICES/opentelemetry_api-1.45.2.dist-info/METADATA +43 -0
- package/payload/THIRD_PARTY_NOTICES/opentelemetry_api-1.45.2.dist-info/licenses/LICENSE +201 -0
- package/payload/THIRD_PARTY_NOTICES/packaging-26.3.dist-info/METADATA +112 -0
- package/payload/THIRD_PARTY_NOTICES/packaging-26.3.dist-info/licenses/LICENSE +3 -0
- package/payload/THIRD_PARTY_NOTICES/packaging-26.3.dist-info/licenses/LICENSE.APACHE +177 -0
- package/payload/THIRD_PARTY_NOTICES/packaging-26.3.dist-info/licenses/LICENSE.BSD +23 -0
- package/payload/THIRD_PARTY_NOTICES/pathspec-1.1.1.dist-info/METADATA +392 -0
- package/payload/THIRD_PARTY_NOTICES/pathspec-1.1.1.dist-info/licenses/LICENSE +373 -0
- package/payload/THIRD_PARTY_NOTICES/pefile-2024.8.26.dist-info/LICENSE +21 -0
- package/payload/THIRD_PARTY_NOTICES/pefile-2024.8.26.dist-info/METADATA +34 -0
- package/payload/THIRD_PARTY_NOTICES/pip-23.2.1.dist-info/LICENSE.txt +20 -0
- package/payload/THIRD_PARTY_NOTICES/pip-23.2.1.dist-info/METADATA +90 -0
- package/payload/THIRD_PARTY_NOTICES/platformdirs-4.14.7.dist-info/METADATA +114 -0
- package/payload/THIRD_PARTY_NOTICES/platformdirs-4.14.7.dist-info/licenses/LICENSE +21 -0
- package/payload/THIRD_PARTY_NOTICES/pluggy-1.7.0.dist-info/METADATA +152 -0
- package/payload/THIRD_PARTY_NOTICES/pluggy-1.7.0.dist-info/licenses/LICENSE +21 -0
- package/payload/THIRD_PARTY_NOTICES/pycparser-3.12.dist-info/METADATA +286 -0
- package/payload/THIRD_PARTY_NOTICES/pycparser-3.12.dist-info/licenses/LICENSE +27 -0
- package/payload/THIRD_PARTY_NOTICES/pydantic-2.14.3.dist-info/METADATA +1646 -0
- package/payload/THIRD_PARTY_NOTICES/pydantic-2.14.3.dist-info/licenses/LICENSE +21 -0
- package/payload/THIRD_PARTY_NOTICES/pydantic_core-2.50.4.dist-info/METADATA +172 -0
- package/payload/THIRD_PARTY_NOTICES/pydantic_core-2.50.4.dist-info/licenses/LICENSE +21 -0
- package/payload/THIRD_PARTY_NOTICES/pygments-2.21.0.dist-info/METADATA +58 -0
- package/payload/THIRD_PARTY_NOTICES/pygments-2.21.0.dist-info/licenses/AUTHORS +296 -0
- package/payload/THIRD_PARTY_NOTICES/pygments-2.21.0.dist-info/licenses/LICENSE +25 -0
- package/payload/THIRD_PARTY_NOTICES/pyinstaller-6.22.3.dist-info/METADATA +213 -0
- package/payload/THIRD_PARTY_NOTICES/pyinstaller-6.22.3.dist-info/licenses/COPYING.txt +648 -0
- package/payload/THIRD_PARTY_NOTICES/pyinstaller_hooks_contrib-2026.10.dist-info/METADATA +373 -0
- package/payload/THIRD_PARTY_NOTICES/pyinstaller_hooks_contrib-2026.10.dist-info/licenses/LICENSE +521 -0
- package/payload/THIRD_PARTY_NOTICES/pyjwt-2.15.1.dist-info/METADATA +94 -0
- package/payload/THIRD_PARTY_NOTICES/pyjwt-2.15.1.dist-info/licenses/AUTHORS.rst +7 -0
- package/payload/THIRD_PARTY_NOTICES/pyjwt-2.15.1.dist-info/licenses/LICENSE +21 -0
- package/payload/THIRD_PARTY_NOTICES/pyproject_hooks-1.3.3.dist-info/METADATA +27 -0
- package/payload/THIRD_PARTY_NOTICES/pyproject_hooks-1.3.3.dist-info/licenses/LICENSE +21 -0
- package/payload/THIRD_PARTY_NOTICES/pytest-9.2.0.dist-info/METADATA +217 -0
- package/payload/THIRD_PARTY_NOTICES/pytest-9.2.0.dist-info/licenses/LICENSE +21 -0
- package/payload/THIRD_PARTY_NOTICES/pytest_asyncio-1.5.0.dist-info/METADATA +100 -0
- package/payload/THIRD_PARTY_NOTICES/pytest_asyncio-1.5.0.dist-info/licenses/LICENSE +201 -0
- package/payload/THIRD_PARTY_NOTICES/python_multipart-0.0.34.dist-info/METADATA +179 -0
- package/payload/THIRD_PARTY_NOTICES/python_multipart-0.0.34.dist-info/licenses/LICENSE.txt +202 -0
- package/payload/THIRD_PARTY_NOTICES/pywin32-312.dist-info/METADATA +261 -0
- package/payload/THIRD_PARTY_NOTICES/pywin32-312.dist-info/licenses/adodbapi/license.txt +505 -0
- package/payload/THIRD_PARTY_NOTICES/pywin32-312.dist-info/licenses/com/License.txt +30 -0
- package/payload/THIRD_PARTY_NOTICES/pywin32-312.dist-info/licenses/com/win32comext/mapi/src/MAPIStubLibrary/LICENSE +21 -0
- package/payload/THIRD_PARTY_NOTICES/pywin32-312.dist-info/licenses/isapi/README.txt +7 -0
- package/payload/THIRD_PARTY_NOTICES/pywin32-312.dist-info/licenses/pythonwin/License.txt +30 -0
- package/payload/THIRD_PARTY_NOTICES/pywin32-312.dist-info/licenses/pythonwin/Scintilla/License.txt +20 -0
- package/payload/THIRD_PARTY_NOTICES/pywin32-312.dist-info/licenses/pythonwin/pywin/idle/LICENSE.txt +246 -0
- package/payload/THIRD_PARTY_NOTICES/pywin32-312.dist-info/licenses/win32/License.txt +30 -0
- package/payload/THIRD_PARTY_NOTICES/pywin32_ctypes-0.2.3.dist-info/LICENSE.txt +28 -0
- package/payload/THIRD_PARTY_NOTICES/pywin32_ctypes-0.2.3.dist-info/METADATA +134 -0
- package/payload/THIRD_PARTY_NOTICES/pywinpty-3.1.2.dist-info/METADATA +162 -0
- package/payload/THIRD_PARTY_NOTICES/pywinpty-3.1.2.dist-info/licenses/LICENSE.txt +21 -0
- package/payload/THIRD_PARTY_NOTICES/pyyaml-6.0.3.dist-info/METADATA +59 -0
- package/payload/THIRD_PARTY_NOTICES/pyyaml-6.0.3.dist-info/licenses/LICENSE +20 -0
- package/payload/THIRD_PARTY_NOTICES/referencing-0.37.0.dist-info/METADATA +64 -0
- package/payload/THIRD_PARTY_NOTICES/referencing-0.37.0.dist-info/licenses/COPYING +19 -0
- package/payload/THIRD_PARTY_NOTICES/rich-15.0.0.dist-info/METADATA +479 -0
- package/payload/THIRD_PARTY_NOTICES/rich-15.0.0.dist-info/licenses/LICENSE +19 -0
- package/payload/THIRD_PARTY_NOTICES/rpds_py-2026.9.1.dist-info/METADATA +99 -0
- package/payload/THIRD_PARTY_NOTICES/rpds_py-2026.9.1.dist-info/licenses/LICENSE +19 -0
- package/payload/THIRD_PARTY_NOTICES/ruff-0.17.5.dist-info/METADATA +484 -0
- package/payload/THIRD_PARTY_NOTICES/ruff-0.17.5.dist-info/licenses/LICENSE +430 -0
- package/payload/THIRD_PARTY_NOTICES/setuptools-65.5.0.dist-info/LICENSE +19 -0
- package/payload/THIRD_PARTY_NOTICES/setuptools-65.5.0.dist-info/METADATA +144 -0
- package/payload/THIRD_PARTY_NOTICES/sse_starlette-3.7.0.dist-info/METADATA +493 -0
- package/payload/THIRD_PARTY_NOTICES/sse_starlette-3.7.0.dist-info/licenses/AUTHORS +10 -0
- package/payload/THIRD_PARTY_NOTICES/sse_starlette-3.7.0.dist-info/licenses/LICENSE +27 -0
- package/payload/THIRD_PARTY_NOTICES/starlette-1.10.0.dist-info/METADATA +181 -0
- package/payload/THIRD_PARTY_NOTICES/starlette-1.10.0.dist-info/licenses/LICENSE.md +27 -0
- package/payload/THIRD_PARTY_NOTICES/textual-6.12.0.dist-info/LICENSE +21 -0
- package/payload/THIRD_PARTY_NOTICES/textual-6.12.0.dist-info/METADATA +265 -0
- package/payload/THIRD_PARTY_NOTICES/tomlkit-0.15.2.dist-info/METADATA +93 -0
- package/payload/THIRD_PARTY_NOTICES/tomlkit-0.15.2.dist-info/licenses/LICENSE +20 -0
- package/payload/THIRD_PARTY_NOTICES/trove_classifiers-2026.9.21.13.dist-info/METADATA +82 -0
- package/payload/THIRD_PARTY_NOTICES/trove_classifiers-2026.9.21.13.dist-info/licenses/LICENSE +201 -0
- package/payload/THIRD_PARTY_NOTICES/truststore-0.10.5.dist-info/METADATA +110 -0
- package/payload/THIRD_PARTY_NOTICES/truststore-0.10.5.dist-info/licenses/LICENSE +21 -0
- package/payload/THIRD_PARTY_NOTICES/typing_extensions-4.16.0.dist-info/METADATA +73 -0
- package/payload/THIRD_PARTY_NOTICES/typing_extensions-4.16.0.dist-info/licenses/LICENSE +279 -0
- package/payload/THIRD_PARTY_NOTICES/typing_inspection-0.4.5.dist-info/METADATA +49 -0
- package/payload/THIRD_PARTY_NOTICES/typing_inspection-0.4.5.dist-info/licenses/LICENSE +21 -0
- package/payload/THIRD_PARTY_NOTICES/uvicorn-0.54.0.dist-info/METADATA +189 -0
- package/payload/THIRD_PARTY_NOTICES/uvicorn-0.54.0.dist-info/licenses/LICENSE.md +27 -0
- package/payload/THIRD_PARTY_NOTICES/zipp-4.1.2.dist-info/METADATA +108 -0
- package/payload/THIRD_PARTY_NOTICES/zipp-4.1.2.dist-info/licenses/LICENSE +18 -0
- package/payload/rhtop.exe +0 -0
- package/README.md +0 -3
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: python-multipart
|
|
3
|
+
Version: 0.0.34
|
|
4
|
+
Summary: A streaming multipart parser for Python
|
|
5
|
+
Project-URL: Homepage, https://github.com/Kludex/python-multipart
|
|
6
|
+
Project-URL: Documentation, https://kludex.github.io/python-multipart/
|
|
7
|
+
Project-URL: Changelog, https://github.com/Kludex/python-multipart/blob/master/CHANGELOG.md
|
|
8
|
+
Project-URL: Source, https://github.com/Kludex/python-multipart
|
|
9
|
+
Author-email: Andrew Dunham <andrew@du.nham.ca>
|
|
10
|
+
Maintainer-email: Marcelo Trylesinski <marcelotryle@gmail.com>
|
|
11
|
+
License-Expression: Apache-2.0
|
|
12
|
+
License-File: LICENSE.txt
|
|
13
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
14
|
+
Classifier: Environment :: Web Environment
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
25
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
26
|
+
Requires-Python: >=3.11
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
|
|
29
|
+
# Python-Multipart
|
|
30
|
+
|
|
31
|
+
[](https://github.com/Kludex/python-multipart/actions/workflows/main.yml)
|
|
32
|
+
[](https://pypi.org/project/python-multipart)
|
|
33
|
+
[](https://pypi.org/project/python-multipart)
|
|
34
|
+
[](https://discord.gg/RxKUF5JuHs)
|
|
35
|
+
|
|
36
|
+
Python-Multipart reads the data that a web browser sends when someone submits a form or uploads a file.
|
|
37
|
+
|
|
38
|
+
```console
|
|
39
|
+
pip install python-multipart
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
It powers file uploads in [Starlette](https://starlette.dev) and [FastAPI](https://fastapi.tiangolo.com).
|
|
43
|
+
|
|
44
|
+
## What problem does it solve?
|
|
45
|
+
|
|
46
|
+
### A form sends data
|
|
47
|
+
|
|
48
|
+
When you fill in a form on a website and click "Submit", your browser sends the data to a server.
|
|
49
|
+
The server is a program, maybe written in Python, that has to read that data and make sense of it.
|
|
50
|
+
|
|
51
|
+
### Files need a special format
|
|
52
|
+
|
|
53
|
+
A form with only text, like a username, is sent as one short line: `username=alice`.
|
|
54
|
+
|
|
55
|
+
A form with a file is different. A file can contain anything, even text that looks like `username=alice`.
|
|
56
|
+
So the browser uses a format called `multipart/form-data`. It splits the request into **parts**, one per form field, separated by a **boundary**: a marker string the browser picks.
|
|
57
|
+
|
|
58
|
+
This is what the server receives when you send a username and a file called `cat.txt`:
|
|
59
|
+
|
|
60
|
+
```text
|
|
61
|
+
--boundary
|
|
62
|
+
Content-Disposition: form-data; name="username"
|
|
63
|
+
|
|
64
|
+
alice
|
|
65
|
+
--boundary
|
|
66
|
+
Content-Disposition: form-data; name="avatar"; filename="cat.txt"
|
|
67
|
+
Content-Type: text/plain
|
|
68
|
+
|
|
69
|
+
meow
|
|
70
|
+
--boundary--
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Each part has some headers (the field name, the file name) and then the content.
|
|
74
|
+
Every line ends with `\r\n` (a carriage return and a newline), which is why the examples below write `\r\n` explicitly.
|
|
75
|
+
A **parser** is the code that turns this text back into fields and files. Python-Multipart is that parser.
|
|
76
|
+
|
|
77
|
+
### Big files do not fit in memory
|
|
78
|
+
|
|
79
|
+
An upload can be a 5 GB video. If the server reads the whole request before it starts working, it needs 5 GB of memory, per upload.
|
|
80
|
+
|
|
81
|
+
Python-Multipart is a **streaming** parser. You give it the request a small piece (a **chunk**) at a time, and it tells you what it found as soon as it finds it. The full request never has to be in memory.
|
|
82
|
+
|
|
83
|
+
## Usage
|
|
84
|
+
|
|
85
|
+
### Parse a whole form
|
|
86
|
+
|
|
87
|
+
```python
|
|
88
|
+
from io import BytesIO
|
|
89
|
+
|
|
90
|
+
from python_multipart import parse_form
|
|
91
|
+
|
|
92
|
+
body = (
|
|
93
|
+
b"--boundary\r\n"
|
|
94
|
+
b'Content-Disposition: form-data; name="username"\r\n'
|
|
95
|
+
b"\r\n"
|
|
96
|
+
b"alice\r\n"
|
|
97
|
+
b"--boundary\r\n"
|
|
98
|
+
b'Content-Disposition: form-data; name="avatar"; filename="cat.txt"\r\n'
|
|
99
|
+
b"Content-Type: text/plain\r\n"
|
|
100
|
+
b"\r\n"
|
|
101
|
+
b"meow\r\n"
|
|
102
|
+
b"--boundary--\r\n"
|
|
103
|
+
)
|
|
104
|
+
headers = {"Content-Type": "multipart/form-data; boundary=boundary"}
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def on_field(field):
|
|
108
|
+
print("Field:", field.field_name, "=", field.value)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def on_file(file):
|
|
112
|
+
file.file_object.seek(0)
|
|
113
|
+
print("File:", file.field_name, file.file_name, file.file_object.read())
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
parse_form(headers, BytesIO(body), on_field, on_file)
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Output:
|
|
120
|
+
|
|
121
|
+
```text
|
|
122
|
+
Field: b'username' = b'alice'
|
|
123
|
+
File: b'avatar' b'cat.txt' b'meow'
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
`parse_form` reads the body in chunks and calls your functions:
|
|
127
|
+
|
|
128
|
+
- `on_field` runs for every text field.
|
|
129
|
+
- `on_file` runs for every uploaded file.
|
|
130
|
+
|
|
131
|
+
Small files stay in memory. Once a file grows past 1 MiB, it is moved to a temporary file on disk, so a large upload does not fill up your memory.
|
|
132
|
+
|
|
133
|
+
> **Real servers do not use `BytesIO`.** In a real application, the body comes from the network. Any object with a `read()` method that returns `bytes` works.
|
|
134
|
+
|
|
135
|
+
### Handle each chunk yourself
|
|
136
|
+
|
|
137
|
+
`parse_form` still saves every file somewhere. When you want full control, for example to send an upload straight to cloud storage, use `MultipartParser`:
|
|
138
|
+
|
|
139
|
+
```python
|
|
140
|
+
from python_multipart import MultipartParser
|
|
141
|
+
|
|
142
|
+
chunks = [
|
|
143
|
+
b"--boundary\r\n",
|
|
144
|
+
b'Content-Disposition: form-data; name="avatar"; filename="cat.txt"\r\n\r\n',
|
|
145
|
+
b"me",
|
|
146
|
+
b"ow\r\n--boundary--\r\n",
|
|
147
|
+
]
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
def on_part_data(data, start, end):
|
|
151
|
+
print("Got a piece of the file:", data[start:end])
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
parser = MultipartParser("boundary", callbacks={"on_part_data": on_part_data})
|
|
155
|
+
for chunk in chunks:
|
|
156
|
+
parser.write(chunk)
|
|
157
|
+
parser.finalize()
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Output:
|
|
161
|
+
|
|
162
|
+
```text
|
|
163
|
+
Got a piece of the file: b'me'
|
|
164
|
+
Got a piece of the file: b'ow'
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
The file arrived in two chunks, and you saw each one as it arrived. Nothing was stored.
|
|
168
|
+
|
|
169
|
+
Instead of copying data, the parser passes you a buffer plus `start` and `end` positions that mark the part you care about.
|
|
170
|
+
|
|
171
|
+
## Learn more
|
|
172
|
+
|
|
173
|
+
- [Documentation](https://kludex.github.io/python-multipart/)
|
|
174
|
+
- [API reference](https://kludex.github.io/python-multipart/api/)
|
|
175
|
+
- [Changelog](https://github.com/Kludex/python-multipart/blob/main/CHANGELOG.md)
|
|
176
|
+
|
|
177
|
+
## License
|
|
178
|
+
|
|
179
|
+
Apache 2.0. See [LICENSE.txt](LICENSE.txt).
|
|
@@ -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,261 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pywin32
|
|
3
|
+
Version: 312
|
|
4
|
+
Summary: Python for Windows Extensions
|
|
5
|
+
Author: Mark Hammond (et al)
|
|
6
|
+
Author-email: mhammond@skippinet.com.au
|
|
7
|
+
License: PSF
|
|
8
|
+
Project-URL: Homepage, https://github.com/mhammond/pywin32
|
|
9
|
+
Project-URL: Changes, https://github.com/mhammond/pywin32/blob/main/CHANGES.md
|
|
10
|
+
Project-URL: Docs, https://mhammond.github.io/pywin32/
|
|
11
|
+
Project-URL: Bugs, https://github.com/mhammond/pywin32/issues
|
|
12
|
+
Project-URL: Support Requests, https://github.com/mhammond/pywin32/discussions
|
|
13
|
+
Project-URL: Mailing List, https://mail.python.org/mailman/listinfo/python-win32
|
|
14
|
+
Classifier: Environment :: Win32 (MS Windows)
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: Python Software Foundation License
|
|
17
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
18
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
26
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
27
|
+
Requires-Python: >=3.9
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
License-File: adodbapi/license.txt
|
|
30
|
+
License-File: com/License.txt
|
|
31
|
+
License-File: pythonwin/License.txt
|
|
32
|
+
License-File: pythonwin/Scintilla/License.txt
|
|
33
|
+
License-File: pythonwin/pywin/idle/LICENSE.txt
|
|
34
|
+
License-File: win32/License.txt
|
|
35
|
+
License-File: com/win32comext/mapi/src/MAPIStubLibrary/LICENSE
|
|
36
|
+
License-File: isapi/README.txt
|
|
37
|
+
Dynamic: author
|
|
38
|
+
Dynamic: author-email
|
|
39
|
+
Dynamic: classifier
|
|
40
|
+
Dynamic: description
|
|
41
|
+
Dynamic: description-content-type
|
|
42
|
+
Dynamic: license
|
|
43
|
+
Dynamic: license-file
|
|
44
|
+
Dynamic: project-url
|
|
45
|
+
Dynamic: requires-python
|
|
46
|
+
Dynamic: summary
|
|
47
|
+
|
|
48
|
+
# pywin32
|
|
49
|
+
|
|
50
|
+
[](https://github.com/mhammond/pywin32/actions?query=workflow%3ACI)
|
|
51
|
+
[](https://pypi.org/project/pywin32)
|
|
52
|
+
[](https://pypi.org/project/pywin32)
|
|
53
|
+
[](https://pypi.org/project/pywin32)
|
|
54
|
+
[](https://spdx.org/licenses/PSF-2.0.html)
|
|
55
|
+
|
|
56
|
+
-----
|
|
57
|
+
|
|
58
|
+
This is the readme for the Python for Win32 (pywin32) extensions, which provides access to many of the Windows APIs from Python, including COM support.
|
|
59
|
+
|
|
60
|
+
See [CHANGES.md](https://github.com/mhammond/pywin32/blob/main/CHANGES.md) for recent notable changes.
|
|
61
|
+
|
|
62
|
+
adodbapi's documentation can be found in: [adodbapi/readme.txt](https://github.com/mhammond/pywin32/blob/main/adodbapi/readme.txt)
|
|
63
|
+
|
|
64
|
+
isapi's documentation can be found in: [isapi/README.txt](https://github.com/mhammond/pywin32/blob/main/isapi/README.txt)
|
|
65
|
+
|
|
66
|
+
## Docs
|
|
67
|
+
|
|
68
|
+
The docs are a long and sad story, but [there's now an online version](https://mhammond.github.io/pywin32/)
|
|
69
|
+
of the `PyWin32.chm` helpfile (thanks [@ofek](https://github.com/mhammond/pywin32/pull/1774)!).
|
|
70
|
+
Lots of that is very old, but some is auto-generated and current. Would love help untangling the docs!
|
|
71
|
+
|
|
72
|
+
You can get type hints, signatures and annotations from [`types-pywin32`](https://pypi.org/project/types-pywin32/).
|
|
73
|
+
|
|
74
|
+
## Support
|
|
75
|
+
|
|
76
|
+
Feel free to [open issues](https://github.com/mhammond/pywin32/issues) for
|
|
77
|
+
all bugs (or suspected bugs) in pywin32. [pull-requests](https://github.com/mhammond/pywin32/pulls)
|
|
78
|
+
for all bugs or features are also welcome.
|
|
79
|
+
|
|
80
|
+
However, please **do not open GitHub issues for general support requests**, or for problems or questions using the modules in this package.
|
|
81
|
+
For pywin32 support requests, please start a [discussion](https://github.com/mhammond/pywin32/discussions) under the [Q&A category](https://github.com/mhammond/pywin32/discussions/new?category=q-a). All non bug related issues will be converted into a discussion anyhow.
|
|
82
|
+
The [python-win32 mailing list](https://mail.python.org/mailman/listinfo/python-win32) is still available for general Python on Windows help requests.
|
|
83
|
+
|
|
84
|
+
Type stubs currently live in [typeshed](<https://github.com/python/typeshed/tree/main/stubs/pywin32>).
|
|
85
|
+
Any issue or request related to static type-checking and IntelliSense should be raised there.
|
|
86
|
+
|
|
87
|
+
## Binaries
|
|
88
|
+
|
|
89
|
+
[Binary releases are no longer supported.](https://mhammond.github.io/pywin32_installers.html)
|
|
90
|
+
|
|
91
|
+
Build 306 was the last with .exe installers. You really shouldn't use them, but if you really need them,
|
|
92
|
+
[find them here](https://github.com/mhammond/pywin32/releases/tag/b306)
|
|
93
|
+
|
|
94
|
+
## Installing via PIP
|
|
95
|
+
|
|
96
|
+
You should install pywin32 via pip - eg,
|
|
97
|
+
|
|
98
|
+
```shell
|
|
99
|
+
python -m pip install --upgrade pywin32
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
There is a post-install script (see below) which should *not* be run inside virtual environments;
|
|
103
|
+
it should only be run in "global" installs.
|
|
104
|
+
|
|
105
|
+
For unreleased changes, you can download builds made by [GitHub actions](https://github.com/mhammond/pywin32/actions/) -
|
|
106
|
+
choose any "workflow" from the `main` branch and download its "artifacts"
|
|
107
|
+
|
|
108
|
+
### Installing globally
|
|
109
|
+
|
|
110
|
+
Outside of a virtual environment you might want to install COM objects, services, etc. You can do
|
|
111
|
+
this by executing:
|
|
112
|
+
|
|
113
|
+
```shell
|
|
114
|
+
python -m pywin32_postinstall -install
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
or (shorter but you don't have control over which python environment is used)
|
|
118
|
+
|
|
119
|
+
```shell
|
|
120
|
+
pywin32_postinstall -install
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
If you do this with normal permissions it will be global for your user (a few files will be
|
|
124
|
+
copied to the root of your Python install and some changes made to HKCU). If you execute this from
|
|
125
|
+
an elevated process, it will be global for the machine (files will be copied to System32, HKLM
|
|
126
|
+
will be changed, etc)
|
|
127
|
+
|
|
128
|
+
### Installing for MingGW/msys2
|
|
129
|
+
|
|
130
|
+
The folks at <https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-python-pywin32> are graciously keeping an updated set of patches to install pywin32 for MingGW/msys2.
|
|
131
|
+
|
|
132
|
+
We'd suggest installing from <https://packages.msys2.org/base/mingw-w64-python-pywin32> `pacman -S mingw-w64-python-pywin32`.
|
|
133
|
+
|
|
134
|
+
We're open to seeing these patches be upstreamed in pywin32 if they can be tested automatically on the CI.
|
|
135
|
+
|
|
136
|
+
### Running as a Windows Service
|
|
137
|
+
|
|
138
|
+
To run as a service, you probably want to install pywin32 globally from an elevated
|
|
139
|
+
command prompt - see above.
|
|
140
|
+
|
|
141
|
+
You also need to ensure Python is installed in a location where the user running
|
|
142
|
+
the service has access to the installation and is able to load `pywintypesXX.dll` and `pythonXX.dll`.
|
|
143
|
+
In particular, the `LocalSystem` account typically will not have access to your local `%USER%` directory structure.
|
|
144
|
+
|
|
145
|
+
## Troubleshooting
|
|
146
|
+
|
|
147
|
+
If you encounter any problems when upgrading like the following:
|
|
148
|
+
|
|
149
|
+
```text
|
|
150
|
+
The specified procedure could not be found
|
|
151
|
+
Entry-point not found
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
It usually means one of 2 things:
|
|
155
|
+
|
|
156
|
+
* You've upgraded an install where the post-install script was previously run.
|
|
157
|
+
So you should run it again:
|
|
158
|
+
|
|
159
|
+
```shell
|
|
160
|
+
python -m pywin32_postinstall -install
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
or (shorter but you don't have control over which python environment is used)
|
|
164
|
+
|
|
165
|
+
```shell
|
|
166
|
+
pywin32_postinstall -install
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
This will make some small attempts to cleanup older conflicting installs.
|
|
170
|
+
|
|
171
|
+
* There are other pywin32 DLLs installed in your system,
|
|
172
|
+
but in a different location than the new ones. This sometimes happens in environments that
|
|
173
|
+
come with pywin32 pre-shipped (eg, anaconda?).
|
|
174
|
+
|
|
175
|
+
The possible solutions here are:
|
|
176
|
+
|
|
177
|
+
* Run the "post_install" script documented above.
|
|
178
|
+
* Otherwise, find and remove all other copies of `pywintypesXX.dll` and `pythoncomXX.dll`
|
|
179
|
+
(where `XX` is the Python version - eg, "39")
|
|
180
|
+
|
|
181
|
+
## Building from source
|
|
182
|
+
|
|
183
|
+
Install Visual Studio 2019 (later probably works, but options might be different),
|
|
184
|
+
follow the instructions in [Build environment](/build_env.md#build-environment)
|
|
185
|
+
for the version you install.
|
|
186
|
+
|
|
187
|
+
Then follow the [Build](/build_env.md#build) instructions for the build itself (including ARM64 cross-compilation).
|
|
188
|
+
|
|
189
|
+
## Release process
|
|
190
|
+
|
|
191
|
+
The following steps are performed when making a new release - this is mainly
|
|
192
|
+
to form a checklist so @mhammond doesn't forget what to do :)
|
|
193
|
+
|
|
194
|
+
Since build 307 the release process is based on the artifacts created by Github actions.
|
|
195
|
+
|
|
196
|
+
* Ensure CHANGES.md has everything worth noting. Update the header to reflect
|
|
197
|
+
the about-to-be released build and date, commit it.
|
|
198
|
+
|
|
199
|
+
* Update setup.py with the new build number. Update CHANGES.md to have a new heading
|
|
200
|
+
section for the next unreleased version. (ie, a new, empty "Coming in build XXX, as yet unreleased"
|
|
201
|
+
section)
|
|
202
|
+
|
|
203
|
+
* Push these changes to GitHub, wait for the actions to complete, then
|
|
204
|
+
download the artifacts from that run.
|
|
205
|
+
|
|
206
|
+
* Upload `.whl` artifacts to pypi - we do this before pushing the tag because they might be
|
|
207
|
+
rejected for an invalid `README.md`. Done via `py -3.? -m twine upload dist/*XXX*.whl`.
|
|
208
|
+
|
|
209
|
+
* Create a new git tag for the release.
|
|
210
|
+
|
|
211
|
+
* Update setup.py with the new build number + ".1" (eg, 123.1), to ensure
|
|
212
|
+
future test builds aren't mistaken for the real release.
|
|
213
|
+
|
|
214
|
+
* Make sure everything is pushed to GitHub, including the tag (ie,
|
|
215
|
+
`git push --tags`)
|
|
216
|
+
|
|
217
|
+
* Send mail to python-win32
|
|
218
|
+
|
|
219
|
+
<details>
|
|
220
|
+
<summary>
|
|
221
|
+
|
|
222
|
+
### Older Manual Release Process
|
|
223
|
+
|
|
224
|
+
</summary>
|
|
225
|
+
|
|
226
|
+
This is the old process used when a local dev environment was used to create
|
|
227
|
+
the builds. Build 306 was the last released with this process.
|
|
228
|
+
|
|
229
|
+
* Ensure CHANGES.md has everything worth noting. Update the header to reflect
|
|
230
|
+
the about-to-be released build and date, commit it.
|
|
231
|
+
|
|
232
|
+
* Update setup.py with the new build number.
|
|
233
|
+
|
|
234
|
+
* Execute `make_all.bat`, wait forever, test the artifacts.
|
|
235
|
+
|
|
236
|
+
* Upload .whl artifacts to pypi - we do this before pushing the tag because they might be
|
|
237
|
+
rejected for an invalid `README.md`. Done via `py -3.? -m twine upload dist/*XXX*.whl`.
|
|
238
|
+
|
|
239
|
+
* Commit setup.py (so the new build number is in the repo), create a new git tag
|
|
240
|
+
|
|
241
|
+
* Upload the .exe installers to GitHub.
|
|
242
|
+
|
|
243
|
+
* Update setup.py with the new build number + ".1" (eg, 123.1), to ensure
|
|
244
|
+
future test builds aren't mistaken for the real release.
|
|
245
|
+
|
|
246
|
+
* Make sure everything is pushed to GitHub, including the tag (ie,
|
|
247
|
+
`git push --tags`)
|
|
248
|
+
|
|
249
|
+
* Send mail to python-win32
|
|
250
|
+
|
|
251
|
+
</details>
|
|
252
|
+
|
|
253
|
+
## Versioning
|
|
254
|
+
|
|
255
|
+
pywin32 uses a simple incremental version numbering scheme. Any increase in the version number may correspond to a breaking interface change. It is recommended that projects using pywin32 pin the dependency to a specific version.
|
|
256
|
+
|
|
257
|
+
## Licenses
|
|
258
|
+
|
|
259
|
+
pywin32 contains a mix of differently licensed code. The license files in the source tree are the source of truth.[^1]. So are individual Copyright notices at the top of files. You can also find license information through the [License-File Packaging Metadata](https://packaging.python.org/en/latest/specifications/core-metadata/#license-file-multiple-use).
|
|
260
|
+
|
|
261
|
+
[^1]: <https://github.com/mhammond/pywin32/issues/1127#issuecomment-393364022>
|