configset


Nameconfigset JSON
Version 1.54 PyPI version JSON
download
home_pagehttps://bitbucket.org/licface/configset
Summarysimple write config/setting, wrap of configparser
upload_time2024-10-13 02:40:40
maintainercumulus13 Team
docs_urlNone
authorHadi Cahyadi LD
requires_python>=2.7
licenseBSD
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# configset

simple write config/setting, wrap of configparser


## Installing


Install and update using `pip`:

```bash:
$ pip install configset
```

configset supports Python 2 and newer, Python 3 and newer, and PyPy.

## Example

What does it look like? Here is an example of a simple configset program:

```python:

import configset
from pathlib import Path #for last version of python 2.7 and 3.+

class pcloud(object):

    def __init__(self, **kwargs):
        ...
        #self.CONFIG = configset(os.path.join(os.path.dirname(__file__), 'config.ini')) #for python start from 2.5 
        self.CONFIG = configset(str(Path(__file__).parent / 'config.ini') #for python or just
        #self.CONFIG = configset() #this will create *.ini file base on this file name
        ...

        self.username = self.CONFIG.get_config('AUTH', 'username', "admin") # 'admin' is default value
        self.password = self.CONFIG.get_config('AUTH', 'password', "12345678") # "12345678" is default value

        self.port = self.CONFIG.get_config_as_list('MAIN', 'PORTS') # outputs is list, example ['8181', '55', '32']
        self.host = self.CONFIG.write_config('MAIN', 'HOST', '127.0.0.1')  # this will write HOST = '127.0.0.1' on section [MAIN]
        ...
```

## Support

*   Python 2.7+, 3.x+
*   Windows, Linux

## author
[Hadi Cahyadi](mailto:cumulus13@gmail.com)
    

[![Buy Me a Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/cumulus13)

[![Donate via Ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/cumulus13)
 [Support me on Patreon](https://www.patreon.com/cumulus13)

            

Raw data

            {
    "_id": null,
    "home_page": "https://bitbucket.org/licface/configset",
    "name": "configset",
    "maintainer": "cumulus13 Team",
    "docs_url": null,
    "requires_python": ">=2.7",
    "maintainer_email": "cumulus13@gmail.com",
    "keywords": null,
    "author": "Hadi Cahyadi LD",
    "author_email": "cumulus13@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/3e/61/6fa137d7be00c4975af24d6a10e38355ea86611426e72f9368542ac38a3e/configset-1.54.tar.gz",
    "platform": null,
    "description": "\r\n# configset\r\n\r\nsimple write config/setting, wrap of configparser\r\n\r\n\r\n## Installing\r\n\r\n\r\nInstall and update using `pip`:\r\n\r\n```bash:\r\n$ pip install configset\r\n```\r\n\r\nconfigset supports Python 2 and newer, Python 3 and newer, and PyPy.\r\n\r\n## Example\r\n\r\nWhat does it look like? Here is an example of a simple configset program:\r\n\r\n```python:\r\n\r\nimport configset\r\nfrom pathlib import Path #for last version of python 2.7 and 3.+\r\n\r\nclass pcloud(object):\r\n\r\n    def __init__(self, **kwargs):\r\n        ...\r\n        #self.CONFIG = configset(os.path.join(os.path.dirname(__file__), 'config.ini')) #for python start from 2.5 \r\n        self.CONFIG = configset(str(Path(__file__).parent / 'config.ini') #for python or just\r\n        #self.CONFIG = configset() #this will create *.ini file base on this file name\r\n        ...\r\n\r\n        self.username = self.CONFIG.get_config('AUTH', 'username', \"admin\") # 'admin' is default value\r\n        self.password = self.CONFIG.get_config('AUTH', 'password', \"12345678\") # \"12345678\" is default value\r\n\r\n        self.port = self.CONFIG.get_config_as_list('MAIN', 'PORTS') # outputs is list, example ['8181', '55', '32']\r\n        self.host = self.CONFIG.write_config('MAIN', 'HOST', '127.0.0.1')  # this will write HOST = '127.0.0.1' on section [MAIN]\r\n        ...\r\n```\r\n\r\n## Support\r\n\r\n*   Python 2.7+, 3.x+\r\n*   Windows, Linux\r\n\r\n## author\r\n[Hadi Cahyadi](mailto:cumulus13@gmail.com)\r\n    \r\n\r\n[![Buy Me a Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/cumulus13)\r\n\r\n[![Donate via Ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/cumulus13)\r\n [Support me on Patreon](https://www.patreon.com/cumulus13)\r\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "simple write config/setting, wrap of configparser",
    "version": "1.54",
    "project_urls": {
        "Code": "https://bitbucket.org/licface/configset",
        "Documentation": "https://bitbucket.org/licface/configset",
        "Homepage": "https://bitbucket.org/licface/configset"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "45cb5b79c4ddd9e9700dd646b5587193ecfbd09c5388e00b44d8f5e0df56f2bc",
                "md5": "101e134b608ee83b1366a6ce56c0bc75",
                "sha256": "f2def99f917f2b232b1e8dababdf6e8fd679bf45536be46aa891fd962c5ec212"
            },
            "downloads": -1,
            "filename": "configset-1.54-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "101e134b608ee83b1366a6ce56c0bc75",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=2.7",
            "size": 8911,
            "upload_time": "2024-10-13T02:40:38",
            "upload_time_iso_8601": "2024-10-13T02:40:38.383838Z",
            "url": "https://files.pythonhosted.org/packages/45/cb/5b79c4ddd9e9700dd646b5587193ecfbd09c5388e00b44d8f5e0df56f2bc/configset-1.54-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3e616fa137d7be00c4975af24d6a10e38355ea86611426e72f9368542ac38a3e",
                "md5": "9aefc4fb2e676241b3c3ecd85a38d362",
                "sha256": "ce47d4489686afbf389db172aa62ff412225d74938ad42cae91e27543c5fd50e"
            },
            "downloads": -1,
            "filename": "configset-1.54.tar.gz",
            "has_sig": false,
            "md5_digest": "9aefc4fb2e676241b3c3ecd85a38d362",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=2.7",
            "size": 8569,
            "upload_time": "2024-10-13T02:40:40",
            "upload_time_iso_8601": "2024-10-13T02:40:40.270115Z",
            "url": "https://files.pythonhosted.org/packages/3e/61/6fa137d7be00c4975af24d6a10e38355ea86611426e72f9368542ac38a3e/configset-1.54.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-13 02:40:40",
    "github": false,
    "gitlab": false,
    "bitbucket": true,
    "codeberg": false,
    "bitbucket_user": "licface",
    "bitbucket_project": "configset",
    "lcname": "configset"
}
        
Elapsed time: 0.34883s