子弹头列车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第三方库


热门话题
java当我点击MainActivity中的按钮以显示其他活动时,它不起作用   java游戏!框架:在请求之间获取控制器的组件/字段/对象   JavaBlackBerry:调用计算器并检索值?   java Struts2 jQuery插件提交按钮   java无法将更新的画布绘制到活动   java如何将Gson值放入HashMap   使用截取时出现java错误:RecyclerView:未连接适配器;跳过布局   java组织。冬眠HibernateException:在Hibernate搜索中编制索引时出错(在事务完成之前)   java Swagger服务器存根生成工作流   java JInternalFrame底部阴影问题   java nio缓冲区类中limit()的用法是什么   java水平回收器视图内部选项卡布局   java Maven无法找到依赖项   java如何管理不同应用程序实例的权限文件?