Git Product home page Git Product logo

patchouli's Introduction

Patchouli

PyPI version
LINEトーク履歴解析ライブラリ・Patchouli(パチュリー)

About

LINEで書き出したトーク履歴をパースします。
トーク履歴は、OSによって保存方式が違います。Patchouliでは、AndroidとWindowsをサポートしています。

Install

$ pip install git+https://github.com/nakasyou/Patchouli.git

How to use it?

import pypatchouli as patchouli

with open("talk.txt") as f:
    result=patchouli.Parse(
        f.read(), #トーク履歴のテキストデータ
        patchouli.modes.ja.android # modeを指定。ここではAndroid.
    )
    print(result)

resultは、Parseクラスのインスタンスとなります。
1番目のトークを取り出したいなら

first=result[0]

と記述できます。 firstの内容は、pypatchouli.Seqクラスのインスタンスになっています。
このインスタンスから、情報を取り出すことができます。

first.user # ユーザー名
first.time # 日時(datetime.datetime)
first.seq  # 本文

Detail

pypatchouli.modes

pypatchouli.modes.Mode

  • モード作成用クラス
  • pypatchouli.modes.Mode(**options)

pypatchouli.modes.ja

pypatchouli.modes.ja.windows
  • windows用モード
pypatchouli.modes.ja.android
  • android用モード

pypatchouli.Parse

  • パースのクラス
  • pypatchouli.Parse(text,mode=patchouli.modes.windows)

patchouli's People

Contributors

nakasyou avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.