A lightweight terminal-based text editor library for Python
Project description
PyTEdit
A lightweight, fast, terminal-based text editor library for Python. PyTEdit provides a modular and extensible framework for building terminal text editors, similar to nano or micro, but with modern Python features.
Features
- File loading and saving
- Arrow key navigation
- Basic editing (insert, delete, backspace)
- Save & quit shortcuts (
Ctrl+S,Ctrl+Q) - Responsive interface with smooth cursor movement
- Clean, modular code structure
- Can be used as a library or standalone application
Installation
pip install pytedit
Quick Start
Using as a standalone editor
# Launch editor
pytedit
# Open a file
pytedit myfile.txt
Using as a library in your project
from pytedit import Editor, TextBuffer
# Create a custom editor
class MyCustomEditor(Editor):
def __init__(self):
super().__init__()
# Add custom initialization
self.status_message = "My Custom Editor"
def create_key_bindings(self):
kb = super().create_key_bindings()
# Add custom key bindings
@kb.add('c-f')
def _(event):
self.status_message = "Find functionality (custom)"
self.refresh_screen()
return kb
# Run your custom editor
if __name__ == "__main__":
editor = MyCustomEditor()
editor.run()
Architecture
PyTEdit is built around these core components:
- TextBuffer: Manages text content and cursor position
- Editor: Handles input, rendering, and coordinates components
- Key Bindings: Configurable keyboard shortcuts for editor functions
Development Roadmap
- Undo/redo stack
- Syntax highlighting with Pygments
- Line numbers
- Search & replace functionality
- Configurable themes and keybindings
- Multiple file buffers
- Split-screen editing
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
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 pytedit-0.1.1.tar.gz.
File metadata
- Download URL: pytedit-0.1.1.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72ab11954d089b03ad78b82ed649b48d4826a011b14e340e8deccc76bede0d9e
|
|
| MD5 |
1ca2b93d43021b4a7fe459b84325cbbc
|
|
| BLAKE2b-256 |
316e9f4477a55ecad27fc69097d07621b87abc92357ac814c83133e352c888c7
|
File details
Details for the file pytedit-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pytedit-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
416c9dd5a197ba4b170d58353e0ee4fc2b99e9e66b8213b2c57ffa84c0d362cf
|
|
| MD5 |
3413a891513e5182f0eff5d83950b61f
|
|
| BLAKE2b-256 |
deb69f300d3a59124338a4dab26c259fa3cc82e6999fc95eb0e30b6a33fc7e4e
|