python-osc 1.8.1__tar.gz → 1.8.2__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 (38) hide show
  1. python-osc-1.8.2/PKG-INFO +202 -0
  2. {python-osc-1.8.1 → python-osc-1.8.2}/README.rst +2 -2
  3. python-osc-1.8.2/pyproject.toml +21 -0
  4. python-osc-1.8.2/python_osc.egg-info/PKG-INFO +202 -0
  5. {python-osc-1.8.1 → python-osc-1.8.2}/python_osc.egg-info/SOURCES.txt +1 -1
  6. python-osc-1.8.1/PKG-INFO +0 -178
  7. python-osc-1.8.1/python_osc.egg-info/PKG-INFO +0 -178
  8. python-osc-1.8.1/setup.py +0 -41
  9. {python-osc-1.8.1 → python-osc-1.8.2}/LICENSE.txt +0 -0
  10. {python-osc-1.8.1 → python-osc-1.8.2}/MANIFEST.in +0 -0
  11. {python-osc-1.8.1 → python-osc-1.8.2}/python_osc.egg-info/dependency_links.txt +0 -0
  12. {python-osc-1.8.1 → python-osc-1.8.2}/python_osc.egg-info/top_level.txt +0 -0
  13. {python-osc-1.8.1 → python-osc-1.8.2}/pythonosc/__init__.py +0 -0
  14. {python-osc-1.8.1 → python-osc-1.8.2}/pythonosc/dispatcher.py +0 -0
  15. {python-osc-1.8.1 → python-osc-1.8.2}/pythonosc/osc_bundle.py +0 -0
  16. {python-osc-1.8.1 → python-osc-1.8.2}/pythonosc/osc_bundle_builder.py +0 -0
  17. {python-osc-1.8.1 → python-osc-1.8.2}/pythonosc/osc_message.py +0 -0
  18. {python-osc-1.8.1 → python-osc-1.8.2}/pythonosc/osc_message_builder.py +0 -0
  19. {python-osc-1.8.1 → python-osc-1.8.2}/pythonosc/osc_packet.py +0 -0
  20. {python-osc-1.8.1 → python-osc-1.8.2}/pythonosc/osc_server.py +0 -0
  21. {python-osc-1.8.1 → python-osc-1.8.2}/pythonosc/parsing/__init__.py +0 -0
  22. {python-osc-1.8.1 → python-osc-1.8.2}/pythonosc/parsing/ntp.py +0 -0
  23. {python-osc-1.8.1 → python-osc-1.8.2}/pythonosc/parsing/osc_types.py +0 -0
  24. {python-osc-1.8.1 → python-osc-1.8.2}/pythonosc/py.typed +0 -0
  25. {python-osc-1.8.1 → python-osc-1.8.2}/pythonosc/test/__init__.py +0 -0
  26. {python-osc-1.8.1 → python-osc-1.8.2}/pythonosc/test/parsing/__init__.py +0 -0
  27. {python-osc-1.8.1 → python-osc-1.8.2}/pythonosc/test/parsing/test_ntp.py +0 -0
  28. {python-osc-1.8.1 → python-osc-1.8.2}/pythonosc/test/parsing/test_osc_types.py +0 -0
  29. {python-osc-1.8.1 → python-osc-1.8.2}/pythonosc/test/test_dispatcher.py +0 -0
  30. {python-osc-1.8.1 → python-osc-1.8.2}/pythonosc/test/test_osc_bundle.py +0 -0
  31. {python-osc-1.8.1 → python-osc-1.8.2}/pythonosc/test/test_osc_bundle_builder.py +0 -0
  32. {python-osc-1.8.1 → python-osc-1.8.2}/pythonosc/test/test_osc_message.py +0 -0
  33. {python-osc-1.8.1 → python-osc-1.8.2}/pythonosc/test/test_osc_message_builder.py +0 -0
  34. {python-osc-1.8.1 → python-osc-1.8.2}/pythonosc/test/test_osc_packet.py +0 -0
  35. {python-osc-1.8.1 → python-osc-1.8.2}/pythonosc/test/test_osc_server.py +0 -0
  36. {python-osc-1.8.1 → python-osc-1.8.2}/pythonosc/test/test_udp_client.py +0 -0
  37. {python-osc-1.8.1 → python-osc-1.8.2}/pythonosc/udp_client.py +0 -0
  38. {python-osc-1.8.1 → python-osc-1.8.2}/setup.cfg +0 -0
@@ -0,0 +1,202 @@
1
+ Metadata-Version: 2.1
2
+ Name: python-osc
3
+ Version: 1.8.2
4
+ Summary: Open Sound Control server and client implementations in pure Python
5
+ Author-email: attwad <tmusoft@gmail.com>
6
+ License: This is free and unencumbered software released into the public domain.
7
+
8
+ Anyone is free to copy, modify, publish, use, compile, sell, or
9
+ distribute this software, either in source code form or as a compiled
10
+ binary, for any purpose, commercial or non-commercial, and by any
11
+ means.
12
+
13
+ In jurisdictions that recognize copyright laws, the author or authors
14
+ of this software dedicate any and all copyright interest in the
15
+ software to the public domain. We make this dedication for the benefit
16
+ of the public at large and to the detriment of our heirs and
17
+ successors. We intend this dedication to be an overt act of
18
+ relinquishment in perpetuity of all present and future rights to this
19
+ software under copyright law.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24
+ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
25
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
26
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27
+ OTHER DEALINGS IN THE SOFTWARE.
28
+
29
+ For more information, please refer to <http://unlicense.org/>
30
+
31
+ Project-URL: Repository, https://github.com/attwad/python-osc
32
+ Keywords: osc,sound,midi,music
33
+ Classifier: Development Status :: 5 - Production/Stable
34
+ Classifier: Intended Audience :: Developers
35
+ Classifier: License :: Freely Distributable
36
+ Classifier: Programming Language :: Python :: 3
37
+ Classifier: Topic :: Multimedia :: Sound/Audio
38
+ Classifier: Topic :: System :: Networking
39
+ Requires-Python: >=3.7
40
+ Description-Content-Type: text/x-rst
41
+ License-File: LICENSE.txt
42
+
43
+ ==========
44
+ python-osc
45
+ ==========
46
+
47
+ Open Sound Control server and client implementations in **pure python**.
48
+
49
+ .. image:: https://github.com/attwad/python-osc/actions/workflows/python-test.yml/badge.svg
50
+ :target: https://github.com/attwad/python-osc/actions/workflows/python-test.yml
51
+
52
+
53
+ Current status
54
+ ==============
55
+
56
+ This library was developed following the
57
+ `OpenSoundControl Specification 1.0 <https://opensoundcontrol.stanford.edu/spec-1_0.html>`_
58
+ and is currently in a stable state.
59
+
60
+ Features
61
+ ========
62
+
63
+ * UDP blocking/threading/forking/asyncio server implementations
64
+ * UDP client
65
+ * int, int64, float, string, double, MIDI, timestamps, blob, nil OSC arguments
66
+ * simple OSC address<->callback matching system
67
+ * extensive unit test coverage
68
+ * basic client and server examples
69
+
70
+ Documentation
71
+ =============
72
+
73
+ Available at https://python-osc.readthedocs.io/.
74
+
75
+ Installation
76
+ ============
77
+
78
+ python-osc is a pure python library that has no external dependencies,
79
+ to install it just use pip (prefered):
80
+
81
+ .. image:: https://img.shields.io/pypi/v/python-osc.svg
82
+ :target: https://pypi.python.org/pypi/python-osc
83
+
84
+ .. code-block:: bash
85
+
86
+ $ pip install python-osc
87
+
88
+ or from the raw sources for the development version:
89
+
90
+ .. code-block:: bash
91
+
92
+ $ python setup.py test
93
+ $ python setup.py install
94
+
95
+ Examples
96
+ ========
97
+
98
+ Simple client
99
+ -------------
100
+
101
+ .. code-block:: python
102
+
103
+ """Small example OSC client
104
+
105
+ This program sends 10 random values between 0.0 and 1.0 to the /filter address,
106
+ waiting for 1 seconds between each value.
107
+ """
108
+ import argparse
109
+ import random
110
+ import time
111
+
112
+ from pythonosc import udp_client
113
+
114
+
115
+ if __name__ == "__main__":
116
+ parser = argparse.ArgumentParser()
117
+ parser.add_argument("--ip", default="127.0.0.1",
118
+ help="The ip of the OSC server")
119
+ parser.add_argument("--port", type=int, default=5005,
120
+ help="The port the OSC server is listening on")
121
+ args = parser.parse_args()
122
+
123
+ client = udp_client.SimpleUDPClient(args.ip, args.port)
124
+
125
+ for x in range(10):
126
+ client.send_message("/filter", random.random())
127
+ time.sleep(1)
128
+
129
+ Simple server
130
+ -------------
131
+
132
+ .. code-block:: python
133
+
134
+ """Small example OSC server
135
+
136
+ This program listens to several addresses, and prints some information about
137
+ received packets.
138
+ """
139
+ import argparse
140
+ import math
141
+
142
+ from pythonosc.dispatcher import Dispatcher
143
+ from pythonosc import osc_server
144
+
145
+ def print_volume_handler(unused_addr, args, volume):
146
+ print("[{0}] ~ {1}".format(args[0], volume))
147
+
148
+ def print_compute_handler(unused_addr, args, volume):
149
+ try:
150
+ print("[{0}] ~ {1}".format(args[0], args[1](volume)))
151
+ except ValueError: pass
152
+
153
+ if __name__ == "__main__":
154
+ parser = argparse.ArgumentParser()
155
+ parser.add_argument("--ip",
156
+ default="127.0.0.1", help="The ip to listen on")
157
+ parser.add_argument("--port",
158
+ type=int, default=5005, help="The port to listen on")
159
+ args = parser.parse_args()
160
+
161
+ dispatcher = Dispatcher()
162
+ dispatcher.map("/filter", print)
163
+ dispatcher.map("/volume", print_volume_handler, "Volume")
164
+ dispatcher.map("/logvolume", print_compute_handler, "Log volume", math.log)
165
+
166
+ server = osc_server.ThreadingOSCUDPServer(
167
+ (args.ip, args.port), dispatcher)
168
+ print("Serving on {}".format(server.server_address))
169
+ server.serve_forever()
170
+
171
+ Building bundles
172
+ ----------------
173
+
174
+ .. code-block:: python
175
+
176
+ from pythonosc import osc_bundle_builder
177
+ from pythonosc import osc_message_builder
178
+
179
+ bundle = osc_bundle_builder.OscBundleBuilder(
180
+ osc_bundle_builder.IMMEDIATELY)
181
+ msg = osc_message_builder.OscMessageBuilder(address="/SYNC")
182
+ msg.add_arg(4.0)
183
+ # Add 4 messages in the bundle, each with more arguments.
184
+ bundle.add_content(msg.build())
185
+ msg.add_arg(2)
186
+ bundle.add_content(msg.build())
187
+ msg.add_arg("value")
188
+ bundle.add_content(msg.build())
189
+ msg.add_arg(b"\x01\x02\x03")
190
+ bundle.add_content(msg.build())
191
+
192
+ sub_bundle = bundle.build()
193
+ # Now add the same bundle inside itself.
194
+ bundle.add_content(sub_bundle)
195
+ # The bundle has 5 elements in total now.
196
+
197
+ bundle = bundle.build()
198
+ # You can now send it via a client as described in other examples.
199
+
200
+ License?
201
+ ========
202
+ Unlicensed, do what you want with it. (http://unlicense.org)
@@ -2,7 +2,7 @@
2
2
  python-osc
3
3
  ==========
4
4
 
5
- Open Sound Control server and client implementations in **pure python** (3.5+).
5
+ Open Sound Control server and client implementations in **pure python**.
6
6
 
7
7
  .. image:: https://github.com/attwad/python-osc/actions/workflows/python-test.yml/badge.svg
8
8
  :target: https://github.com/attwad/python-osc/actions/workflows/python-test.yml
@@ -20,7 +20,7 @@ Features
20
20
 
21
21
  * UDP blocking/threading/forking/asyncio server implementations
22
22
  * UDP client
23
- * int, int64, float, string, double, MIDI, timestamps, blob OSC arguments
23
+ * int, int64, float, string, double, MIDI, timestamps, blob, nil OSC arguments
24
24
  * simple OSC address<->callback matching system
25
25
  * extensive unit test coverage
26
26
  * basic client and server examples
@@ -0,0 +1,21 @@
1
+ [project]
2
+ name = "python-osc"
3
+ version="1.8.2"
4
+ description="Open Sound Control server and client implementations in pure Python"
5
+ readme="README.rst"
6
+ requires-python=">=3.7"
7
+ license = {file = "LICENSE.txt"}
8
+ authors = [
9
+ {name = "attwad", email = "tmusoft@gmail.com"},
10
+ ]
11
+ keywords = ["osc", "sound", "midi", "music"]
12
+ classifiers=[
13
+ 'Development Status :: 5 - Production/Stable',
14
+ 'Intended Audience :: Developers',
15
+ 'License :: Freely Distributable',
16
+ 'Programming Language :: Python :: 3',
17
+ 'Topic :: Multimedia :: Sound/Audio',
18
+ 'Topic :: System :: Networking',
19
+ ]
20
+ [project.urls]
21
+ Repository = "https://github.com/attwad/python-osc"
@@ -0,0 +1,202 @@
1
+ Metadata-Version: 2.1
2
+ Name: python-osc
3
+ Version: 1.8.2
4
+ Summary: Open Sound Control server and client implementations in pure Python
5
+ Author-email: attwad <tmusoft@gmail.com>
6
+ License: This is free and unencumbered software released into the public domain.
7
+
8
+ Anyone is free to copy, modify, publish, use, compile, sell, or
9
+ distribute this software, either in source code form or as a compiled
10
+ binary, for any purpose, commercial or non-commercial, and by any
11
+ means.
12
+
13
+ In jurisdictions that recognize copyright laws, the author or authors
14
+ of this software dedicate any and all copyright interest in the
15
+ software to the public domain. We make this dedication for the benefit
16
+ of the public at large and to the detriment of our heirs and
17
+ successors. We intend this dedication to be an overt act of
18
+ relinquishment in perpetuity of all present and future rights to this
19
+ software under copyright law.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24
+ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
25
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
26
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27
+ OTHER DEALINGS IN THE SOFTWARE.
28
+
29
+ For more information, please refer to <http://unlicense.org/>
30
+
31
+ Project-URL: Repository, https://github.com/attwad/python-osc
32
+ Keywords: osc,sound,midi,music
33
+ Classifier: Development Status :: 5 - Production/Stable
34
+ Classifier: Intended Audience :: Developers
35
+ Classifier: License :: Freely Distributable
36
+ Classifier: Programming Language :: Python :: 3
37
+ Classifier: Topic :: Multimedia :: Sound/Audio
38
+ Classifier: Topic :: System :: Networking
39
+ Requires-Python: >=3.7
40
+ Description-Content-Type: text/x-rst
41
+ License-File: LICENSE.txt
42
+
43
+ ==========
44
+ python-osc
45
+ ==========
46
+
47
+ Open Sound Control server and client implementations in **pure python**.
48
+
49
+ .. image:: https://github.com/attwad/python-osc/actions/workflows/python-test.yml/badge.svg
50
+ :target: https://github.com/attwad/python-osc/actions/workflows/python-test.yml
51
+
52
+
53
+ Current status
54
+ ==============
55
+
56
+ This library was developed following the
57
+ `OpenSoundControl Specification 1.0 <https://opensoundcontrol.stanford.edu/spec-1_0.html>`_
58
+ and is currently in a stable state.
59
+
60
+ Features
61
+ ========
62
+
63
+ * UDP blocking/threading/forking/asyncio server implementations
64
+ * UDP client
65
+ * int, int64, float, string, double, MIDI, timestamps, blob, nil OSC arguments
66
+ * simple OSC address<->callback matching system
67
+ * extensive unit test coverage
68
+ * basic client and server examples
69
+
70
+ Documentation
71
+ =============
72
+
73
+ Available at https://python-osc.readthedocs.io/.
74
+
75
+ Installation
76
+ ============
77
+
78
+ python-osc is a pure python library that has no external dependencies,
79
+ to install it just use pip (prefered):
80
+
81
+ .. image:: https://img.shields.io/pypi/v/python-osc.svg
82
+ :target: https://pypi.python.org/pypi/python-osc
83
+
84
+ .. code-block:: bash
85
+
86
+ $ pip install python-osc
87
+
88
+ or from the raw sources for the development version:
89
+
90
+ .. code-block:: bash
91
+
92
+ $ python setup.py test
93
+ $ python setup.py install
94
+
95
+ Examples
96
+ ========
97
+
98
+ Simple client
99
+ -------------
100
+
101
+ .. code-block:: python
102
+
103
+ """Small example OSC client
104
+
105
+ This program sends 10 random values between 0.0 and 1.0 to the /filter address,
106
+ waiting for 1 seconds between each value.
107
+ """
108
+ import argparse
109
+ import random
110
+ import time
111
+
112
+ from pythonosc import udp_client
113
+
114
+
115
+ if __name__ == "__main__":
116
+ parser = argparse.ArgumentParser()
117
+ parser.add_argument("--ip", default="127.0.0.1",
118
+ help="The ip of the OSC server")
119
+ parser.add_argument("--port", type=int, default=5005,
120
+ help="The port the OSC server is listening on")
121
+ args = parser.parse_args()
122
+
123
+ client = udp_client.SimpleUDPClient(args.ip, args.port)
124
+
125
+ for x in range(10):
126
+ client.send_message("/filter", random.random())
127
+ time.sleep(1)
128
+
129
+ Simple server
130
+ -------------
131
+
132
+ .. code-block:: python
133
+
134
+ """Small example OSC server
135
+
136
+ This program listens to several addresses, and prints some information about
137
+ received packets.
138
+ """
139
+ import argparse
140
+ import math
141
+
142
+ from pythonosc.dispatcher import Dispatcher
143
+ from pythonosc import osc_server
144
+
145
+ def print_volume_handler(unused_addr, args, volume):
146
+ print("[{0}] ~ {1}".format(args[0], volume))
147
+
148
+ def print_compute_handler(unused_addr, args, volume):
149
+ try:
150
+ print("[{0}] ~ {1}".format(args[0], args[1](volume)))
151
+ except ValueError: pass
152
+
153
+ if __name__ == "__main__":
154
+ parser = argparse.ArgumentParser()
155
+ parser.add_argument("--ip",
156
+ default="127.0.0.1", help="The ip to listen on")
157
+ parser.add_argument("--port",
158
+ type=int, default=5005, help="The port to listen on")
159
+ args = parser.parse_args()
160
+
161
+ dispatcher = Dispatcher()
162
+ dispatcher.map("/filter", print)
163
+ dispatcher.map("/volume", print_volume_handler, "Volume")
164
+ dispatcher.map("/logvolume", print_compute_handler, "Log volume", math.log)
165
+
166
+ server = osc_server.ThreadingOSCUDPServer(
167
+ (args.ip, args.port), dispatcher)
168
+ print("Serving on {}".format(server.server_address))
169
+ server.serve_forever()
170
+
171
+ Building bundles
172
+ ----------------
173
+
174
+ .. code-block:: python
175
+
176
+ from pythonosc import osc_bundle_builder
177
+ from pythonosc import osc_message_builder
178
+
179
+ bundle = osc_bundle_builder.OscBundleBuilder(
180
+ osc_bundle_builder.IMMEDIATELY)
181
+ msg = osc_message_builder.OscMessageBuilder(address="/SYNC")
182
+ msg.add_arg(4.0)
183
+ # Add 4 messages in the bundle, each with more arguments.
184
+ bundle.add_content(msg.build())
185
+ msg.add_arg(2)
186
+ bundle.add_content(msg.build())
187
+ msg.add_arg("value")
188
+ bundle.add_content(msg.build())
189
+ msg.add_arg(b"\x01\x02\x03")
190
+ bundle.add_content(msg.build())
191
+
192
+ sub_bundle = bundle.build()
193
+ # Now add the same bundle inside itself.
194
+ bundle.add_content(sub_bundle)
195
+ # The bundle has 5 elements in total now.
196
+
197
+ bundle = bundle.build()
198
+ # You can now send it via a client as described in other examples.
199
+
200
+ License?
201
+ ========
202
+ Unlicensed, do what you want with it. (http://unlicense.org)
@@ -1,8 +1,8 @@
1
1
  LICENSE.txt
2
2
  MANIFEST.in
3
3
  README.rst
4
+ pyproject.toml
4
5
  setup.cfg
5
- setup.py
6
6
  python_osc.egg-info/PKG-INFO
7
7
  python_osc.egg-info/SOURCES.txt
8
8
  python_osc.egg-info/dependency_links.txt
python-osc-1.8.1/PKG-INFO DELETED
@@ -1,178 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: python-osc
3
- Version: 1.8.1
4
- Summary: Open Sound Control server and client implementations in pure Python
5
- Home-page: https://github.com/attwad/python-osc
6
- Author: attwad
7
- Author-email: tmusoft@gmail.com
8
- License: UNKNOWN
9
- Description: ==========
10
- python-osc
11
- ==========
12
-
13
- Open Sound Control server and client implementations in **pure python** (3.5+).
14
-
15
- .. image:: https://github.com/attwad/python-osc/actions/workflows/python-test.yml/badge.svg
16
- :target: https://github.com/attwad/python-osc/actions/workflows/python-test.yml
17
-
18
-
19
- Current status
20
- ==============
21
-
22
- This library was developed following the
23
- `OpenSoundControl Specification 1.0 <https://opensoundcontrol.stanford.edu/spec-1_0.html>`_
24
- and is currently in a stable state.
25
-
26
- Features
27
- ========
28
-
29
- * UDP blocking/threading/forking/asyncio server implementations
30
- * UDP client
31
- * int, int64, float, string, double, MIDI, timestamps, blob OSC arguments
32
- * simple OSC address<->callback matching system
33
- * extensive unit test coverage
34
- * basic client and server examples
35
-
36
- Documentation
37
- =============
38
-
39
- Available at https://python-osc.readthedocs.io/.
40
-
41
- Installation
42
- ============
43
-
44
- python-osc is a pure python library that has no external dependencies,
45
- to install it just use pip (prefered):
46
-
47
- .. image:: https://img.shields.io/pypi/v/python-osc.svg
48
- :target: https://pypi.python.org/pypi/python-osc
49
-
50
- .. code-block:: bash
51
-
52
- $ pip install python-osc
53
-
54
- or from the raw sources for the development version:
55
-
56
- .. code-block:: bash
57
-
58
- $ python setup.py test
59
- $ python setup.py install
60
-
61
- Examples
62
- ========
63
-
64
- Simple client
65
- -------------
66
-
67
- .. code-block:: python
68
-
69
- """Small example OSC client
70
-
71
- This program sends 10 random values between 0.0 and 1.0 to the /filter address,
72
- waiting for 1 seconds between each value.
73
- """
74
- import argparse
75
- import random
76
- import time
77
-
78
- from pythonosc import udp_client
79
-
80
-
81
- if __name__ == "__main__":
82
- parser = argparse.ArgumentParser()
83
- parser.add_argument("--ip", default="127.0.0.1",
84
- help="The ip of the OSC server")
85
- parser.add_argument("--port", type=int, default=5005,
86
- help="The port the OSC server is listening on")
87
- args = parser.parse_args()
88
-
89
- client = udp_client.SimpleUDPClient(args.ip, args.port)
90
-
91
- for x in range(10):
92
- client.send_message("/filter", random.random())
93
- time.sleep(1)
94
-
95
- Simple server
96
- -------------
97
-
98
- .. code-block:: python
99
-
100
- """Small example OSC server
101
-
102
- This program listens to several addresses, and prints some information about
103
- received packets.
104
- """
105
- import argparse
106
- import math
107
-
108
- from pythonosc.dispatcher import Dispatcher
109
- from pythonosc import osc_server
110
-
111
- def print_volume_handler(unused_addr, args, volume):
112
- print("[{0}] ~ {1}".format(args[0], volume))
113
-
114
- def print_compute_handler(unused_addr, args, volume):
115
- try:
116
- print("[{0}] ~ {1}".format(args[0], args[1](volume)))
117
- except ValueError: pass
118
-
119
- if __name__ == "__main__":
120
- parser = argparse.ArgumentParser()
121
- parser.add_argument("--ip",
122
- default="127.0.0.1", help="The ip to listen on")
123
- parser.add_argument("--port",
124
- type=int, default=5005, help="The port to listen on")
125
- args = parser.parse_args()
126
-
127
- dispatcher = Dispatcher()
128
- dispatcher.map("/filter", print)
129
- dispatcher.map("/volume", print_volume_handler, "Volume")
130
- dispatcher.map("/logvolume", print_compute_handler, "Log volume", math.log)
131
-
132
- server = osc_server.ThreadingOSCUDPServer(
133
- (args.ip, args.port), dispatcher)
134
- print("Serving on {}".format(server.server_address))
135
- server.serve_forever()
136
-
137
- Building bundles
138
- ----------------
139
-
140
- .. code-block:: python
141
-
142
- from pythonosc import osc_bundle_builder
143
- from pythonosc import osc_message_builder
144
-
145
- bundle = osc_bundle_builder.OscBundleBuilder(
146
- osc_bundle_builder.IMMEDIATELY)
147
- msg = osc_message_builder.OscMessageBuilder(address="/SYNC")
148
- msg.add_arg(4.0)
149
- # Add 4 messages in the bundle, each with more arguments.
150
- bundle.add_content(msg.build())
151
- msg.add_arg(2)
152
- bundle.add_content(msg.build())
153
- msg.add_arg("value")
154
- bundle.add_content(msg.build())
155
- msg.add_arg(b"\x01\x02\x03")
156
- bundle.add_content(msg.build())
157
-
158
- sub_bundle = bundle.build()
159
- # Now add the same bundle inside itself.
160
- bundle.add_content(sub_bundle)
161
- # The bundle has 5 elements in total now.
162
-
163
- bundle = bundle.build()
164
- # You can now send it via a client as described in other examples.
165
-
166
- License?
167
- ========
168
- Unlicensed, do what you want with it. (http://unlicense.org)
169
-
170
- Keywords: osc sound midi music
171
- Platform: any
172
- Classifier: Development Status :: 5 - Production/Stable
173
- Classifier: Intended Audience :: Developers
174
- Classifier: License :: Freely Distributable
175
- Classifier: Programming Language :: Python :: 3
176
- Classifier: Topic :: Multimedia :: Sound/Audio
177
- Classifier: Topic :: System :: Networking
178
- Description-Content-Type: text/x-rst
@@ -1,178 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: python-osc
3
- Version: 1.8.1
4
- Summary: Open Sound Control server and client implementations in pure Python
5
- Home-page: https://github.com/attwad/python-osc
6
- Author: attwad
7
- Author-email: tmusoft@gmail.com
8
- License: UNKNOWN
9
- Description: ==========
10
- python-osc
11
- ==========
12
-
13
- Open Sound Control server and client implementations in **pure python** (3.5+).
14
-
15
- .. image:: https://github.com/attwad/python-osc/actions/workflows/python-test.yml/badge.svg
16
- :target: https://github.com/attwad/python-osc/actions/workflows/python-test.yml
17
-
18
-
19
- Current status
20
- ==============
21
-
22
- This library was developed following the
23
- `OpenSoundControl Specification 1.0 <https://opensoundcontrol.stanford.edu/spec-1_0.html>`_
24
- and is currently in a stable state.
25
-
26
- Features
27
- ========
28
-
29
- * UDP blocking/threading/forking/asyncio server implementations
30
- * UDP client
31
- * int, int64, float, string, double, MIDI, timestamps, blob OSC arguments
32
- * simple OSC address<->callback matching system
33
- * extensive unit test coverage
34
- * basic client and server examples
35
-
36
- Documentation
37
- =============
38
-
39
- Available at https://python-osc.readthedocs.io/.
40
-
41
- Installation
42
- ============
43
-
44
- python-osc is a pure python library that has no external dependencies,
45
- to install it just use pip (prefered):
46
-
47
- .. image:: https://img.shields.io/pypi/v/python-osc.svg
48
- :target: https://pypi.python.org/pypi/python-osc
49
-
50
- .. code-block:: bash
51
-
52
- $ pip install python-osc
53
-
54
- or from the raw sources for the development version:
55
-
56
- .. code-block:: bash
57
-
58
- $ python setup.py test
59
- $ python setup.py install
60
-
61
- Examples
62
- ========
63
-
64
- Simple client
65
- -------------
66
-
67
- .. code-block:: python
68
-
69
- """Small example OSC client
70
-
71
- This program sends 10 random values between 0.0 and 1.0 to the /filter address,
72
- waiting for 1 seconds between each value.
73
- """
74
- import argparse
75
- import random
76
- import time
77
-
78
- from pythonosc import udp_client
79
-
80
-
81
- if __name__ == "__main__":
82
- parser = argparse.ArgumentParser()
83
- parser.add_argument("--ip", default="127.0.0.1",
84
- help="The ip of the OSC server")
85
- parser.add_argument("--port", type=int, default=5005,
86
- help="The port the OSC server is listening on")
87
- args = parser.parse_args()
88
-
89
- client = udp_client.SimpleUDPClient(args.ip, args.port)
90
-
91
- for x in range(10):
92
- client.send_message("/filter", random.random())
93
- time.sleep(1)
94
-
95
- Simple server
96
- -------------
97
-
98
- .. code-block:: python
99
-
100
- """Small example OSC server
101
-
102
- This program listens to several addresses, and prints some information about
103
- received packets.
104
- """
105
- import argparse
106
- import math
107
-
108
- from pythonosc.dispatcher import Dispatcher
109
- from pythonosc import osc_server
110
-
111
- def print_volume_handler(unused_addr, args, volume):
112
- print("[{0}] ~ {1}".format(args[0], volume))
113
-
114
- def print_compute_handler(unused_addr, args, volume):
115
- try:
116
- print("[{0}] ~ {1}".format(args[0], args[1](volume)))
117
- except ValueError: pass
118
-
119
- if __name__ == "__main__":
120
- parser = argparse.ArgumentParser()
121
- parser.add_argument("--ip",
122
- default="127.0.0.1", help="The ip to listen on")
123
- parser.add_argument("--port",
124
- type=int, default=5005, help="The port to listen on")
125
- args = parser.parse_args()
126
-
127
- dispatcher = Dispatcher()
128
- dispatcher.map("/filter", print)
129
- dispatcher.map("/volume", print_volume_handler, "Volume")
130
- dispatcher.map("/logvolume", print_compute_handler, "Log volume", math.log)
131
-
132
- server = osc_server.ThreadingOSCUDPServer(
133
- (args.ip, args.port), dispatcher)
134
- print("Serving on {}".format(server.server_address))
135
- server.serve_forever()
136
-
137
- Building bundles
138
- ----------------
139
-
140
- .. code-block:: python
141
-
142
- from pythonosc import osc_bundle_builder
143
- from pythonosc import osc_message_builder
144
-
145
- bundle = osc_bundle_builder.OscBundleBuilder(
146
- osc_bundle_builder.IMMEDIATELY)
147
- msg = osc_message_builder.OscMessageBuilder(address="/SYNC")
148
- msg.add_arg(4.0)
149
- # Add 4 messages in the bundle, each with more arguments.
150
- bundle.add_content(msg.build())
151
- msg.add_arg(2)
152
- bundle.add_content(msg.build())
153
- msg.add_arg("value")
154
- bundle.add_content(msg.build())
155
- msg.add_arg(b"\x01\x02\x03")
156
- bundle.add_content(msg.build())
157
-
158
- sub_bundle = bundle.build()
159
- # Now add the same bundle inside itself.
160
- bundle.add_content(sub_bundle)
161
- # The bundle has 5 elements in total now.
162
-
163
- bundle = bundle.build()
164
- # You can now send it via a client as described in other examples.
165
-
166
- License?
167
- ========
168
- Unlicensed, do what you want with it. (http://unlicense.org)
169
-
170
- Keywords: osc sound midi music
171
- Platform: any
172
- Classifier: Development Status :: 5 - Production/Stable
173
- Classifier: Intended Audience :: Developers
174
- Classifier: License :: Freely Distributable
175
- Classifier: Programming Language :: Python :: 3
176
- Classifier: Topic :: Multimedia :: Sound/Audio
177
- Classifier: Topic :: System :: Networking
178
- Description-Content-Type: text/x-rst
python-osc-1.8.1/setup.py DELETED
@@ -1,41 +0,0 @@
1
- #!/usr/bin/env python
2
-
3
- try:
4
- from setuptools import setup
5
-
6
- test_extras = {
7
- 'test_suite': 'pythonosc.test',
8
- }
9
- except ImportError:
10
- from distutils.core import setup
11
-
12
- test_extras = {}
13
-
14
- setup(
15
- name='python-osc',
16
- version='1.8.1',
17
- author='attwad',
18
- author_email='tmusoft@gmail.com',
19
- description=(
20
- 'Open Sound Control server and client implementations in pure Python'),
21
- long_description=open('README.rst').read(),
22
- long_description_content_type='text/x-rst',
23
- url='https://github.com/attwad/python-osc',
24
- platforms='any',
25
- packages=[
26
- 'pythonosc',
27
- 'pythonosc.parsing',
28
- 'pythonosc.test',
29
- 'pythonosc.test.parsing',
30
- ],
31
- keywords='osc sound midi music',
32
- classifiers=[
33
- 'Development Status :: 5 - Production/Stable',
34
- 'Intended Audience :: Developers',
35
- 'License :: Freely Distributable',
36
- 'Programming Language :: Python :: 3',
37
- 'Topic :: Multimedia :: Sound/Audio',
38
- 'Topic :: System :: Networking',
39
- ],
40
- **test_extras
41
- )
File without changes
File without changes
File without changes