子弹头列车python sdk

bullet-train的Python项目详细描述


子弹头列车客户机

pythonhttps://bullet-train.io/的sdk客户端。Bullet Train允许您跨多个项目、环境和组织管理功能标志和远程配置。

开始

这些说明将为您在本地计算机上启动和运行项目的副本,以便进行开发和测试。有关如何在实时系统上部署项目的说明,请参阅在生产环境中运行。

安装

通过PIP

pip install bullet-train

用法

检索项目的功能标志

有关完整文档,请访问https://docs.bullet-train.io

frombullet_trainimportBulletTrain;bt=BulletTrain(environment_id="<YOUR_ENVIRONMENT_KEY>")ifbt.has_feature("header",'<My User Id>'):ifbt.feature_enabled("header"):# Show my awesome cool new feature to the worldifbt.has_feature("header"):ifbt.feature_enabled("header"):# Show my awesome cool new feature to the worldvalue=bt.get_value("header",'<My User Id>')value=bt.get_value("header")

可用选项

PropertyDescriptionRequiredDefault Value
^{}Defines which project environment you wish to get flags for. example ACME Project - Staging.YESNone
^{}Use this property to define where you're getting feature flags from, e.g. if you're self hosting.NOhttps://api.bullet-train.io/api/

可用函数

FunctionDescription
^{}Get the value of a particular feature e.g. ^{}
^{}Get the value of a particular feature for a user e.g. ^{}
^{}Get the value of a particular feature e.g. ^{}
^{}Get the value of a particular feature for a specified user e.g. ^{}
^{}Trigger a manual fetch of the environment features, returns a list of flag objects, see below for returned data
^{}Trigger a manual fetch of the environment features with a given user id, returns a list of flag objects, see below for returned data

识别用户

识别用户允许您从Bullet Train dashboard中针对特定用户。 可以在has_featureget_value方法中包含可选的用户标识符,以检索唯一的用户标志和变量。

flags数据结构

FieldDescriptionType
idInternal id of feature stateInteger
enabledWhether feature is enabled or notBoolean
environmentInternal ID of environmentInteger
feature_state_valueValue of the featureAny - determined based on data input on bullet-train.io.
featureFeature object - see below for detailsObject

功能数据结构

FieldDescriptionType
idInternal id of featureInteger
nameName of the feature (sometimes referred to as key or ID)String
descriptionDescription of the featureString
typeFeature Type. Can be FLAG or CONFIGString
created_dateDate feature was createdDatetime
inital_valueThe initial / default value set for all feature states on creationString
projectInternal ID of the associated projectInteger

贡献

请阅读CONTRIBUTING.md了解我们行为准则的详细信息,以及向我们提交请求的过程。

获取帮助

如果您遇到一个bug或特性请求,我们希望听到它。在提交问题之前,请搜索现有的问题,以防止重复。

联系

如果您对我们的项目有任何疑问,可以通过电子邮件projects@solidstategroup.com

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

推荐PyPI第三方库


热门话题
为@Nonnull注释参数编写java单元测试   对于JAVA,如何从它自己的类调用插入排序来将数组分类到一个单独的类中?   Java中嵌套SQL查询的字符串解析   java在所有带有特定注释的方法上调用带注释的方面   在Java中将base64转换为PDF   无法在Android上强制转换java getApplicationContext()   雅加达ee Java ee:如何获取我的应用程序的URL?   IntelliJ:如何导入的文件夹。java文件作为库?   多线程Java(FX)在播放一种声音的同时,播放另一种声音   网络爬虫我需要将proto3版本中protobuf生成的java代码添加到nutch 1.7中   使用JAXRS注释资源的java Restlet客户端   java如何查找给定月份的日期范围   java Minecraft Bukkit插件:我的小游戏传送机不工作   Java Excel搜索和数组列表工作不正常