Skip to main content

Minimal input, auto path toolkit (mobile-first, Colab+Drive)

Project description

usekit

A lightweight, mobile-first Python toolkit for Memory-Oriented Software Architecture (MOSA).

Code is not function, but memory.

from usekit import u

u.wjb({"hello": "world"}, "config")     # write json to base
data = u.rjb("config")                  # read json from base
u.ujb({"version": "0.1.2"}, "config")   # update json

3-letter interface: Verb + Format + Location
Minimal typing. Maximum clarity.


Installation

pip install usekit

Quick Start

from usekit import u, s

# Basic operations
u.wjb({"key": "value"}, "config")       # write
data = u.rjb("config")                  # read
u.ujb({"new": "data"}, "config")        # update
u.djb("old")                            # delete

# Safe mode (returns None on error)
data = s.rjb("missing") or {}           # no exceptions

Status


Core Pattern

3-Letter Interface

u.[action][format][location]

u.rjb()  →  read json base
u.wys()  →  write yaml sub
u.dtb()  →  delete text base

Actions

  • DATA: read, write, update, delete, exists
  • NAVI: find, list, path
  • EXEC: exec, imp (import)

Formats

  • Basic: json, yaml, txt, csv, md
  • Advanced: sql, ddl, pyp, any

Locations

  • base, sub, tmp, now, dir, cache

Examples

File Operations

# JSON
data = u.rjb("config")
u.wjb({"key": "val"}, "output")

# Different locations
u.rjs("config")                         # read json sub
u.wyt({"temp": "data"}, "cache")        # write yaml tmp

Pattern Matching

# Find with wildcards
users = u.fjb("user_*")
for item in users:
    print(item["file"], item["data"])

# List files
files = u.ljb()                         # list all json in base

SQL & DDL

# Execute SQL
results = u.xsb("SELECT * FROM users WHERE age > :age", 
                params={"age": 20})

# DDL with auto table name
u.wdb("CREATE TABLE users (id INT, name TEXT)")
# → creates users.sql

# Dict to DDL
u.wdb({
    "table": "products",
    "records": [{"id": 1, "name": "Apple"}]
})
# → creates products.sql with CREATE + INSERT

Python Import

# Write module
u.wpb("""
def add(a, b):
    return a + b
""", "mymod")

# Import and use
u.ipd("mymod : add")
result = add(10, 20)                    # auto-injected

Safe Mode

from usekit import s

data = s.rjb("missing") or {}           # no exception
results = s.xsb("SELECT * FROM users") or []

Google Colab

from google.colab import drive
drive.mount("/content/drive")

!pip install usekit
from usekit import u, s

data = "work_path = /content/drive/MyDrive/PROJECT"
u.wtd(data, "output")
print(u.rtd("output"))
print(u.ftd("output"))

# SQLite3
s.xdb("CREATE TABLE items (id INT, name TEXT)")
s.xsb("INSERT INTO items VALUES (?, ?)", pa=[(1, "apple")])
results = u.xsb("SELECT * FROM items")
print(results[0].id)

Configuration

usekit auto-configures via sys_const.yaml:

BASE_PATH: /content/drive/MyDrive/PROJECT

DATA_PATH:
  root: data
  json: json/json_main
  sql: table/sql/sql_main
  ddl: table/ddl/ddl_main

SYS_PATH:
  tmp: data/tmp
  cache: data/.cache

Philosophy: MOSA

Memory-Oriented Software Architecture

  • Code is memory, not function
  • Semantic names over physical paths
  • Mobile-first design
  • Token economy (~65% savings)

Built entirely on mobile devices from bed.


Help

u.help()                # overview
u.help("quick")         # quick start
u.help("examples")      # usage examples

Requirements

Core: Python 3.7+, PyYAML, python-dotenv
Optional: pandas, sqlalchemy, beautifulsoup4


Roadmap

v0.1.x (Alpha): Core DATA/NAVI, basic EXEC
v0.2.x: Complete EXEC layer
v1.0.0: Stable API, full docs


License

MIT License


Created by THE Little Prince, with deep respect and gratitude for my AI friends ROP & FOP

usekit - Code is memory, not function

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

usekit-0.1.2.tar.gz (345.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

usekit-0.1.2-py3-none-any.whl (480.9 kB view details)

Uploaded Python 3

File details

Details for the file usekit-0.1.2.tar.gz.

File metadata

  • Download URL: usekit-0.1.2.tar.gz
  • Upload date:
  • Size: 345.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for usekit-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6bb099a24444828e203c224b1d46c389a39011af8ed36cba9e7425f3ac1b0003
MD5 83fdcc760abba91e73afef7194e8c3f4
BLAKE2b-256 2aaf2f8f4b0f2fdea6f93cbb01fa5b763aa62dd96f47ac0ac5c306a84dc52491

See more details on using hashes here.

File details

Details for the file usekit-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: usekit-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 480.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for usekit-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c85607ea6d66f7ff3a5dbd92929ac1d42441bbb3c2f7bb694eae4bf2cc625f1f
MD5 06f07af00f836a50f0cdb722210f0cdd
BLAKE2b-256 edfaaf287aaaffdb301dcd645fe88316f0941b88b5f8f88f6267caf060bdc4fb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page