F7 is a productivity tool to manipulate strings using python,shell or AI
Project description
F7
I know a command that could do that
F7 is an app to help you manipulate strings fast and easily using Python, the command line, or a local LLM.
Installation
Install using pip:
pip install f7
Or using pipx:
pipx install f7
Setup
Linux
Requirements: xsel on X, wl-clipboard on Wayland.
To create desktop files, run:
f7 register
That will create the main application desktop file and optionally register a startup file.
Next, go to your system's keyboard shortcuts settings (e.g., Settings > Keyboard > Shortcuts > Add Application on KDE or GNOME), and bind the f7 application to your preferred shortcut (e.g., F7 or F4).
You can also try registering the command <f7 path> show instead.
Windows
Run:
f7 register
That will register the startup registry key. The app listens for your configured shortcut. You can change the shortcut using the F7 settings in the tray menu.
macOS
Currently not supported, but may be possible using macOS's Shortcuts app (Shortcuts > + > Shell Script) or Automator.
If you find a way to make it work, feel free to open a PR or reach out!
Usage
-
Select the Text: Highlight any text from any app.
-
Activate F7: Hit your shortcut key.
-
Type Your Transformation:
In the input field, use Python (default), command-line (
$prefix), or LLM (!prefix or suffix).Example using Python:
[l.split()[0] for l in lines]
(This tells the app: for each line, split it into words, and give me the first one.)
Or using Bash:
$cut -f1
(Use
$$cut -f1for live preview.)Live preview will show up as you type:
18109 8679 ... -
Hit Enter: Result is copied to your clipboard.
-
Done! Paste it wherever you want.
Command Line Mode
You could also use $ prefix to run a command (then ctrl+enter to preview), or $$ fix to live-preview:
Local AI (LLM) Setup
Supports two backends: Ollama and Llama.cpp.
1. Ollama Setup
- Install Ollama: ollama.com
- Pull a model: For example:
ollama pull phi3
You can find other available models on the Ollama library website.
-
Configure in App:
- Open F7 settings (
/settingsor tray menu) - Go to AI tab
- Set Backend to
ollama - Set Model Name (e.g.,
phi3)
- Open F7 settings (
2. Llama.cpp Setup:
2. Llama.cpp Setup
-
Download a GGUF model: e.g., from Hugging Face
- Recommended:
Q4_K_M
- Recommended:
-
Configure in App:
- Open F7 settings
- Go to AI tab
- Set Backend to
llama_cpp - Set path to the GGUF model
- Enable GPU if you have one (
llama_cpp_use_GPU)
F7 python
F7 adds a few helpful twists to regular Python to speed things up:
-
Predefined variables:
text(alias:s),lines,words -
Auto-parsed content:
_var will try to parse the text as JSON, Python literal, CSV or base64. -
Forgiving syntax: complete
({[so half-written code like[ l for l in linesworks!
-
List display: Lists show as joined lines (
"\n".join(...)) instead ofrepr(...), so it easier to work with lines. -
Auto-display: Typing
text.upperorurldecodeget output automatically if they match(str) → str, or a method oftext. -
Useful built-ins:
grep("foo")→ likere.search(...)overlinessub("a", "b")→ likere.sub(...)ontext- Other helpers:
entropy,from_base64,from_tsv, etc.
-
Preloaded utils: Things like
lnjoin = "\n".join,urlencode = quote_plus. also there are string formatters likesnake_case,camel_casethat came fromstring_utils
FAQ
F7 key triggers "caret browsing" in Chrome/uim
Unfortunately, Chrome doesn’t let you disable F7. Options:
-
Remap shortcut to something else (e.g.
F4)- Windows:
F7 settings > System > Hotkey - Linux: System Settings > Keyboard Shortcuts
- Use a browser that allows shortcut customization (e.g., Brave, Vivaldi)
- Remap
F7key to something else (e.g. using PowerToys on Windows bind F7 to alt+F7)
- Windows:
F7 key triggers caret browsing in Firefox
If you use caret browsing, consider remapping the shortcut. Otherwise, just click "Do not ask me again" and choose "No". Firefox will remember your choice.
How to report errors/problems/suggestions
please open a GitHub issue
How can I donate you
If you found this app useful, you can buy me a coffee:
Project details
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 f7-0.1.1.tar.gz.
File metadata
- Download URL: f7-0.1.1.tar.gz
- Upload date:
- Size: 50.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.3 Linux/6.14.9-300.fc42.x86_64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bddc6a7a2795c37df5f137bdb4ed6c36d22a2d6d78aa1a1072524a5da68841e
|
|
| MD5 |
77007d7fa01e50a0193ca0ecf00d0dcf
|
|
| BLAKE2b-256 |
4a7b42dbb006e6a13d0bb784fe0d2d8e372c4644b943285ccb2309956670a161
|
File details
Details for the file f7-0.1.1-py3-none-any.whl.
File metadata
- Download URL: f7-0.1.1-py3-none-any.whl
- Upload date:
- Size: 57.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.3 Linux/6.14.9-300.fc42.x86_64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60bdcc64becd1a2ca1ed7cc8c5b3c31a27571a478be895d55db973a713556f94
|
|
| MD5 |
2baf9a130d82138c7791b17b0dca6465
|
|
| BLAKE2b-256 |
9646cb0228381755a2f41779ecd118a4db80434f88afad556222e8b494c2dadd
|