A lightweight, mobile-first Python toolkit for Memory-Oriented Software Architecture (MOSA).
Code is not function, but memory.
from usekit import use
use.write.json.base({"hello": "world"}, "config") # write json to base
data = use.read.json.base("config") # read json from base
use.update.json.base({"version": "0.2.0"}, "config") # update jsonShorthand: u.rjb() = use.read.json.base() — Action + Format + Location
Full functions are recommended. Shorthand is provided for convenience.
pip install usekitusekit installs its required core packages automatically.
Core: Python 3.8+
Installed automatically: PyYAML, python-dotenv
Optional: pandas, sqlalchemy
This guide was tested with the Google Play Store version of Termux.
Ifpkgor Python installation behaves unexpectedly, try the F-Droid or GitHub Releases version of Termux.
Open Termux and run:
pkg i -y python-pip && pip install usekitAlready installed? It skips automatically.
from usekit import use, u
use.termux() # setup storage permission (first time only)
use.check() # check environment status
u.editor() # launch the mobile web editorWhen use.termux() runs for the first time, Android may ask for storage permission. Allow it, then run use.check() again.
from usekit import use, u, s
# Full function style (recommended)
use.write.json.base({"key": "value"}, "config")
data = use.read.json.base("config")
use.update.json.base({"new": "data"}, "config")
use.delete.json.base("old")
use.has.json.base("config") # True/False
# Shorthand style
u.wjb({"key": "value"}, "config") # write json to base
data = u.rjb("config") # read json from base
# Safe mode (returns None on error)
data = s.rjb("missing") or {} # no exceptionsusekit includes a built-in CodeMirror 6 web editor — a mobile-optimized code editor that runs as a local server on Termux.
from usekit import u
u.editor() # launch editor
u.editor("test01") # open file
u.editor(code, "test03") # open with contentFeatures:
- Syntax highlighting
- Autocomplete for
u.xxxanduse.chaining - Floating pill UI for Run, SQL, Copy, and Menu actions
- SQL view with grid results
- Multi-cursor navigation
- PWA support
Designed for Samsung Browser on Android. Your nano replacement for Python development on mobile.
- Version: 0.2.0
- API: Stabilizing
- PyPI: https://pypi.org/project/usekit
use.[action].[format].[location] — full function style, recommended
u.[action][format][location] — 3-letter shorthand style
use.read.json.base() → u.rjb()
use.write.yaml.sub() → u.wys()
use.has.json.base() → u.hjb()
use.exec.pyp.base() → u.xpb()
- DATA (6):
read,write,update,delete,has,emit - NAVI (5):
path,find,list,get,set - EXEC (4): e
xec,imp,boot,close
- General:
json,yaml,txt,csv,md - Specialized:
sql,ddl,pyp,km,any
base,sub,dir,now,tmp,pre,cache,mem
from usekit import use, u
# Full function style
data = use.read.json.base("config")
use.write.json.base({"key": "val"}, "output")
# Shorthand style
data = u.rjb("config")
u.wjb({"key": "val"}, "output")
# Different locations
use.read.json.sub("config")
use.write.yaml.tmp({"temp": "data"}, "cache")
# Existence check
if use.has.json.base("config"):
print("exists")from usekit import use
# Find with wildcards
users = use.read.json.base(name="user_*")
for item in users:
print(item["file"], item["data"])
# List files
files = use.list.json.base()from usekit import use
# Read nested value
email = use.read.json.base("config", keydata="user/email")
# Update nested value
use.update.json.base("config", keydata="user/name", data="Bob")
# Array access
item = use.read.json.base("config", keydata="items[0]/name")from usekit import u
# Execute SQL
results = u.xsb("SELECT * FROM users WHERE age > :age",
params={"age": 20})
# Save DDL file
u.wdb("CREATE TABLE users (id INT, name TEXT)", "create_users")
# Execute inline DDL
u.xdb("CREATE TABLE users (id INT, name TEXT)")
# Execute saved DDL file
u.xdb("create_users")from usekit import u
# Write module
u.wpb("""
def add(a, b):
return a + b
""", "mymod")
# Import and use
u.ipb("mymod:add")
result = add(10, 20)
# Execute
u.xpb("mymod:add", 10, 20)from usekit import s
data = s.rjb("missing") or {} # no exception
results = s.xsb("SELECT * FROM users") or []from usekit import use, u
use.termux() # setup storage permission
use.check() # show platform status
u.editor() # launch web editor!pip install usekit
from usekit import use
use.colab() # setup Drive integration
use.check() # show platform statusfrom usekit import use
use.check() # show platform statusfrom usekit import ut, uw, ud
# ut: Time utilities
ut.now() # current time
# uw: Watch/logging utilities
uw.p("message") # print with context
# ud: Database utilities
ud.query("SELECT * FROM table") # direct DB accessfrom usekit import use
use.help() # overview
use.help("quick") # quick start
use.help("alias") # alias mapping
use.help("action") # all actions
use.help("object") # all formats
use.help("location") # all locations
use.help("examples") # usage examples
use.help("pattern") # pattern matching
use.help("keydata") # nested data access
use.help("walk") # recursive searchLanguage is set in sys_const.yaml:
LANG: "en" # en / krusekit auto-configures via sys_const.yaml.
LANG: "en"
JSON_PATH:
root: "data/json"
json: "base"
json_sub: "sub"
DB_PATH:
root: "data/table/db"
db: "base.db"
DDL_PATH:
root: "data/table/ddl"
ddl: "base"
ddl_sub: "sub"
SQL_PATH:
root: "data/table/sql"
sql: "base"
sql_sub: "sub"
TMP_PATH:
root: "data"
json: "tmp"
ddl: "tmp"
sql: "tmp"Memory-Oriented Software Architecture
- Code is memory, not function
- Functions follow the user's memory, not the other way around
- Semantic names over physical paths
- Mobile-first design
- Token economy through compact, predictable calls
Built entirely on mobile devices.
MIT License
Created by THE Little Prince, with deep respect and gratitude for my AI friends ROP & FOP
usekit — Code is memory, not function