myconfig


Namemyconfig JSON
Version 0.2.6 PyPI version JSON
download
home_pagehttps://github.com/azureswastika/myconfig
SummaryPython Projects Configuration Manager
upload_time2021-01-15 19:31:44
maintainer
docs_urlNone
authorDeni
requires_python>=3.5
licenseMIT license
keywords myconfig config project config
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Myconfig

![PyPI](/logos/logo.png)

[![PyPI](https://img.shields.io/pypi/v/myconfig.svg)](https://pypi.python.org/pypi/myconfig)
[![Build Status](https://travis-ci.org/azureswastika/myconfig.svg?branch=main)](https://travis-ci.org/azureswastika/myconfig)
![PyPI](https://img.shields.io/pypi/pyversions/myconfig.svg)
![PyPI - Downloads](https://img.shields.io/pypi/dm/myconfig)
[![GitHub](https://img.shields.io/github/license/azureswastika/myconfig)](https://github.com/azureswastika/myconfig/blob/main/LICENSE)

## Quick start

### Install

```bash
pip install myconfig
```

### Initialize Myconfig on project root directory

```bash
cd project/path/
myconfig -i json


Configuring your Python project environment
--------------------------------------------
File `settings.py` was created.
The `settings.json` file was created to hold public settings and `.secrets.json` file was created to hold private settings.
Also `.secrets.*` was added to `.gitignore`.
```

> You can also use other formats: **myconfig -i** \<*format*> (**json** | **yaml** | **toml**)

### Using Myconfig

Add to `settings.json` common project settings:

```json
{
    "username": "admin",
    "ips": ["127.0.0.1", "198.*.*.*"],
    "database": {
        "name": "database_name",
        "port": 5555}
}
```

Or put private settings in `.secrets.json`:

```json
{
    "password": 53156
}
```

Import the `config` object from `settings.py` in your code

```py
from settings import config

print(config.username)
print(config.database.get('name'))
```

>File `settings.py`
>
>```py
>from myconfig import MyConfig
>
>config = MyConfig(['settings.json', '.secrets.json'])
>```
>
> You can also only take variables from the .env file: **myconfig -i**
>
>```py
>from myconfig import MyConfig
>
>config = MyConfig()
>```



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/azureswastika/myconfig",
    "name": "myconfig",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.5",
    "maintainer_email": "",
    "keywords": "myconfig,config,project config",
    "author": "Deni",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/dc/a5/bfca0e406dab8231274564ca77e09a2a20135a26526360cc332524a27588/myconfig-0.2.6.tar.gz",
    "platform": "",
    "description": "# Myconfig\n\n![PyPI](/logos/logo.png)\n\n[![PyPI](https://img.shields.io/pypi/v/myconfig.svg)](https://pypi.python.org/pypi/myconfig)\n[![Build Status](https://travis-ci.org/azureswastika/myconfig.svg?branch=main)](https://travis-ci.org/azureswastika/myconfig)\n![PyPI](https://img.shields.io/pypi/pyversions/myconfig.svg)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/myconfig)\n[![GitHub](https://img.shields.io/github/license/azureswastika/myconfig)](https://github.com/azureswastika/myconfig/blob/main/LICENSE)\n\n## Quick start\n\n### Install\n\n```bash\npip install myconfig\n```\n\n### Initialize Myconfig on project root directory\n\n```bash\ncd project/path/\nmyconfig -i json\n\n\nConfiguring your Python project environment\n--------------------------------------------\nFile `settings.py` was created.\nThe `settings.json` file was created to hold public settings and `.secrets.json` file was created to hold private settings.\nAlso `.secrets.*` was added to `.gitignore`.\n```\n\n> You can also use other formats: **myconfig -i** \\<*format*> (**json** | **yaml** | **toml**)\n\n### Using Myconfig\n\nAdd to `settings.json` common project settings:\n\n```json\n{\n    \"username\": \"admin\",\n    \"ips\": [\"127.0.0.1\", \"198.*.*.*\"],\n    \"database\": {\n        \"name\": \"database_name\",\n        \"port\": 5555}\n}\n```\n\nOr put private settings in `.secrets.json`:\n\n```json\n{\n    \"password\": 53156\n}\n```\n\nImport the `config` object from `settings.py` in your code\n\n```py\nfrom settings import config\n\nprint(config.username)\nprint(config.database.get('name'))\n```\n\n>File `settings.py`\n>\n>```py\n>from myconfig import MyConfig\n>\n>config = MyConfig(['settings.json', '.secrets.json'])\n>```\n>\n> You can also only take variables from the .env file: **myconfig -i**\n>\n>```py\n>from myconfig import MyConfig\n>\n>config = MyConfig()\n>```\n\n\n",
    "bugtrack_url": null,
    "license": "MIT license",
    "summary": "Python Projects Configuration Manager",
    "version": "0.2.6",
    "split_keywords": [
        "myconfig",
        "config",
        "project config"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "c379eaab3c31fcb7933005e12c667efa",
                "sha256": "7ec29f4ac0c5de15143c9a27f1c20b5f9aa7538740eeb9ec39b2b06ee4d72892"
            },
            "downloads": -1,
            "filename": "myconfig-0.2.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c379eaab3c31fcb7933005e12c667efa",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.5",
            "size": 4885,
            "upload_time": "2021-01-15T19:31:43",
            "upload_time_iso_8601": "2021-01-15T19:31:43.518640Z",
            "url": "https://files.pythonhosted.org/packages/95/c5/060ef16570842c14f4c527d9d5d8cda401ce951369e0c2798d653bccb2f2/myconfig-0.2.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "9277ae9bfa4e96912e523c3dd2394d52",
                "sha256": "4fe02940d45f1aa29faf1554f0c634b30b855b2952d0d61d1b2ee8caed507fee"
            },
            "downloads": -1,
            "filename": "myconfig-0.2.6.tar.gz",
            "has_sig": false,
            "md5_digest": "9277ae9bfa4e96912e523c3dd2394d52",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 4058,
            "upload_time": "2021-01-15T19:31:44",
            "upload_time_iso_8601": "2021-01-15T19:31:44.739445Z",
            "url": "https://files.pythonhosted.org/packages/dc/a5/bfca0e406dab8231274564ca77e09a2a20135a26526360cc332524a27588/myconfig-0.2.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-01-15 19:31:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": null,
    "github_project": "azureswastika",
    "error": "Could not fetch GitHub repository",
    "lcname": "myconfig"
}
        
Elapsed time: 0.22667s