configureme-0.1.2a0
توضیحات
Set up configuration for your application or library with ease.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | configureme-0.1.2a0 |
| نام | configureme |
| نسخه کتابخانه | 0.1.2a0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Bradley Golden |
| ایمیل نویسنده | golden.bradley@gmail.com |
| آدرس صفحه اصلی | https://github.com/bradleygolden/configureme |
| آدرس اینترنتی | https://pypi.org/project/configureme/ |
| مجوز | MIT |
# configureme
[](https://travis-ci.org/bradleygolden/configureme)
[](https://github.com/ambv/black)
[](https://codecov.io/gh/bradleygolden/configureme)
[](https://lgtm.com/projects/g/bradleygolden/configureme/alerts/)
[](https://lgtm.com/projects/g/bradleygolden/configureme/context:python)
[](https://github.com/bradleygolden/configureme/blob/master/LICENSE)
Set up configuration for your application or library with ease.
## Features
configureme gives you a few key features that make your life easy when creating libraries or applications:
- Easily create configuration following the config.py pattern
- Use environment variables in your configuration and change them dynamically at runtime
- Use a .env file and follow the [twelve-factor app](https://12factor.net/) methodology
## Example
Get up and running with full configuration quickly:
```python
from configureme import Config
class Config(object):
DEBUG = False
config = Config()
# load from a simple object
config.from_object(Config)
# add and watch environment variables
config.from_envar("DEBUG")
# use a dotenv file
config.from_dotenv("/path/to/.env/")
# config works like a dict!
config["DEBUG"] # True
```
## Installation
Installation is easy using pip:
```bash
pip install configureme
```
## Advanced Usage
### Usage with pipenv
If your using a dev workflow tool like [Pipenv](https://pipenv.readthedocs.io/en/latest/), you can easily pair configureme with it. Pipenv will automatically load .env files for you out of the box. To track variables loaded from a .env file when using Pipenv, simply use this pattern:
```.env
# .env file
DEBUG=true
```
```python
from configureme import Config
config = Config()
# watch each variable loaded by Pipenv
config.from_envar("DEBUG")
config["DEBUG"] # True
```
### Usage with python-dotenv
[python-dotenv](https://github.com/theskumar/python-dotenv) is a useful tool for managing .env files in multiple environments. As with the previous example, it's easy to pair with configureme.
```.env
# .env file
DEBUG=true
```
```python
from dotenv import load_dotenv
from configureme import Config
load_dotenv()
config = Config()
# watch each variable loaded by python-dotenv
config.from_envar("DEBUG")
config["DEBUG"] # True
```
## How to contribute
1. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.
2. Fork the repository on GitHub to start making your changes to the master branch (or branch off of it).
3. Write a test which shows that the bug was fixed or that the feature works as expected. Make sure to use [pre-commit](https://pre-commit.com/) too!
4. Send a pull request and bug the maintainer until it gets merged and published. Make sure to add yourself to AUTHORS.
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6.0 | Python |
نحوه نصب
نصب پکیج whl configureme-0.1.2a0:
pip install configureme-0.1.2a0.whl
نصب پکیج tar.gz configureme-0.1.2a0:
pip install configureme-0.1.2a0.tar.gz