<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          RikoPython 流處理引擎

          聯(lián)合創(chuàng)作 · 2023-09-30 05:51

          Riko是一款Python 流處理引擎,類似Yahoo Pipes。采用純python開發(fā),用于分析處理結(jié)構(gòu)化數(shù)據(jù)流。擁有同步和異步APIs,同時也支持并行RSS feeds。Riko也支持字符終端界面。

          功能特性:

          • 可讀取csv/xml/json/html文件。

          • 通過模塊化的管道可創(chuàng)建文本流和數(shù)據(jù)流。

          • 可解析、處理、提取RSS/Atom feeds。

          • 可創(chuàng)建強大的混合型APIs和maps。

          • 支持并行處理。

          使用示例代碼:

          >>> ### Create a SyncPipe flow ###
          >>> #
          >>> # `SyncPipe` is a convenience class that creates chainable flows
          >>> # and allows for parallel processing.
          >>> from riko.collections.sync import SyncPipe
          >>>
          >>> ### Set the pipe configurations ###
          >>> #
          >>> # Notes:
          >>> #   1. the `detag` option will strip all html tags from the result
          >>> #   2. fetch the text contained inside the 'body' tag of the hackernews
          >>> #      homepage
          >>> #   3. replace newlines with spaces and assign the result to 'content'
          >>> #   4. tokenize the resulting text using whitespace as the delimeter
          >>> #   5. count the number of times each token appears
          >>> #   6. obtain the raw stream
          >>> #   7. extract the first word and its count
          >>> #   8. extract the second word and its count
          >>> #   9. extract the third word and its count
          >>> url = 'https://news.ycombinator.com/'
          >>> fetch_conf = {
          ...     'url': url, 'start': '<body>', 'end': '</body>', 'detag': True}  # 1
          >>>
          >>> replace_conf = {
          ...     'rule': [
          ...         {'find': '\r\n', 'replace': ' '},
          ...         {'find': '\n', 'replace': ' '}]}
          >>>
          >>> flow = (
          ...     SyncPipe('fetchpage', conf=fetch_conf)                           # 2
          ...         .strreplace(conf=replace_conf, assign='content')             # 3
          ...         .stringtokenizer(conf={'delimiter': ' '}, emit=True)         # 4
          ...         .count(conf={'count_key': 'content'}))                       # 5
          >>>
          >>> stream = flow.output                                                 # 6
          >>> next(stream)                                                         # 7
          {"'sad": 1}
          >>> next(stream)                                                         # 8
          {'(': 28}
          >>> next(stream)                                                         # 9
          {'(1999)': 1}
          瀏覽 22
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  欧美成人一区二区三区在线视频 | 欧美一级电影在线播放 | 国产区精品豆花 | 欧美成人一级片 | 操逼社区|