Skip to main content

便捷的环境文件读取

Project description

envx

介绍

环境信息的管理模块

  • 使用目录

    • Windows 系统
    使用目录:C:\env\
    
    • macOS 系统
    使用目录:/Users/env/
    
    • Linux 系统
    使用目录:/env/
    
  • 文件内容格式

HOST=192.168.0.1
PORT=6379
  • 读取结果格式
{
  "HOST": "192.168.0.1", 
  "PORT": "6379"
}

安装教程

  1. pip安装
pip3 install envx
  1. pip安装(使用淘宝镜像加速)
pip3 install envx -i https://mirrors.aliyun.com/pypi/simple

使用说明

  1. demo
import envx
redis_env = envx.read('redis.env')
  1. DEFAULT_ENV.env
  • 一般用来描述当前的环境信息,可以用来标记当前的环境类型

  • 开发环境

ENV=DEV
MSG=开发环境
  • 测试环境
ENV=TEST
MSG=测试环境
  • 开发环境
ENV=PROD
MSG=生产环境
  1. 缺省详细路径的文件名不区分大小写

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

envx-1.0.0.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

envx-1.0.0-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page