Configurable postfix completion extension for IPython.
Project description
IPython Postfix Completion
Configurable postfix completion extension for IPython.
Install
From a local checkout:
python -m pip install -e .
From PyPI after publishing:
python -m pip install ipython-postfix-completion
Load
Inside IPython:
%load_ext ipython_postfix_completion
To load it automatically, add this to ipython_config.py:
c.InteractiveShellApp.extensions = ["ipython_postfix_completion"]
Runtime Templates
Add a template for the current session:
%postfix_template add forin "for item in {expr}:\n{indent} "
Use it:
items.forin<Tab>
This expands to:
for item in items:
List effective templates:
%postfix_template list
Disable a template for the current session:
%postfix_template remove tuple
Reset one runtime change:
%postfix_template reset forin
Reset all runtime changes:
%postfix_template reset --all
Persistent Config
Add persistent templates in ipython_config.py:
c.PostfixCompletionConfig.templates = {
"debug": "print({expr}=)",
"forin": "for item in {expr}:\n{indent} ",
}
c.PostfixCompletionConfig.disabled_templates = ["tuple"]
Template names must match [A-Za-z_][A-Za-z0-9_]*.
Templates must include {expr} and may also use {indent}. No other template fields are allowed.
Development
Run tests:
python -m pip install -e ".[test]"
python -m pytest
Build release artifacts:
python -m pip install build twine
python -m build
python -m twine check dist/*
Publish to TestPyPI:
python -m twine upload --repository testpypi dist/*
Publish to PyPI:
python -m twine upload dist/*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ipython_postfix_completion-0.1.0.tar.gz.
File metadata
- Download URL: ipython_postfix_completion-0.1.0.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bd9b3023c0e9482814d25a7da316b4e12c8a20a50832efd4cf8f7ff6e21fbc8
|
|
| MD5 |
01aec54399c8c8333f4f81be8e8a0d5a
|
|
| BLAKE2b-256 |
9b955bd40b5eca503767894c9edd15e358e580bbc58605cf02135dace173a807
|
File details
Details for the file ipython_postfix_completion-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ipython_postfix_completion-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c10c36f542492d75f0dd42bbbc60172b704fab0015f34c4445ed794370bba5a8
|
|
| MD5 |
89dc848c1e5d1d01a43963f2f2f897dc
|
|
| BLAKE2b-256 |
925fa5b09ef7b3574d161ebb25d511831badabbc624e2375cb56f96a778d2e67
|