jade-config


Namejade-config JSON
Version 1.1.1 PyPI version JSON
download
home_page
SummaryA python package to quickly and easily make configs, or other things that your program needs to remember.
upload_time2023-05-23 16:14:18
maintainer
docs_urlNone
author
requires_python>=3.10
license
keywords jade jade_config jade config config remember
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Jade Config
A Python package to quickly and easily make configs, or other things that your program needs to remember.

We've all written data to a text file for later. Sometimes It's fine. Sometimes we read from each line trying to put more than one value in one file, then it gets confusing. This package is a quick and easy way to save data using the `shelve` module from the Python Standard Library.

This module uses no third-party libraries. It only uses the Standard Library so it downloads really quick.

On Windows, Jade Config, creates three files.
```
file.bak
file.dat
file.dir
```
On Mac, Jade Config creates only one.
```
file.db
```

## Usage
<hr>
Jade Config is very simple to use.

**Download it with:**
```
pip install jade-config
```

**Import it using:**
```
>>> from jade_config import config
```

**Create a file with:**
```
>>> file = config.Config("fileName", True)
```
Replace 'fileName' with the name of the file. You do not need to include any file extensions. The last parameter is an optional logging feature. Set it to 'True' to enable logging, or to 'False' to disable it. It is False by default, so you can just omit the parameter if you don't need logging. The log file is located at (name of file).log.txt. Each file gets a seperate log file. **Enabling logging could be a security vulnerabilty depending on what data you're storing.**

**From there you can set values**
```
>>> file.setValue("username", "nfoert")
True
```
The first parameter is the key. The second parameter is the value. This returns True if the value was written, otherwise it throws a UnableToSetValue exception.
You can set more than one value per file. Just use different keys, or you'll overwrite the last entry.

**After you set a value, you can get it.**
```
>>> get = file.getValue("username")
>>> print(get)
"nfoert"
```
You can use `.getValue` for any key in your file.

**You can also remove a key from the file.**
```
>>> file.removeKey("username")
[fileName] Removed key 'username'
```

**The full example**
```
from jade_config import config

file = config.Config("test", True)
file.setValue("username", "nfoert")
get = file.getValue("username")
print(get)

file.removeKey("username")
```

## Future updates
<hr>

<ul>
  <li>CLI Support</li>
  <li>The ability to choose the file location (may need to use a different library than shelve.)</li>
</ul>

**Warning: The files created by this library can still be read by others, eg. hackers, by using Jade Config, shelve or others. Don't store sensitive data like passwords or API Keys! It's certainly more secure than text files, but be careful!**

## Changelog
<hr>

- [1.1.1] [5/23/23] Made errors more descriptive, added `removeKey()`, and made the database correctly close after it's done being used.
- [1.0.1] Patch fixing a small logging confusion
- [1.0.0] Initial release

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "jade-config",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "jade,jade_config,jade config,config,remember",
    "author": "",
    "author_email": "nfoert <jadesoftware1@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/23/0b/a26c2d4b7badfab6b9abf0363e02d4aa361de45e260a4735917ae6bf0610/jade_config-1.1.1.tar.gz",
    "platform": null,
    "description": "# Jade Config\r\nA Python package to quickly and easily make configs, or other things that your program needs to remember.\r\n\r\nWe've all written data to a text file for later. Sometimes It's fine. Sometimes we read from each line trying to put more than one value in one file, then it gets confusing. This package is a quick and easy way to save data using the `shelve` module from the Python Standard Library.\r\n\r\nThis module uses no third-party libraries. It only uses the Standard Library so it downloads really quick.\r\n\r\nOn Windows, Jade Config, creates three files.\r\n```\r\nfile.bak\r\nfile.dat\r\nfile.dir\r\n```\r\nOn Mac, Jade Config creates only one.\r\n```\r\nfile.db\r\n```\r\n\r\n## Usage\r\n<hr>\r\nJade Config is very simple to use.\r\n\r\n**Download it with:**\r\n```\r\npip install jade-config\r\n```\r\n\r\n**Import it using:**\r\n```\r\n>>> from jade_config import config\r\n```\r\n\r\n**Create a file with:**\r\n```\r\n>>> file = config.Config(\"fileName\", True)\r\n```\r\nReplace 'fileName' with the name of the file. You do not need to include any file extensions. The last parameter is an optional logging feature. Set it to 'True' to enable logging, or to 'False' to disable it. It is False by default, so you can just omit the parameter if you don't need logging. The log file is located at (name of file).log.txt. Each file gets a seperate log file. **Enabling logging could be a security vulnerabilty depending on what data you're storing.**\r\n\r\n**From there you can set values**\r\n```\r\n>>> file.setValue(\"username\", \"nfoert\")\r\nTrue\r\n```\r\nThe first parameter is the key. The second parameter is the value. This returns True if the value was written, otherwise it throws a UnableToSetValue exception.\r\nYou can set more than one value per file. Just use different keys, or you'll overwrite the last entry.\r\n\r\n**After you set a value, you can get it.**\r\n```\r\n>>> get = file.getValue(\"username\")\r\n>>> print(get)\r\n\"nfoert\"\r\n```\r\nYou can use `.getValue` for any key in your file.\r\n\r\n**You can also remove a key from the file.**\r\n```\r\n>>> file.removeKey(\"username\")\r\n[fileName] Removed key 'username'\r\n```\r\n\r\n**The full example**\r\n```\r\nfrom jade_config import config\r\n\r\nfile = config.Config(\"test\", True)\r\nfile.setValue(\"username\", \"nfoert\")\r\nget = file.getValue(\"username\")\r\nprint(get)\r\n\r\nfile.removeKey(\"username\")\r\n```\r\n\r\n## Future updates\r\n<hr>\r\n\r\n<ul>\r\n  <li>CLI Support</li>\r\n  <li>The ability to choose the file location (may need to use a different library than shelve.)</li>\r\n</ul>\r\n\r\n**Warning: The files created by this library can still be read by others, eg. hackers, by using Jade Config, shelve or others. Don't store sensitive data like passwords or API Keys! It's certainly more secure than text files, but be careful!**\r\n\r\n## Changelog\r\n<hr>\r\n\r\n- [1.1.1] [5/23/23] Made errors more descriptive, added `removeKey()`, and made the database correctly close after it's done being used.\r\n- [1.0.1] Patch fixing a small logging confusion\r\n- [1.0.0] Initial release\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A python package to quickly and easily make configs, or other things that your program needs to remember.",
    "version": "1.1.1",
    "project_urls": {
        "Homepage": "https://github.com/nfoert/jade_config"
    },
    "split_keywords": [
        "jade",
        "jade_config",
        "jade config",
        "config",
        "remember"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "49cb1310d9efbb83ae2067607d7c3fdf521ef00c667936bd5a7577de76703199",
                "md5": "099f860864c88435e11ad323ffdb4c76",
                "sha256": "72903eb45951e5a2e78eb73ff8ad19dacc2cb2e3934ef7d319f6cce3e67984b1"
            },
            "downloads": -1,
            "filename": "jade_config-1.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "099f860864c88435e11ad323ffdb4c76",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 4115,
            "upload_time": "2023-05-23T16:14:16",
            "upload_time_iso_8601": "2023-05-23T16:14:16.519454Z",
            "url": "https://files.pythonhosted.org/packages/49/cb/1310d9efbb83ae2067607d7c3fdf521ef00c667936bd5a7577de76703199/jade_config-1.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "230ba26c2d4b7badfab6b9abf0363e02d4aa361de45e260a4735917ae6bf0610",
                "md5": "3ee252bf47b0180c17f5d0710cdbbe02",
                "sha256": "e8572bfe55516ed380f420991e9224c3acceda30d42eff8c3a5774c615cdc301"
            },
            "downloads": -1,
            "filename": "jade_config-1.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "3ee252bf47b0180c17f5d0710cdbbe02",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 3837,
            "upload_time": "2023-05-23T16:14:18",
            "upload_time_iso_8601": "2023-05-23T16:14:18.867063Z",
            "url": "https://files.pythonhosted.org/packages/23/0b/a26c2d4b7badfab6b9abf0363e02d4aa361de45e260a4735917ae6bf0610/jade_config-1.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-23 16:14:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "nfoert",
    "github_project": "jade_config",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "jade-config"
}
        
Elapsed time: 0.06694s