{
"info": {
"author": "Oyetoke Toby",
"author_email": "oyetoketoby80@gmail.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 1 - Planning",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.6",
"Topic :: Software Development :: Libraries :: Application Frameworks",
"Topic :: Software Development :: User Interfaces"
],
"description": "# ConfigStore \r\n\r\nA Python module for handling config files. It helps handles persist config files and also giving the ability to set, get, update and delete config settings\r\n\r\n> Easily load and persist config without having to think about where and how\r\n\r\nIt's built base on nodejs [configstore](https://github.com/yeoman/configstore)\r\n\r\nConfig is stored in a JSON file located in `$XDG_CONFIG_HOME` or `~/.localconfig`.
\r\nExample: `~/.localconfig/configstore/name.json`\r\n\r\n## Installation\r\n\r\n```bash\r\npip install pyconfigstore\r\n```\r\n\r\n## Usage\r\n\r\n```python\r\nfrom pyconfigstore import ConfigStore\r\n\r\n# create a Configstore instance with a unique name e.g. gnit\r\n# Package name and optionally some default values\r\nconf = ConfigStore(\"Gnit\", {\"foo\": 'bar'});\r\n\r\nprint(conf.get('foo'));\r\n#>>> 'bar'\r\n\r\nconf.set('awesome', True);\r\nprint(conf.get('awesome'));\r\n#>>> True\r\n\r\n# Use dot-notation to set nested properties\r\nconf.set('bar.baz', True);\r\nprint(conf.get('bar'));\r\n#>>> {\"baz\": True}\r\n\r\n# escape dot-notation to set nested properties\r\nconf.set('bar.baz\\\\.bag', True);\r\nprint(conf.get('bar'));\r\n#>>> {\"baz.bag\": True}\r\n\r\nconf.delete('awesome');\r\nprint(conf.get('awesome'));\r\n#>>>\r\n```\r\n\r\n## API\r\n\r\n### Configstore(packageName, [defaults], globalConfigPath)\r\n\r\nReturns a new instance.\r\n\r\n#### packageName\r\n\r\nType: `str`\r\n\r\nName of your package.\r\n\r\n#### defaults\r\n\r\nType: `dicts`\r\n\r\nDefault config.\r\n\r\n#### globalConfigPath\r\n\r\nType: `bool`
\r\nDefault: `False`\r\n\r\nStore the config at `$CONFIG/package-name/config.json` instead of the default `$CONFIG/configstore/package-name.json`. This is not recommended as you might end up conflicting with other tools, rendering the \"without having to think\" idea moot.\r\n\r\n### Features\r\n\r\nYou can use dot-notation to set, get, update and delete nested dict properties\r\n\r\n### .set(key, value)\r\n\r\nSet an item.\r\n\r\n### .set(dict)\r\n\r\nSet multiple items at once.\r\n\r\n### .get(key)\r\n\r\nGet an item.\r\n\r\n### .has(key)\r\n\r\nCheck if an item exists.\r\n\r\n### .delete(key)\r\n\r\nDelete an item.\r\n\r\n### .clear()\r\n\r\nDelete all items.\r\n\r\n### .all()\r\n\r\nGet all the config as a dict or replace the current config with an object:\r\n\r\n```python\r\nconf.all({\r\n\thello: 'world'\r\n}) \r\n```\r\n\r\n### .size\r\n\r\nGet the item count.\r\n\r\n### .path\r\n\r\nGet the path to the config file. Can be used to show the user where the config file is located or even better open it for them.\r\n\r\n## Contribute\r\n\r\nYes, you can contribute. Just dm on twitter:[@OyetokeT](http://twitter.com/@OyetokeT)\r\n\r\n## TODO\r\n\r\nThere are couple of things I still need to add\r\n\r\n1. Dot-notation: Currently, you can only set configs using this feature. (get, delete)\r\n\r\n2. Stream: I planned to add a param that'll indicate that you want it to hit the file for every operation. Well that's how it works currently though. But to make it smarter, we don't need to hit the file for (size, get, has, all) operation. We are going to call the `.all()` once to get the configs in dicts and do the operation just using dict properties.\r\n\r\nand more...\r\n\r\n## License\r\nCopyright - 2018\r\n\r\nOyetoke Toby twitter:[@OyetokeT](http://twitter.com/@OyetokeT)\r\n\r\nMIT LICENSE\r\n\r\n",
"description_content_type": "",
"docs_url": null,
"download_url": "https://github.com/CITGuru/ConfigStore/archive/1.0.0.tar.gz",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/CITGuru/ConfigStore",
"keywords": "config,settings,.env,json,settings,configstore",
"license": "MIT",
"maintainer": "",
"maintainer_email": "",
"name": "pyconfigstore",
"package_url": "https://pypi.org/project/pyconfigstore/",
"platform": "",
"project_url": "https://pypi.org/project/pyconfigstore/",
"project_urls": {
"Download": "https://github.com/CITGuru/ConfigStore/archive/1.0.0.tar.gz",
"Homepage": "https://github.com/CITGuru/ConfigStore"
},
"release_url": "https://pypi.org/project/pyconfigstore/1.0.0/",
"requires_dist": null,
"requires_python": "",
"summary": "A Python module for handling config files. It helps handles persist config files and also giving the ability to set, get, update and delete config settings its based on Configstore.js",
"version": "1.0.0"
},
"last_serial": 3964515,
"releases": {
"1.0.0": [
{
"comment_text": "",
"digests": {
"md5": "75f472c74650370300873e71ab94e599",
"sha256": "5f1f077f807315b8ef21f96397cef6fea4f007bd90b31d67d9e7abd103fb5a4b"
},
"downloads": -1,
"filename": "pyconfigstore-1.0.0-py2-none-any.whl",
"has_sig": false,
"md5_digest": "75f472c74650370300873e71ab94e599",
"packagetype": "bdist_wheel",
"python_version": "py2",
"requires_python": null,
"size": 4281,
"upload_time": "2018-06-15T12:02:49",
"url": "https://files.pythonhosted.org/packages/bc/0a/5956523df6502ac08ca070725e9aa80ac156cc795c554ed089ce92552590/pyconfigstore-1.0.0-py2-none-any.whl"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "75f472c74650370300873e71ab94e599",
"sha256": "5f1f077f807315b8ef21f96397cef6fea4f007bd90b31d67d9e7abd103fb5a4b"
},
"downloads": -1,
"filename": "pyconfigstore-1.0.0-py2-none-any.whl",
"has_sig": false,
"md5_digest": "75f472c74650370300873e71ab94e599",
"packagetype": "bdist_wheel",
"python_version": "py2",
"requires_python": null,
"size": 4281,
"upload_time": "2018-06-15T12:02:49",
"url": "https://files.pythonhosted.org/packages/bc/0a/5956523df6502ac08ca070725e9aa80ac156cc795c554ed089ce92552590/pyconfigstore-1.0.0-py2-none-any.whl"
}
]
}