Skip to main content

linelog2py: import LINE Talk History

Project description

linelog2py

Import Line Talk History to Python (Supported in Japanese only)

概要

テキスト分析等の目的でチャットアプリのLINEでのトーク履歴をファイルからインポートするのを助けるライブラリです.LINEのトークルーム設定画面->その他->「トーク履歴を送信」で出力できるテキストファイルの入力に対応しています.現時点では,言語設定が日本語になっているLINEからの出力にしか対応していません.

インストール

PyPIでインストールできます.

# PyPI
pip install linelog2py

使用方法

Readerでファイルを読み込むとMessageクラスのリストが出力されます.

from line-log2py import Reader

file = './line_history.txt'

messages = Reader.readFile(file)

Documentation

Message

Properties

time: datetime メッセージが送信された日時 username: str ユーザの表示名 textlines: list[str] メッセージの行毎の文章 kind: Category メッセージの種類(テキスト,スタンプ,写真など)

Methods

def addMessage(self, text: str) -> None 文章に行を追加 def asList(self) -> list[str] 内容をリスト形式で出力

Category

Members

  • UNDEFINED
  • TEXT
  • IMAGE
  • MOVIE
  • STAMP
  • FILE
  • CALL
  • CALL_CANCELLED
  • CALL_MISSED
  • CONTACT

Methods

def fromLabel(cls, label: str) ラベルからCateoryを生成する

Reader

Methods

def readFile(file: str) -> list[Message] 与えられたパスのファイルを読み込んでMessageのリストを返す

Upload to PyPI

python3 setup.py bdist_wheel
python3 -m  twine upload --config-file ".pypirc" dist/*

Contact

If you have any questions or comments about linelog2py, please feel free to contact me via Email: yuji@sasaki.dev or Twitter: https://twitter.com/yujisasaki89 This project is hosted at https://github.com/jyu0414/linelog2py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

linelog2py-0.1.0-py3-none-any.whl (5.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page