nobox 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
nobox-0.1.0/.gitignore ADDED
@@ -0,0 +1,74 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ pip-wheel-metadata/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # PyInstaller
31
+ *.manifest
32
+ *.spec
33
+
34
+ # Installer logs
35
+ pip-log.txt
36
+ pip-delete-this-directory.txt
37
+
38
+ # Unit test / coverage reports
39
+ htmlcov/
40
+ .tox/
41
+ .nox/
42
+ .coverage
43
+ .coverage.*
44
+ .cache
45
+ nosetests.xml
46
+ coverage.xml
47
+ *.cover
48
+ *.py,cover
49
+ .hypothesis/
50
+ .pytest_cache/
51
+
52
+ # Virtual environments
53
+ venv/
54
+ env/
55
+ ENV/
56
+ env.bak/
57
+ venv.bak/
58
+
59
+ # IDEs
60
+ .vscode/
61
+ .idea/
62
+ *.swp
63
+ *.swo
64
+ *~
65
+
66
+ # OS
67
+ .DS_Store
68
+ Thumbs.db
69
+
70
+ # Project specific
71
+ *.db
72
+ *.sqlite
73
+ *.sqlite3
74
+ CLAUDE.md
@@ -0,0 +1,123 @@
1
+ # NoBox Changelog
2
+
3
+ ## [0.1.0] - 2026-02-09 (Pre-release)
4
+
5
+ ### Added
6
+
7
+ #### Hierarchical Discovery Interface 🎉
8
+ - **List databases** command with three syntax options:
9
+ - `jb --list` or `jb -l` (flag-based)
10
+ - `jb databases` (explicit command)
11
+ - Works for both JSON (`jb`) and YAML (`yb`) formats
12
+
13
+ - **List collections** command with three syntax options:
14
+ - `jb <database> --list` or `jb <database> -l` (flag-based)
15
+ - `jb <database> collections` (explicit command)
16
+ - Shows all collections within a database
17
+
18
+ - **Hierarchical navigation** pattern:
19
+ 1. `jb -l` → databases
20
+ 2. `jb mydb -l` → collections
21
+ 3. `jb mydb users keys` → keys
22
+ 4. `jb mydb users get alice` → record data
23
+
24
+ #### Command Aliases
25
+ - Added `jb` as short alias for `jsonbox`
26
+ - Added `yb` as short alias for `yamlbox`
27
+ - Aliases registered in both `setup.py` and `pyproject.toml`
28
+
29
+ #### Import from stdin 🎉
30
+ - **Import command** for bulk data loading:
31
+ - `cat file.txt | jb mydb users import`
32
+ - Format: `key field:value field:value ...` (one record per line)
33
+ - Auto type conversion (integers, floats)
34
+ - Skips empty lines and comments (# prefix)
35
+ - Error handling with detailed reporting
36
+ - Best-effort import (continues on errors)
37
+ - Works with both JSON and YAML formats
38
+
39
+ #### Core Features (Previously Implemented)
40
+ - Driver architecture (JSONDriver, YAMLDriver)
41
+ - DictStore with full CRUD operations
42
+ - Multiple output formats:
43
+ - Pretty table (default)
44
+ - JSON (`--json`)
45
+ - JSON Lines (`--jsonl`)
46
+ - One-line format (`--oneline`)
47
+ - CSV (`--csv`)
48
+ - Case-insensitive key storage
49
+ - Cross-platform storage via ConfBox
50
+
51
+ ### Changed
52
+
53
+ #### Documentation
54
+ - **README.md**:
55
+ - Added "Hierarchical Navigation" section with examples
56
+ - Added "Complete Workflow Example" demonstrating end-to-end usage
57
+ - Added "Quick Reference Card" for common commands
58
+ - Updated all use case examples to show discovery commands
59
+ - Updated command sections with database/collection listing
60
+
61
+ - **DESIGN.md**:
62
+ - Added `databases` and `collections` to operations table
63
+ - Added "Hierarchical Navigation" section
64
+ - Updated examples to show discovery workflow
65
+ - Updated roadmap with completed phases
66
+ - Added design decision entries for new features (2026-02-09)
67
+
68
+ - **CLAUDE.md**:
69
+ - Updated Quick Reference with discovery commands
70
+ - Updated Development Status with current progress
71
+ - Added hierarchical discovery to Key Design Decisions
72
+ - Clarified TODO items (import command, tests)
73
+
74
+ #### Code
75
+ - **store.py**:
76
+ - Added `DictStore.list_databases(driver)` class method
77
+ - Lists all databases for a given format (JSON/YAML)
78
+
79
+ - **cli.py**:
80
+ - Made `database`, `collection`, and `command` arguments optional
81
+ - Added `-l`/`--list` flag for hierarchical listing
82
+ - Added `databases` and `collections` to command choices
83
+ - Added `import` command with stdin reading and error handling
84
+ - Implemented smart command routing for discovery vs CRUD
85
+ - Updated help text with discovery and import examples
86
+
87
+ - **setup.py** & **pyproject.toml**:
88
+ - Added `jb` and `yb` console script entry points
89
+
90
+ ### Added Files
91
+ - **demo.sh**: Comprehensive demo script showcasing all features
92
+ - **CHANGELOG.md**: This file
93
+
94
+ ### TODO Before Release
95
+
96
+ #### High Priority
97
+ - [ ] Add pytest test suite
98
+ - [ ] Add input validation (database/collection names)
99
+ - [ ] Prevent path traversal vulnerabilities
100
+
101
+ #### Medium Priority
102
+ - [ ] Shell completion scripts (bash/zsh)
103
+ - [ ] Add `--version` flag
104
+ - [ ] More comprehensive error messages
105
+
106
+ #### Nice to Have
107
+ - [ ] Batch operations (set-many, del-many)
108
+ - [ ] Query/filter capabilities
109
+ - [ ] Backup/export entire database
110
+
111
+ ---
112
+
113
+ ## Version History
114
+
115
+ ### [0.1.0] - 2026-02-09 (Pre-release)
116
+ Initial pre-release with core features and hierarchical discovery.
117
+
118
+ **Note**: This version is feature-complete for core functionality but lacks:
119
+ - stdin import command (documented but not implemented)
120
+ - Test suite
121
+ - Input validation
122
+
123
+ Once these are added, this will be promoted to official 0.1.0 release.
nobox-0.1.0/CLAUDE.md ADDED
@@ -0,0 +1,203 @@
1
+ # NoBox Project
2
+
3
+ ## Project Overview
4
+ NoBox - JSON and YAML key-value storage utilities for flexible, schema-less data storage via CLI.
5
+
6
+ Part of the [Box Suite](https://github.com/jmmirabile/confbox) - a modular Python CLI utility framework.
7
+
8
+ ## Project Structure
9
+ ```
10
+ nobox/
11
+ ├── nobox/
12
+ │ ├── __init__.py
13
+ │ ├── drivers.py # Driver base class, JSONDriver, YAMLDriver
14
+ │ ├── store.py # DictStore - CRUD operations
15
+ │ ├── cli.py # CLI command parser and executor
16
+ │ └── main.py # Entry points for jsonbox/yamlbox
17
+ ├── tests/
18
+ ├── docs/
19
+ ├── setup.py
20
+ ├── pyproject.toml
21
+ ├── README.md
22
+ ├── DESIGN.md # Complete architecture and design decisions
23
+ ├── CLAUDE.md # This file - project context
24
+ └── LICENSE
25
+ ```
26
+
27
+ ## Commands Provided
28
+
29
+ **Installation:**
30
+ ```bash
31
+ pip install nobox
32
+ ```
33
+
34
+ **Provides two commands:**
35
+ - `jsonbox` (alias: `jb`) - JSON format storage
36
+ - `yamlbox` (alias: `yb`) - YAML format storage
37
+
38
+ ## Quick Reference
39
+
40
+ ```bash
41
+ # Discovery (hierarchical navigation)
42
+ jb --list # List all databases (or jb -l, jb databases)
43
+ jb mydb --list # List collections in mydb (or jb mydb -l)
44
+
45
+ # CRUD operations
46
+ jb mydb users set alice name:Alice age:30 # Set record
47
+ jb mydb users get alice # Get record
48
+ jb mydb users keys # List keys
49
+ jb mydb users all # Show all records
50
+ jb mydb users del alice # Delete record
51
+
52
+ # Output formats
53
+ jb mydb users all --json # JSON object
54
+ jb mydb users all --jsonl # JSON Lines
55
+ jb mydb users all --oneline # key field:value format
56
+ jb mydb users all --csv # CSV for Excel
57
+
58
+ # Import from stdin
59
+ cat data.txt | jb mydb users import # Bulk import records
60
+ echo "alice name:Alice age:30" | jb mydb users import # Single record
61
+ ```
62
+
63
+ ## Storage Location
64
+
65
+ Uses ConfBox for cross-platform directories:
66
+
67
+ | OS | Storage Location |
68
+ |----|------------------|
69
+ | Linux | `~/.local/share/nobox/` |
70
+ | macOS | `~/Library/Application Support/nobox/` |
71
+ | Windows | `%APPDATA%\nobox\` |
72
+
73
+ **Structure:**
74
+ ```
75
+ ~/.local/share/nobox/
76
+ ├── json/ # JSON format storage
77
+ │ └── mydb/ # Database (directory)
78
+ │ ├── users.json # Collection (file)
79
+ │ └── products.json
80
+ └── yaml/ # YAML format storage
81
+ └── mydb/ # Same database, YAML format
82
+ ├── users.yaml
83
+ └── products.yaml
84
+ ```
85
+
86
+ **Benefits:**
87
+ - Single storage location (easier to backup)
88
+ - Both formats can coexist for same database
89
+ - Easy migration between formats (export/import)
90
+
91
+ ## Development Information
92
+
93
+ ### Build Commands
94
+ ```bash
95
+ pip install -e . # Development install
96
+ pip install -e ".[dev]" # With dev dependencies
97
+ ```
98
+
99
+ ### Test Commands
100
+ ```bash
101
+ pytest # Run all tests
102
+ pytest -v # Verbose output
103
+ pytest tests/test_drivers.py # Specific test file
104
+ ```
105
+
106
+ ### Lint Commands
107
+ ```bash
108
+ # TBD - will add flake8, black, mypy
109
+ ```
110
+
111
+ ## Dependencies
112
+
113
+ - **Python 3.8+**
114
+ - **confbox** >= 0.1.0 - Cross-platform directory management
115
+ - **PyYAML** - YAML format support (for yamlbox)
116
+
117
+ ## Key Design Decisions
118
+
119
+ 1. **Single package, two entry points** - DRY principle, shared code (jsonbox/jb, yamlbox/yb)
120
+ 2. **Pluggable drivers** - JSONDriver, YAMLDriver (could add TOML, etc.)
121
+ 3. **Schema-less** - Flexible key:value storage, complements DBBox
122
+ 4. **Multiple output formats** - Unix pipeline friendly (--json, --csv, --oneline, --jsonl)
123
+ 5. **Directory = Database** - Don't load entire DB for one collection
124
+ 6. **Hierarchical discovery** - Intuitive navigation from databases → collections → keys → records
125
+ 7. **Case-insensitive keys** - All keys stored lowercase for consistency
126
+
127
+ ## Use Cases
128
+
129
+ - Network device configuration snapshots (F5, switches, routers)
130
+ - API response caching
131
+ - Operational data storage (server inventories, etc.)
132
+ - Quick data capture (notes, todos, scratch data)
133
+ - Any nested/complex data that's awkward in flat files
134
+
135
+ ## Related Projects
136
+
137
+ ### Box Suite
138
+ - **[ConfBox](https://pypi.org/project/confbox/)** ✅ - Config management (published)
139
+ - **[DBBox](https://github.com/jmmirabile/dbbox)** ✅ - SQLite utility (complete)
140
+ - **NoBox** 🔨 - This project
141
+ - **PlugBox** 🔨 - Plugin system (planned)
142
+ - **CLIBox** 🔨 - CLI framework (planned)
143
+ - **APIBox** 🔨 - API testing tool (planned)
144
+
145
+ ### Comparison: DBBox vs NoBox
146
+
147
+ **Use DBBox when:**
148
+ - Structured, relational data
149
+ - Fixed schema
150
+ - SQL queries needed
151
+ - Flat tabular data
152
+
153
+ **Use NoBox when:**
154
+ - Nested, complex data structures
155
+ - Variable/flexible fields
156
+ - No schema needed
157
+ - JSON/YAML natural format
158
+
159
+ ## Development Status
160
+
161
+ - **Current Phase:** Core complete, ready for testing
162
+ - **Version:** 0.1.0 (pre-release)
163
+ - **Status:** Core features implemented, needs testing before release
164
+
165
+ ### Completed ✅
166
+ - [x] Driver architecture (JSON, YAML)
167
+ - [x] DictStore with CRUD operations
168
+ - [x] CLI with all commands (set, get, del, keys, all, import)
169
+ - [x] Multiple output formats (table, JSON, JSONL, oneline, CSV)
170
+ - [x] Hierarchical discovery (databases, collections listing)
171
+ - [x] Command aliases (jb, yb)
172
+ - [x] Import from stdin with error handling
173
+ - [x] Comprehensive documentation (README, DESIGN, examples)
174
+ - [x] Cross-platform storage via ConfBox
175
+
176
+ ### TODO Before Release 📝
177
+ 1. **High Priority:**
178
+ - [ ] Add pytest test suite (tests/ directory exists but empty)
179
+ - [ ] Input validation (database/collection names, prevent path traversal)
180
+
181
+ 2. **Medium Priority:**
182
+ - [ ] Shell completion scripts (bash/zsh)
183
+ - [ ] Add --version flag
184
+ - [ ] More comprehensive error messages
185
+
186
+ 3. **Nice to Have:**
187
+ - [ ] Batch operations (set-many, del-many)
188
+ - [ ] Query/filter capabilities
189
+ - [ ] Backup/export entire database
190
+
191
+ ## Notes
192
+
193
+ - See DESIGN.md for complete architecture documentation
194
+ - Single user tool - no concurrent access handling
195
+ - Complements DBBox (schema-less vs schema-based)
196
+ - Part of Box Suite ecosystem
197
+ - Follows Box Suite principles: modular, independent, complementary, professional
198
+
199
+ ---
200
+
201
+ **Project Started:** 2026-02-06
202
+ **Working Directory:** /home/jeffmira/Documents/dev/nobox
203
+ **Git Repository:** Not yet initialized