py2max 0.2.1__py3-none-any.whl

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 (48) hide show
  1. py2max/__init__.py +67 -0
  2. py2max/__main__.py +6 -0
  3. py2max/cli.py +1251 -0
  4. py2max/core/__init__.py +39 -0
  5. py2max/core/abstract.py +146 -0
  6. py2max/core/box.py +231 -0
  7. py2max/core/common.py +19 -0
  8. py2max/core/patcher.py +1658 -0
  9. py2max/core/patchline.py +68 -0
  10. py2max/exceptions.py +385 -0
  11. py2max/export/__init__.py +20 -0
  12. py2max/export/converters.py +345 -0
  13. py2max/export/svg.py +393 -0
  14. py2max/layout/__init__.py +26 -0
  15. py2max/layout/base.py +463 -0
  16. py2max/layout/flow.py +405 -0
  17. py2max/layout/grid.py +374 -0
  18. py2max/layout/matrix.py +628 -0
  19. py2max/log.py +338 -0
  20. py2max/maxref/__init__.py +78 -0
  21. py2max/maxref/category.py +163 -0
  22. py2max/maxref/db.py +1082 -0
  23. py2max/maxref/legacy.py +324 -0
  24. py2max/maxref/parser.py +703 -0
  25. py2max/py.typed +0 -0
  26. py2max/server/__init__.py +54 -0
  27. py2max/server/client.py +295 -0
  28. py2max/server/inline.py +312 -0
  29. py2max/server/repl.py +561 -0
  30. py2max/server/rpc.py +240 -0
  31. py2max/server/websocket.py +997 -0
  32. py2max/static/cola.min.js +4 -0
  33. py2max/static/d3.v7.min.js +2 -0
  34. py2max/static/dagre-bundle.js +328 -0
  35. py2max/static/elk.bundled.js +6663 -0
  36. py2max/static/index.html +168 -0
  37. py2max/static/interactive.html +589 -0
  38. py2max/static/interactive.js +2111 -0
  39. py2max/static/live-preview.js +324 -0
  40. py2max/static/svg.min.js +13 -0
  41. py2max/static/svg.min.js.map +1 -0
  42. py2max/transformers.py +168 -0
  43. py2max/utils.py +83 -0
  44. py2max-0.2.1.dist-info/METADATA +390 -0
  45. py2max-0.2.1.dist-info/RECORD +48 -0
  46. py2max-0.2.1.dist-info/WHEEL +4 -0
  47. py2max-0.2.1.dist-info/entry_points.txt +3 -0
  48. py2max-0.2.1.dist-info/licenses/LICENSE +19 -0
py2max/__init__.py ADDED
@@ -0,0 +1,67 @@
1
+ """py2max: A pure Python library for offline generation of Max/MSP patcher files.
2
+
3
+ py2max provides a Python object model that mirrors Max's patch organization with
4
+ round-trip conversion capabilities. It enables programmatic creation of Max/MSP
5
+ patches (.maxpat) files.
6
+
7
+ Main Classes:
8
+ Patcher: Core class for creating and managing Max patches
9
+ Box: Represents individual Max objects (oscillators, effects, etc.)
10
+ Patchline: Represents connections between objects
11
+ MaxRefDB: SQLite database for Max object reference data
12
+
13
+ Exceptions:
14
+ Py2MaxError: Base exception for all py2max errors
15
+ InvalidConnectionError: Exception raised for invalid connections
16
+ InvalidObjectError: Exception raised for invalid object configuration
17
+ InvalidPatchError: Exception raised for invalid patcher state
18
+ PatcherIOError: Exception raised for file I/O errors
19
+ MaxRefError: Exception raised for MaxRef XML parsing errors
20
+ LayoutError: Exception raised for layout manager errors
21
+ DatabaseError: Exception raised for database errors
22
+
23
+ Example:
24
+ >>> from py2max import Patcher
25
+ >>> p = Patcher('my-patch.maxpat')
26
+ >>> osc = p.add_textbox('cycle~ 440')
27
+ >>> gain = p.add_textbox('gain~')
28
+ >>> dac = p.add_textbox('ezdac~')
29
+ >>> p.add_line(osc, gain)
30
+ >>> p.add_line(gain, dac)
31
+ >>> p.to_svg('/tmp/preview.svg') # Export to SVG
32
+ >>> p.save()
33
+ """
34
+
35
+ __version__ = "0.2.1"
36
+
37
+ from .core import Box, Patcher, Patchline
38
+ from .maxref import MaxRefDB
39
+ from .exceptions import (
40
+ DatabaseError,
41
+ InvalidConnectionError,
42
+ InvalidObjectError,
43
+ InvalidPatchError,
44
+ LayoutError,
45
+ MaxRefError,
46
+ PatcherIOError,
47
+ Py2MaxError,
48
+ )
49
+
50
+ __all__ = [
51
+ # Version
52
+ "__version__",
53
+ # Core classes
54
+ "Patcher",
55
+ "Box",
56
+ "Patchline",
57
+ "MaxRefDB",
58
+ # Exceptions
59
+ "Py2MaxError",
60
+ "InvalidConnectionError",
61
+ "InvalidObjectError",
62
+ "InvalidPatchError",
63
+ "PatcherIOError",
64
+ "MaxRefError",
65
+ "LayoutError",
66
+ "DatabaseError",
67
+ ]
py2max/__main__.py ADDED
@@ -0,0 +1,6 @@
1
+ """py2max command line entry point."""
2
+
3
+ from .cli import main
4
+
5
+ if __name__ == "__main__":
6
+ raise SystemExit(main())