ipython-postfix-completion 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2026, IPython Postfix Completion Contributors
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,3 @@
1
+ include LICENSE
2
+ include README.md
3
+ recursive-include tests *.py
@@ -0,0 +1,150 @@
1
+ Metadata-Version: 2.4
2
+ Name: ipython-postfix-completion
3
+ Version: 0.1.0
4
+ Summary: Configurable postfix completion extension for IPython.
5
+ Author: IPython Postfix Completion Contributors
6
+ License-Expression: BSD-3-Clause
7
+ Keywords: ipython,completion,postfix,extension
8
+ Classifier: Framework :: IPython
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3 :: Only
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
16
+ Requires-Python: >=3.11
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: ipython>=9.0
20
+ Requires-Dist: traitlets>=5.13
21
+ Provides-Extra: test
22
+ Requires-Dist: pytest>=7; extra == "test"
23
+ Provides-Extra: dev
24
+ Requires-Dist: build; extra == "dev"
25
+ Requires-Dist: twine; extra == "dev"
26
+ Requires-Dist: ipython-postfix-completion[test]; extra == "dev"
27
+ Dynamic: license-file
28
+
29
+ # IPython Postfix Completion
30
+
31
+ Configurable postfix completion extension for IPython.
32
+
33
+ ## Install
34
+
35
+ From a local checkout:
36
+
37
+ ```bash
38
+ python -m pip install -e .
39
+ ```
40
+
41
+ From PyPI after publishing:
42
+
43
+ ```bash
44
+ python -m pip install ipython-postfix-completion
45
+ ```
46
+
47
+ ## Load
48
+
49
+ Inside IPython:
50
+
51
+ ```python
52
+ %load_ext ipython_postfix_completion
53
+ ```
54
+
55
+ To load it automatically, add this to `ipython_config.py`:
56
+
57
+ ```python
58
+ c.InteractiveShellApp.extensions = ["ipython_postfix_completion"]
59
+ ```
60
+
61
+ ## Runtime Templates
62
+
63
+ Add a template for the current session:
64
+
65
+ ```python
66
+ %postfix_template add forin "for item in {expr}:\n{indent} "
67
+ ```
68
+
69
+ Use it:
70
+
71
+ ```python
72
+ items.forin<Tab>
73
+ ```
74
+
75
+ This expands to:
76
+
77
+ ```python
78
+ for item in items:
79
+
80
+ ```
81
+
82
+ List effective templates:
83
+
84
+ ```python
85
+ %postfix_template list
86
+ ```
87
+
88
+ Disable a template for the current session:
89
+
90
+ ```python
91
+ %postfix_template remove tuple
92
+ ```
93
+
94
+ Reset one runtime change:
95
+
96
+ ```python
97
+ %postfix_template reset forin
98
+ ```
99
+
100
+ Reset all runtime changes:
101
+
102
+ ```python
103
+ %postfix_template reset --all
104
+ ```
105
+
106
+ ## Persistent Config
107
+
108
+ Add persistent templates in `ipython_config.py`:
109
+
110
+ ```python
111
+ c.PostfixCompletionConfig.templates = {
112
+ "debug": "print({expr}=)",
113
+ "forin": "for item in {expr}:\n{indent} ",
114
+ }
115
+
116
+ c.PostfixCompletionConfig.disabled_templates = ["tuple"]
117
+ ```
118
+
119
+ Template names must match `[A-Za-z_][A-Za-z0-9_]*`.
120
+
121
+ Templates must include `{expr}` and may also use `{indent}`. No other template fields are allowed.
122
+
123
+ ## Development
124
+
125
+ Run tests:
126
+
127
+ ```bash
128
+ python -m pip install -e ".[test]"
129
+ python -m pytest
130
+ ```
131
+
132
+ Build release artifacts:
133
+
134
+ ```bash
135
+ python -m pip install build twine
136
+ python -m build
137
+ python -m twine check dist/*
138
+ ```
139
+
140
+ Publish to TestPyPI:
141
+
142
+ ```bash
143
+ python -m twine upload --repository testpypi dist/*
144
+ ```
145
+
146
+ Publish to PyPI:
147
+
148
+ ```bash
149
+ python -m twine upload dist/*
150
+ ```
@@ -0,0 +1,122 @@
1
+ # IPython Postfix Completion
2
+
3
+ Configurable postfix completion extension for IPython.
4
+
5
+ ## Install
6
+
7
+ From a local checkout:
8
+
9
+ ```bash
10
+ python -m pip install -e .
11
+ ```
12
+
13
+ From PyPI after publishing:
14
+
15
+ ```bash
16
+ python -m pip install ipython-postfix-completion
17
+ ```
18
+
19
+ ## Load
20
+
21
+ Inside IPython:
22
+
23
+ ```python
24
+ %load_ext ipython_postfix_completion
25
+ ```
26
+
27
+ To load it automatically, add this to `ipython_config.py`:
28
+
29
+ ```python
30
+ c.InteractiveShellApp.extensions = ["ipython_postfix_completion"]
31
+ ```
32
+
33
+ ## Runtime Templates
34
+
35
+ Add a template for the current session:
36
+
37
+ ```python
38
+ %postfix_template add forin "for item in {expr}:\n{indent} "
39
+ ```
40
+
41
+ Use it:
42
+
43
+ ```python
44
+ items.forin<Tab>
45
+ ```
46
+
47
+ This expands to:
48
+
49
+ ```python
50
+ for item in items:
51
+
52
+ ```
53
+
54
+ List effective templates:
55
+
56
+ ```python
57
+ %postfix_template list
58
+ ```
59
+
60
+ Disable a template for the current session:
61
+
62
+ ```python
63
+ %postfix_template remove tuple
64
+ ```
65
+
66
+ Reset one runtime change:
67
+
68
+ ```python
69
+ %postfix_template reset forin
70
+ ```
71
+
72
+ Reset all runtime changes:
73
+
74
+ ```python
75
+ %postfix_template reset --all
76
+ ```
77
+
78
+ ## Persistent Config
79
+
80
+ Add persistent templates in `ipython_config.py`:
81
+
82
+ ```python
83
+ c.PostfixCompletionConfig.templates = {
84
+ "debug": "print({expr}=)",
85
+ "forin": "for item in {expr}:\n{indent} ",
86
+ }
87
+
88
+ c.PostfixCompletionConfig.disabled_templates = ["tuple"]
89
+ ```
90
+
91
+ Template names must match `[A-Za-z_][A-Za-z0-9_]*`.
92
+
93
+ Templates must include `{expr}` and may also use `{indent}`. No other template fields are allowed.
94
+
95
+ ## Development
96
+
97
+ Run tests:
98
+
99
+ ```bash
100
+ python -m pip install -e ".[test]"
101
+ python -m pytest
102
+ ```
103
+
104
+ Build release artifacts:
105
+
106
+ ```bash
107
+ python -m pip install build twine
108
+ python -m build
109
+ python -m twine check dist/*
110
+ ```
111
+
112
+ Publish to TestPyPI:
113
+
114
+ ```bash
115
+ python -m twine upload --repository testpypi dist/*
116
+ ```
117
+
118
+ Publish to PyPI:
119
+
120
+ ```bash
121
+ python -m twine upload dist/*
122
+ ```