从.env.example模板文件自动生成.env文件

dotenver的Python项目详细描述


https://badge.fury.io/py/dotenver.svghttps://travis-ci.org/jmfederico/dotenver.svg?branch=masterhttps://img.shields.io/badge/code%20style-black-000000.svg

从模板生成dotenv(.env)文件的python应用程序。

功能

  • 从.env.example文件自动生成.env文件
  • 适用于CI或Docker部署
  • 使用Jinja2作为渲染引擎
  • 使用Faker生成值

快速启动

  1. 安装python dotenver

    $ pip install dotenver
    
  2. 创建一个.env.example

    # Full line comments will be kept# Simple usageNAME=## dotenver:first_name# Pass parameters to fakersENABLED=## dotenver:boolean(chance_of_getting_true=50)# Name your valuesMYSQL_PASSWORD=## dotenver:password:my_password(length=20)# And get the same value again, when the name is repeated.DB_PASSWORD=## dotenver:password:my_password()# Output your values within double or single quotesDOUBLE_QUOTED=## dotenver:last_name(quotes='"')SINGLE_QUOTED=## dotenver:last_name(quotes="'")# Literal values are possibleSTATIC_VARIABLE=static value# export syntax can be usedexport EXPORTED_VARIABLE=exported
  3. 从cli运行pythondotenver

    $ dotenver -r
    
  4. 现在有了一个新的.env文件可以使用。

  5. 有关更多使用选项,请运行

    $ dotenver -h
    

码头工人

一张码头工人的照片。要使用它,请将源代码装载到 /var/lib/dotenver/并运行容器。

$ docker run --rm -v `pwd`:/var/lib/dotenver/ jmfederico/dotenver

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
在reducer中迭代自定义可写组件时出现java问题   属性文件中属性的java命名约定   任务链关闭的java Executor服务   java从Eclipse中的字段生成多个构造函数   java通过继承读取Json   java在不知道密钥的情况下解析json   java camel cxf如何在电子邮件中发送soap请求响应   java程序似乎跳过了if语句的一部分,在移回正确位置之前先移到else语句   测试简单的Java加密/解密inputFileName不存在   java从Jenkins REST API获取所有作业的所有构建的构建细节   java基本包装器和静态“类型”类对象   在WebSphere8.5上部署java代码   java对象相等(对象引用“=”)   java MongoDB整型字段到枚举的转换   每次我重新导入gradle时,IntelliJ都会不断重置Java设置   类型使用键或索引从Java中的数据类型检索值   在Java的列表接口中需要listIterator()和iterator()是什么?