创建位图分析库的简单接口的烧瓶扩展

Flask-Bitmapist的Python项目详细描述


https://travis-ci.org/cuttlesoft/flask-bitmapist.svg?branch=masterhttps://coveralls.io/repos/github/cuttlesoft/flask-bitmapist/badge.svg?branch=master

Flask扩展,创建到Bitmapist分析库的简单接口。

关于

Bitmapist是:

[A] Python library [that] makes it possible to implement real-time, highly scalable analytics that can answer the following questions:

  • Has user 123 been online today? This week? This month?
  • Has user 123 performed action “X”?
  • How many users have been active this month? This hour?
  • How many unique users have performed action “X” this week?
  • What % of users that were active last week are still active?
  • What % of users that were active last month are still active this month?
  • Which users performed action “X”?

安装

$ pip install flask-bitmapist

用法

示例应用程序:

fromflaskimportFlaskfromflask_bitmapistimportFlaskBitmapist,markapp=Flask(__name__)flaskbitmapist=FlaskBitmapist()flaskbitmapist.init_app(app)@app.route('/')@mark('index:visited',1)# current_user.iddefindex():"""using the mark decorator, the first argument is the event
       and the second is the id of the current_user
    """return'Hello, world!'if__name__=='__main__':app.run()

有关markdecorator的文档,请查看mark_eventBitmapist function

配置

NameTypeDescription
^{tt3}$^{tt4}$Name of Redis System; defaults to ^{tt5}$
^{tt6}$^{tt4}$URL to connect to Redis server; defaults to ^{tt8}$
^{tt9}$^{tt10}$Tells Bitmapist to track hourly; can also be passed to ^{tt1}$ (e.g., ^{tt12}$)
^{tt13}$^{tt10}$Disables registration of default Bitmapist Blueprint

队列蓝图

bitmapist的一个优点是它的简单位操作api和您得到的数据队列。 有关群组的更多信息,请访问Bitmapist README

初始化flask-bitmapist扩展时,会向应用程序注册蓝图。

NamePathDescription
index^{tt16}$Default Bitmapist index
cohort^{tt17}$Demo cohort retrieval and heatmap generation

测试

要运行测试,请确保在端口6399上运行redis:

$ redis-server --port 6399

然后您只需运行:

$ python setup.py test

若要为测试生成假数据,请运行:

$ python scripts/seed.py

文档

完整的烧瓶位图列表文档可在ReadTheDocs找到。

贡献

如果您对flask bitmapist感兴趣,请从创建问题here开始。谢谢!

发布历史记录

0.1.0(2016-03-30)

  • 第一次释放。

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

推荐PyPI第三方库


热门话题
java Jgit对于给定的存储库,我们如何确定新提交的列表,以及每个提交来自哪个分支?   从MS Access数据库添加java ComboBoxItem   如何禁止Java列表中不同类的实例?   java在没有Web的JAXR上使用Shiro过滤器。xml   由于java原因,无法在Ubuntu上安装Netbeans 8.2。awt。未找到恐怖和辅助技术   java JUnit对RuntimeException的处理(特别是)   java空集合在Apache CXF服务(JAXWS)中被转换为null   java CannotAcquireLockException问题   sql如何在数据库中对(Java)枚举建模(使用SQL92)   安卓在Java中获取友好url后面的文件名   java如何访问数组名以获取列表?   javascript Java Nashorn longBitsToDouble   java控制台<init>错误   java将一个LinkedList追加/连接到另一个LinkedList的最有效方式是什么?   Java for正在跳过的循环   java帮助创建带有动画的复杂Swing GUI   java Android编辑文本。setHint在片段中不工作