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
Built Distribution
Hashes for linelog2py-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e35f9d20dee71df41b0a7fc84e651a7377013c5924d7b8332f3c7da0c6ad4f16 |
|
MD5 | d5b33a697933e8055b081af862ef1d88 |
|
BLAKE2b-256 | 371908769bc2f238877d7c761cd8001240686e86d2d05d01f9d2b5aaf9b94986 |