pychannellib 1.0.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.
@@ -0,0 +1,56 @@
1
+ PyChannels Custom License
2
+
3
+ Copyright (c) 2026 GRAND
4
+
5
+ 1. Permission to Use
6
+
7
+ Permission is granted to use PyChannels, in whole or in part, in personal,
8
+ educational, non-commercial, and commercial projects without requiring credit
9
+ to the original author, provided that the conditions below are followed.
10
+
11
+ 2. Commercial Use
12
+
13
+ PyChannels may be included in commercial software and commercial projects
14
+ without requiring attribution to the original author.
15
+
16
+ 3. Ownership and Claiming
17
+
18
+ You may not claim PyChannels, its original source code, or the original work
19
+ as your own.
20
+
21
+ You may not misrepresent the original PyChannels package or its original
22
+ source code as having been created by you or another party.
23
+
24
+ 4. Republishing
25
+
26
+ You may not republish, redistribute, or release PyChannels itself, substantially
27
+ unchanged, under another name or as your own package.
28
+
29
+ You may, however, build upon, modify, extend, or incorporate PyChannels into
30
+ another project.
31
+
32
+ 5. Derivative Works
33
+
34
+ You may modify, extend, or build upon the PyChannels source code.
35
+
36
+ If you distribute a work that contains or is substantially based on
37
+ PyChannels source code, you MUST give clear credit to PyChannels and GRAND
38
+ as the original author.
39
+
40
+ This requirement does not apply to software that merely uses PyChannels
41
+ as an external dependency or library.
42
+
43
+ For example, a commercial application that imports and uses PyChannels
44
+ does not require attribution. A modified version of PyChannels or a project
45
+ whose code is substantially based on PyChannels does require attribution.
46
+
47
+ 6. No Warranty
48
+
49
+ PyChannels is provided "AS IS", without warranty of any kind, express or
50
+ implied. The author shall not be held liable for any damages, claims, or
51
+ other liability arising from the use of the software.
52
+
53
+ 7. Acceptance
54
+
55
+ By using, modifying, incorporating, or distributing PyChannels, you agree to
56
+ the terms of this license.
@@ -0,0 +1,83 @@
1
+ Metadata-Version: 2.4
2
+ Name: pychannellib
3
+ Version: 1.0.0
4
+ Summary: A simple Python event call and creation system.
5
+ Author: GRAND
6
+ License: PyChannels Custom License
7
+
8
+ Copyright (c) 2026 GRAND
9
+
10
+ 1. Permission to Use
11
+
12
+ Permission is granted to use PyChannels, in whole or in part, in personal,
13
+ educational, non-commercial, and commercial projects without requiring credit
14
+ to the original author, provided that the conditions below are followed.
15
+
16
+ 2. Commercial Use
17
+
18
+ PyChannels may be included in commercial software and commercial projects
19
+ without requiring attribution to the original author.
20
+
21
+ 3. Ownership and Claiming
22
+
23
+ You may not claim PyChannels, its original source code, or the original work
24
+ as your own.
25
+
26
+ You may not misrepresent the original PyChannels package or its original
27
+ source code as having been created by you or another party.
28
+
29
+ 4. Republishing
30
+
31
+ You may not republish, redistribute, or release PyChannels itself, substantially
32
+ unchanged, under another name or as your own package.
33
+
34
+ You may, however, build upon, modify, extend, or incorporate PyChannels into
35
+ another project.
36
+
37
+ 5. Derivative Works
38
+
39
+ You may modify, extend, or build upon the PyChannels source code.
40
+
41
+ If you distribute a work that contains or is substantially based on
42
+ PyChannels source code, you MUST give clear credit to PyChannels and GRAND
43
+ as the original author.
44
+
45
+ This requirement does not apply to software that merely uses PyChannels
46
+ as an external dependency or library.
47
+
48
+ For example, a commercial application that imports and uses PyChannels
49
+ does not require attribution. A modified version of PyChannels or a project
50
+ whose code is substantially based on PyChannels does require attribution.
51
+
52
+ 6. No Warranty
53
+
54
+ PyChannels is provided "AS IS", without warranty of any kind, express or
55
+ implied. The author shall not be held liable for any damages, claims, or
56
+ other liability arising from the use of the software.
57
+
58
+ 7. Acceptance
59
+
60
+ By using, modifying, incorporating, or distributing PyChannels, you agree to
61
+ the terms of this license.
62
+ Keywords: channels,events,triggers,keybinds,keyboard
63
+ Classifier: Development Status :: 5 - Production/Stable
64
+ Classifier: Intended Audience :: Developers
65
+ Classifier: Programming Language :: Python :: 3
66
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
67
+ Requires-Python: >=3.9
68
+ Description-Content-Type: text/markdown
69
+ License-File: LICENSE
70
+ Requires-Dist: keyboard
71
+ Dynamic: license-file
72
+
73
+ # PyChannels
74
+
75
+ PyChannels is a lightweight Python library for connecting inputs and triggers to executable Python code.
76
+
77
+ ## The Channel Concept
78
+
79
+ A **Channel** is a link between a keybind (the key used to start the code) and a Container (the code).
80
+
81
+ ```text
82
+ Keybind ───── Channel ───── Container
83
+ "space" Python code
@@ -0,0 +1,11 @@
1
+ # PyChannels
2
+
3
+ PyChannels is a lightweight Python library for connecting inputs and triggers to executable Python code.
4
+
5
+ ## The Channel Concept
6
+
7
+ A **Channel** is a link between a keybind (the key used to start the code) and a Container (the code).
8
+
9
+ ```text
10
+ Keybind ───── Channel ───── Container
11
+ "space" Python code
@@ -0,0 +1,83 @@
1
+ Metadata-Version: 2.4
2
+ Name: pychannellib
3
+ Version: 1.0.0
4
+ Summary: A simple Python event call and creation system.
5
+ Author: GRAND
6
+ License: PyChannels Custom License
7
+
8
+ Copyright (c) 2026 GRAND
9
+
10
+ 1. Permission to Use
11
+
12
+ Permission is granted to use PyChannels, in whole or in part, in personal,
13
+ educational, non-commercial, and commercial projects without requiring credit
14
+ to the original author, provided that the conditions below are followed.
15
+
16
+ 2. Commercial Use
17
+
18
+ PyChannels may be included in commercial software and commercial projects
19
+ without requiring attribution to the original author.
20
+
21
+ 3. Ownership and Claiming
22
+
23
+ You may not claim PyChannels, its original source code, or the original work
24
+ as your own.
25
+
26
+ You may not misrepresent the original PyChannels package or its original
27
+ source code as having been created by you or another party.
28
+
29
+ 4. Republishing
30
+
31
+ You may not republish, redistribute, or release PyChannels itself, substantially
32
+ unchanged, under another name or as your own package.
33
+
34
+ You may, however, build upon, modify, extend, or incorporate PyChannels into
35
+ another project.
36
+
37
+ 5. Derivative Works
38
+
39
+ You may modify, extend, or build upon the PyChannels source code.
40
+
41
+ If you distribute a work that contains or is substantially based on
42
+ PyChannels source code, you MUST give clear credit to PyChannels and GRAND
43
+ as the original author.
44
+
45
+ This requirement does not apply to software that merely uses PyChannels
46
+ as an external dependency or library.
47
+
48
+ For example, a commercial application that imports and uses PyChannels
49
+ does not require attribution. A modified version of PyChannels or a project
50
+ whose code is substantially based on PyChannels does require attribution.
51
+
52
+ 6. No Warranty
53
+
54
+ PyChannels is provided "AS IS", without warranty of any kind, express or
55
+ implied. The author shall not be held liable for any damages, claims, or
56
+ other liability arising from the use of the software.
57
+
58
+ 7. Acceptance
59
+
60
+ By using, modifying, incorporating, or distributing PyChannels, you agree to
61
+ the terms of this license.
62
+ Keywords: channels,events,triggers,keybinds,keyboard
63
+ Classifier: Development Status :: 5 - Production/Stable
64
+ Classifier: Intended Audience :: Developers
65
+ Classifier: Programming Language :: Python :: 3
66
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
67
+ Requires-Python: >=3.9
68
+ Description-Content-Type: text/markdown
69
+ License-File: LICENSE
70
+ Requires-Dist: keyboard
71
+ Dynamic: license-file
72
+
73
+ # PyChannels
74
+
75
+ PyChannels is a lightweight Python library for connecting inputs and triggers to executable Python code.
76
+
77
+ ## The Channel Concept
78
+
79
+ A **Channel** is a link between a keybind (the key used to start the code) and a Container (the code).
80
+
81
+ ```text
82
+ Keybind ───── Channel ───── Container
83
+ "space" Python code
@@ -0,0 +1,11 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ pychannellib.egg-info/PKG-INFO
5
+ pychannellib.egg-info/SOURCES.txt
6
+ pychannellib.egg-info/dependency_links.txt
7
+ pychannellib.egg-info/requires.txt
8
+ pychannellib.egg-info/top_level.txt
9
+ pychannels/__init__.py
10
+ pychannels/pychannels.py
11
+ tests/test.py
@@ -0,0 +1 @@
1
+ keyboard
@@ -0,0 +1 @@
1
+ pychannels
@@ -0,0 +1,3 @@
1
+ from .pychannels import channels, triggers
2
+
3
+ func = None
@@ -0,0 +1,74 @@
1
+ import keyboard as k
2
+ import inspect
3
+
4
+ keybinds = {}
5
+ triggersl = {}
6
+ listen = None
7
+ func = None
8
+
9
+ class channels:
10
+ def assign(key, func):
11
+ context = inspect.currentframe().f_back.f_globals
12
+ keybinds[key] = (func, context)
13
+
14
+ def unassign(key):
15
+ keybinds[key] = None
16
+
17
+ def read(key):
18
+ return keybinds[key][0]
19
+
20
+ def listen():
21
+ global listen
22
+ while listen == True:
23
+ event = k.read_event()
24
+
25
+ if event.event_type == "down":
26
+ if event.name in keybinds:
27
+ code, context = keybinds[event.name]
28
+ exec(code, context)
29
+
30
+ def setListen(bl):
31
+ global listen
32
+ listen = bl
33
+ channels.listen()
34
+
35
+ def waitFor(key):
36
+ k.wait(key)
37
+ code, context = keybinds[key]
38
+ exec(code, context)
39
+
40
+ def readFunc():
41
+ return func
42
+
43
+ def clear():
44
+ global keybinds
45
+ keybinds = {}
46
+
47
+ class triggers:
48
+ def assign(name, code):
49
+ context = inspect.currentframe().f_back.f_globals
50
+ triggersl[name] = (code, context)
51
+
52
+ def read(name):
53
+ return triggersl[name][0]
54
+
55
+ def trigger(name):
56
+ if name not in triggersl:
57
+ raise KeyError(f"Trigger '{name}' does not exist")
58
+
59
+ if triggersl[name] is None:
60
+ return
61
+
62
+ code, context = triggersl[name]
63
+ exec(code, context)
64
+
65
+ def unassign(name):
66
+ if name in triggersl:
67
+ del triggersl[name]
68
+
69
+ def clear():
70
+ global triggersl
71
+ triggersl = {}
72
+
73
+ def returnValue(name):
74
+ return exec(triggersl[name])
@@ -0,0 +1,26 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77.0.3"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "pychannellib"
7
+ version = "1.0.0"
8
+ description = "A simple Python event call and creation system."
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = {file = "LICENSE"}
12
+ authors = [
13
+ {name = "GRAND"}
14
+ ]
15
+ keywords = ["channels", "events", "triggers", "keybinds", "keyboard"]
16
+
17
+ dependencies = [
18
+ "keyboard"
19
+ ]
20
+
21
+ classifiers = [
22
+ "Development Status :: 5 - Production/Stable",
23
+ "Intended Audience :: Developers",
24
+ "Programming Language :: Python :: 3",
25
+ "Topic :: Software Development :: Libraries :: Python Modules"
26
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,13 @@
1
+ import pychannels as p
2
+
3
+ p.func = """
4
+ print("test success")
5
+ """
6
+
7
+ p.channels.readFunc()
8
+
9
+ p.channels.assign("space", p.func)
10
+
11
+ print(p.channels.read("space"))
12
+
13
+ p.channels.setListen(True)