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

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计时器结束得太早?   java通过行选择编辑jtable内容   java如何将数组的值传递给另一个类?   java对象。hashCode()算法   代号为1且lambda不工作的java Android本机代码   泛型Java方法签名中是否真的需要“?扩展”?   异常处理声纳问题“main”不应“抛出”任何JAVA 7   java无法使用MVEL导入静态方法   java什么是类路径容器?   java从InputStream解码字节   Eclipse重构仅限Java   java使用Qpid通过SSL与AMQP1.0代理通信   java有没有一种方法可以在Oracle中使用带有时区的时间戳作为函数输入   保存文件时运行安卓 lint的java出错   尽管添加了JScrollPane,java JList视图区域仍在增长   java计算第n个浮点   java如何在mysql中插入日期?   GWT中异步回调的java问题