quickstore


Namequickstore JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/yourusername/quickstore
SummaryA developer-friendly, zero-dependency key-value database with TTL, file management, and in-memory search.
upload_time2025-07-25 11:31:59
maintainerNone
docs_urlNone
authorAvishek Devnath
requires_python>=3.6
licenseMIT License Copyright (c) 2024 Your Name Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Quickstore

A developer-friendly, zero-dependency key-value database with TTL support, file management, in-memory search, and optional authentication. Usable as a CLI tool or importable Python package.

---

## Table of Contents
- [Features](#features)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [How It Works](#how-it-works)
- [CLI Usage](#cli-usage)
- [Python API Usage](#python-api-usage)
- [TTL Example](#ttl-time-to-live-example)
- [Example Outputs](#example-outputs)
- [Troubleshooting / FAQ](#troubleshooting--faq)
- [Contributing](#contributing)
- [Security Notes](#security-notes)
- [License](#license)
- [Author](#author)

---

## Features
- Set/get/delete/list keys with optional TTL (auto-expiry)
- Save/load to JSON file
- In-memory, case-insensitive substring search
- File management: store, retrieve, delete, search, and edit files (text, JSON, CSV)
- CLI commands and Python API
- Optional persistent user/password authentication for sensitive actions
- Advanced wipe/cleanup command
- Zero external dependencies (stdlib only)

---

## Installation
You can install Quickstore from PyPI or for local development.

```bash
pip install quickstore
# For local development:
pip install .
```

---

## Quick Start

### CLI
1. Set a key-value pair:
   ```bash
   quickstore set hello world
   ```
2. Retrieve the value:
   ```bash
   quickstore get hello
   # Output: world
   ```

### Python
```python
from quickstore.db import Quickstore

db = Quickstore()
db.set("hello", "world")
print(db.get("hello"))  # Output: world
```

---

## How It Works
- **Key-Value Store:** Stores data as key-value pairs in a JSON file. Supports TTL (time-to-live) for auto-expiry.
- **File Management:** Lets you store, retrieve, delete, search, and edit files (text, JSON, CSV) with metadata tracking.
- **CLI & Python API:** Use all features from the command line or in your Python code.
- **Authentication:** Optionally protect sensitive actions (like wipe) with a username and password.
- **No Dependencies:** Uses only Python’s standard library.

---

## CLI Usage

### General Options
```bash
quickstore --help        # Show help for all commands
quickstore <command> --help  # Show help for a specific command
quickstore --version     # Show the installed version
quickstore -v            # Show the installed version (short flag)
```

### Key-Value Operations
```bash
quickstore set mykey myvalue
quickstore set tempkey tempvalue --ttl 10
quickstore get mykey
quickstore list
quickstore delete mykey
quickstore search my
```

### File Management
```bash
quickstore storefile path/to/file.txt
quickstore listfiles
quickstore getfile file.txt
quickstore deletefile file.txt
quickstore searchfiles txt
```

### File Editing (Text, JSON, CSV only)
```bash
quickstore editfile file.txt --content "new content"
quickstore editfile file.txt --from-file path/to/newfile.txt
quickstore editfile file.txt --content "append this" --append
```

### Security & Wipe
```bash
quickstore setpass myuser mypass      # Set DB credentials
quickstore removepass                 # Remove credentials
quickstore wipe                       # Wipe all data/files (requires auth if set)
```

---

## Python API Usage

### Key-Value Store
```python
from quickstore.db import Quickstore

db = Quickstore()
db.set("foo", "bar")
print(db.get("foo"))
db.set("temp", "expire", ttl=5)
print(db.list_keys())
print(db.search("foo"))
db.delete("foo")
```

### File Management
```python
from quickstore.filedb import FileDB
filedb = FileDB()
filedb.store_file("test_files/test.txt")
print(filedb.list_files())
print(filedb.get_file("test.txt"))
filedb.delete_file("test.txt")
filedb.search_files("test")
```

### File Editing (Text, JSON, CSV only)
```python
filedb.edit_file("test.txt", content="new content")
filedb.edit_file("test.txt", from_file="newfile.txt")
filedb.edit_file("test.txt", content="append this", append=True)
```

### Security & Wipe
```python
filedb.setpass("myuser", "mypass")
filedb.removepass()
filedb.wipe(require_auth=False)  # Set to True to require auth if set
```

---

## TTL (Time-to-Live) Example
```python
from quickstore.db import Quickstore
import time

db = Quickstore()
db.set("temp", "should_expire", ttl=2)
print(db.get("temp"))  # Output: should_expire
print("Waiting...")
time.sleep(3)
print(db.get("temp"))  # Output: None (expired)
```

---

## Example Outputs

### CLI
```
$ quickstore set foo bar
Set foo
$ quickstore get foo
bar
$ quickstore set temp expire --ttl 2
Set temp
$ quickstore get temp
expire
$ sleep 3
$ quickstore get temp
Key not found
$ quickstore storefile test.txt
Stored file: test.txt
$ quickstore listfiles
['test.txt']
$ quickstore editfile test.txt --content "new content"
Edited file: test.txt
$ quickstore editfile test.txt --content "append this" --append
Appended to file: test.txt
$ quickstore wipe
Username: myuser
Password: mypass
Are you sure you want to wipe ALL Quickstore data and files? This cannot be undone. (yes/no): yes
Deleted quickstore.json
Deleted filemeta.json
Deleted quickstore/files directory
Database and file storage wiped.
```

### Python
```
from quickstore.db import Quickstore
from quickstore.filedb import FileDB
import time

db = Quickstore()
db.set("foo", "bar")
print(db.get("foo"))  # bar
filedb = FileDB()
filedb.store_file("test.txt")
print(filedb.list_files())  # ['test.txt']
filedb.edit_file("test.txt", content="new content")
filedb.edit_file("test.txt", content="append this", append=True)
filedb.delete_file("test.txt")
filedb.setpass("myuser", "mypass")
filedb.wipe(require_auth=True)  # Prompts for username/password
```

---

## Troubleshooting / FAQ

**Q: Why is my key missing?**
- The key may have expired if you set a TTL.
- Use `quickstore list` or `db.list_keys()` to see all current keys.

**Q: Can I store images or binary files?**
- Yes, but you cannot edit them in-place. Use `storefile` and `getfile` to manage them.

**Q: How do I reset everything?**
- Use `quickstore wipe` or `filedb.wipe()` to delete all data and files.

**Q: What if I forget my password?**
- Delete `quickstore_auth.json` manually to remove authentication (local use only).

**Q: Where is my data stored?**
- Key-value data: `quickstore.json`
- File metadata: `filemeta.json`
- Files: `quickstore/files/`

---

## Contributing

Contributions are welcome! To contribute:
1. Fork this repository
2. Create a new branch for your feature or bugfix
3. Make your changes and add tests
4. Submit a pull request

For questions or suggestions, open an issue or email the author.

---

## Security Notes
- Passwords are stored as SHA-256 hashes in quickstore_auth.json.
- Authentication is only required for sensitive actions (e.g., wipe) if credentials are set.
- If no credentials are set, all actions are open.
- For production-grade security, consider additional encryption or access controls.

---

## License
MIT

---

## Author

**Avishek Devnath**  
[avishekdevnath@gmail.com](mailto:avishekdevnath@gmail.com) 

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/yourusername/quickstore",
    "name": "quickstore",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Avishek Devnath",
    "author_email": "Avishek Devnath <avishekdevnath@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/54/31/72d09ef4d7e34d3a0d39f2ca79f03626725d97e9c883e7edcd694d2fbf90/quickstore-0.1.1.tar.gz",
    "platform": null,
    "description": "# Quickstore\r\n\r\nA developer-friendly, zero-dependency key-value database with TTL support, file management, in-memory search, and optional authentication. Usable as a CLI tool or importable Python package.\r\n\r\n---\r\n\r\n## Table of Contents\r\n- [Features](#features)\r\n- [Installation](#installation)\r\n- [Quick Start](#quick-start)\r\n- [How It Works](#how-it-works)\r\n- [CLI Usage](#cli-usage)\r\n- [Python API Usage](#python-api-usage)\r\n- [TTL Example](#ttl-time-to-live-example)\r\n- [Example Outputs](#example-outputs)\r\n- [Troubleshooting / FAQ](#troubleshooting--faq)\r\n- [Contributing](#contributing)\r\n- [Security Notes](#security-notes)\r\n- [License](#license)\r\n- [Author](#author)\r\n\r\n---\r\n\r\n## Features\r\n- Set/get/delete/list keys with optional TTL (auto-expiry)\r\n- Save/load to JSON file\r\n- In-memory, case-insensitive substring search\r\n- File management: store, retrieve, delete, search, and edit files (text, JSON, CSV)\r\n- CLI commands and Python API\r\n- Optional persistent user/password authentication for sensitive actions\r\n- Advanced wipe/cleanup command\r\n- Zero external dependencies (stdlib only)\r\n\r\n---\r\n\r\n## Installation\r\nYou can install Quickstore from PyPI or for local development.\r\n\r\n```bash\r\npip install quickstore\r\n# For local development:\r\npip install .\r\n```\r\n\r\n---\r\n\r\n## Quick Start\r\n\r\n### CLI\r\n1. Set a key-value pair:\r\n   ```bash\r\n   quickstore set hello world\r\n   ```\r\n2. Retrieve the value:\r\n   ```bash\r\n   quickstore get hello\r\n   # Output: world\r\n   ```\r\n\r\n### Python\r\n```python\r\nfrom quickstore.db import Quickstore\r\n\r\ndb = Quickstore()\r\ndb.set(\"hello\", \"world\")\r\nprint(db.get(\"hello\"))  # Output: world\r\n```\r\n\r\n---\r\n\r\n## How It Works\r\n- **Key-Value Store:** Stores data as key-value pairs in a JSON file. Supports TTL (time-to-live) for auto-expiry.\r\n- **File Management:** Lets you store, retrieve, delete, search, and edit files (text, JSON, CSV) with metadata tracking.\r\n- **CLI & Python API:** Use all features from the command line or in your Python code.\r\n- **Authentication:** Optionally protect sensitive actions (like wipe) with a username and password.\r\n- **No Dependencies:** Uses only Python\u2019s standard library.\r\n\r\n---\r\n\r\n## CLI Usage\r\n\r\n### General Options\r\n```bash\r\nquickstore --help        # Show help for all commands\r\nquickstore <command> --help  # Show help for a specific command\r\nquickstore --version     # Show the installed version\r\nquickstore -v            # Show the installed version (short flag)\r\n```\r\n\r\n### Key-Value Operations\r\n```bash\r\nquickstore set mykey myvalue\r\nquickstore set tempkey tempvalue --ttl 10\r\nquickstore get mykey\r\nquickstore list\r\nquickstore delete mykey\r\nquickstore search my\r\n```\r\n\r\n### File Management\r\n```bash\r\nquickstore storefile path/to/file.txt\r\nquickstore listfiles\r\nquickstore getfile file.txt\r\nquickstore deletefile file.txt\r\nquickstore searchfiles txt\r\n```\r\n\r\n### File Editing (Text, JSON, CSV only)\r\n```bash\r\nquickstore editfile file.txt --content \"new content\"\r\nquickstore editfile file.txt --from-file path/to/newfile.txt\r\nquickstore editfile file.txt --content \"append this\" --append\r\n```\r\n\r\n### Security & Wipe\r\n```bash\r\nquickstore setpass myuser mypass      # Set DB credentials\r\nquickstore removepass                 # Remove credentials\r\nquickstore wipe                       # Wipe all data/files (requires auth if set)\r\n```\r\n\r\n---\r\n\r\n## Python API Usage\r\n\r\n### Key-Value Store\r\n```python\r\nfrom quickstore.db import Quickstore\r\n\r\ndb = Quickstore()\r\ndb.set(\"foo\", \"bar\")\r\nprint(db.get(\"foo\"))\r\ndb.set(\"temp\", \"expire\", ttl=5)\r\nprint(db.list_keys())\r\nprint(db.search(\"foo\"))\r\ndb.delete(\"foo\")\r\n```\r\n\r\n### File Management\r\n```python\r\nfrom quickstore.filedb import FileDB\r\nfiledb = FileDB()\r\nfiledb.store_file(\"test_files/test.txt\")\r\nprint(filedb.list_files())\r\nprint(filedb.get_file(\"test.txt\"))\r\nfiledb.delete_file(\"test.txt\")\r\nfiledb.search_files(\"test\")\r\n```\r\n\r\n### File Editing (Text, JSON, CSV only)\r\n```python\r\nfiledb.edit_file(\"test.txt\", content=\"new content\")\r\nfiledb.edit_file(\"test.txt\", from_file=\"newfile.txt\")\r\nfiledb.edit_file(\"test.txt\", content=\"append this\", append=True)\r\n```\r\n\r\n### Security & Wipe\r\n```python\r\nfiledb.setpass(\"myuser\", \"mypass\")\r\nfiledb.removepass()\r\nfiledb.wipe(require_auth=False)  # Set to True to require auth if set\r\n```\r\n\r\n---\r\n\r\n## TTL (Time-to-Live) Example\r\n```python\r\nfrom quickstore.db import Quickstore\r\nimport time\r\n\r\ndb = Quickstore()\r\ndb.set(\"temp\", \"should_expire\", ttl=2)\r\nprint(db.get(\"temp\"))  # Output: should_expire\r\nprint(\"Waiting...\")\r\ntime.sleep(3)\r\nprint(db.get(\"temp\"))  # Output: None (expired)\r\n```\r\n\r\n---\r\n\r\n## Example Outputs\r\n\r\n### CLI\r\n```\r\n$ quickstore set foo bar\r\nSet foo\r\n$ quickstore get foo\r\nbar\r\n$ quickstore set temp expire --ttl 2\r\nSet temp\r\n$ quickstore get temp\r\nexpire\r\n$ sleep 3\r\n$ quickstore get temp\r\nKey not found\r\n$ quickstore storefile test.txt\r\nStored file: test.txt\r\n$ quickstore listfiles\r\n['test.txt']\r\n$ quickstore editfile test.txt --content \"new content\"\r\nEdited file: test.txt\r\n$ quickstore editfile test.txt --content \"append this\" --append\r\nAppended to file: test.txt\r\n$ quickstore wipe\r\nUsername: myuser\r\nPassword: mypass\r\nAre you sure you want to wipe ALL Quickstore data and files? This cannot be undone. (yes/no): yes\r\nDeleted quickstore.json\r\nDeleted filemeta.json\r\nDeleted quickstore/files directory\r\nDatabase and file storage wiped.\r\n```\r\n\r\n### Python\r\n```\r\nfrom quickstore.db import Quickstore\r\nfrom quickstore.filedb import FileDB\r\nimport time\r\n\r\ndb = Quickstore()\r\ndb.set(\"foo\", \"bar\")\r\nprint(db.get(\"foo\"))  # bar\r\nfiledb = FileDB()\r\nfiledb.store_file(\"test.txt\")\r\nprint(filedb.list_files())  # ['test.txt']\r\nfiledb.edit_file(\"test.txt\", content=\"new content\")\r\nfiledb.edit_file(\"test.txt\", content=\"append this\", append=True)\r\nfiledb.delete_file(\"test.txt\")\r\nfiledb.setpass(\"myuser\", \"mypass\")\r\nfiledb.wipe(require_auth=True)  # Prompts for username/password\r\n```\r\n\r\n---\r\n\r\n## Troubleshooting / FAQ\r\n\r\n**Q: Why is my key missing?**\r\n- The key may have expired if you set a TTL.\r\n- Use `quickstore list` or `db.list_keys()` to see all current keys.\r\n\r\n**Q: Can I store images or binary files?**\r\n- Yes, but you cannot edit them in-place. Use `storefile` and `getfile` to manage them.\r\n\r\n**Q: How do I reset everything?**\r\n- Use `quickstore wipe` or `filedb.wipe()` to delete all data and files.\r\n\r\n**Q: What if I forget my password?**\r\n- Delete `quickstore_auth.json` manually to remove authentication (local use only).\r\n\r\n**Q: Where is my data stored?**\r\n- Key-value data: `quickstore.json`\r\n- File metadata: `filemeta.json`\r\n- Files: `quickstore/files/`\r\n\r\n---\r\n\r\n## Contributing\r\n\r\nContributions are welcome! To contribute:\r\n1. Fork this repository\r\n2. Create a new branch for your feature or bugfix\r\n3. Make your changes and add tests\r\n4. Submit a pull request\r\n\r\nFor questions or suggestions, open an issue or email the author.\r\n\r\n---\r\n\r\n## Security Notes\r\n- Passwords are stored as SHA-256 hashes in quickstore_auth.json.\r\n- Authentication is only required for sensitive actions (e.g., wipe) if credentials are set.\r\n- If no credentials are set, all actions are open.\r\n- For production-grade security, consider additional encryption or access controls.\r\n\r\n---\r\n\r\n## License\r\nMIT\r\n\r\n---\r\n\r\n## Author\r\n\r\n**Avishek Devnath**  \r\n[avishekdevnath@gmail.com](mailto:avishekdevnath@gmail.com) \r\n",
    "bugtrack_url": null,
    "license": "MIT License\r\n        \r\n        Copyright (c) 2024 Your Name\r\n        \r\n        Permission is hereby granted, free of charge, to any person obtaining a copy\r\n        of this software and associated documentation files (the \"Software\"), to deal\r\n        in the Software without restriction, including without limitation the rights\r\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n        copies of the Software, and to permit persons to whom the Software is\r\n        furnished to do so, subject to the following conditions:\r\n        \r\n        The above copyright notice and this permission notice shall be included in all\r\n        copies or substantial portions of the Software.\r\n        \r\n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n        SOFTWARE. ",
    "summary": "A developer-friendly, zero-dependency key-value database with TTL, file management, and in-memory search.",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://github.com/yourusername/quickstore"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "74efff278568ba4a328987c2842343c3da189cd2eab01341bcd72fe4d5ba618c",
                "md5": "00c5c4a673cf72b516a6c2f3ad1e3bec",
                "sha256": "2983fff4eabbed7d0d2dd9a9e5909c691e007404431d414c2e692b9751334bdc"
            },
            "downloads": -1,
            "filename": "quickstore-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "00c5c4a673cf72b516a6c2f3ad1e3bec",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 10471,
            "upload_time": "2025-07-25T11:31:58",
            "upload_time_iso_8601": "2025-07-25T11:31:58.593596Z",
            "url": "https://files.pythonhosted.org/packages/74/ef/ff278568ba4a328987c2842343c3da189cd2eab01341bcd72fe4d5ba618c/quickstore-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "543172d09ef4d7e34d3a0d39f2ca79f03626725d97e9c883e7edcd694d2fbf90",
                "md5": "474fd39df8562b6c285484455da26153",
                "sha256": "75c900dd85834481fce94dd8c1cf5376c265912eda0db0d09e9223d7170371df"
            },
            "downloads": -1,
            "filename": "quickstore-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "474fd39df8562b6c285484455da26153",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 11371,
            "upload_time": "2025-07-25T11:31:59",
            "upload_time_iso_8601": "2025-07-25T11:31:59.888797Z",
            "url": "https://files.pythonhosted.org/packages/54/31/72d09ef4d7e34d3a0d39f2ca79f03626725d97e9c883e7edcd694d2fbf90/quickstore-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-25 11:31:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yourusername",
    "github_project": "quickstore",
    "github_not_found": true,
    "lcname": "quickstore"
}
        
Elapsed time: 1.62103s