linelog2py: import LINE Talk History
Project description
linelog2py
linelog2py is a library to import LINE Chat History to Python.
Overview
This is a library to help you import LINE chat history files for text analysis, etc. It supports the input of a text file which can be output from the LINE talk room settings screen
-> Other Settings
-> Export Chat History
. The language setting of LINE must be set to either English or Japanese when outputting the file.
Requirement
- Python3
Installation
You can install it via PyPI.
# PyPI
$ pip install linelog2py
Usage
Reading a file via Reader
will output a list of Message
.
from linelog2py import *
file = './line_history.txt'
messages = Reader.readFile(file)
for message in messages:
print(message)
Documentation
Message
Properties
-
time: datetime
Date and time the message was sent -
username: str
User's display name -
textlines: list[str]
List of message sentences -
kind: Category
Category of the message (Text, Sticker, etc.)
Methods
-
def addMessage(self, text: str) -> None
Add line to the sentences list -
def asList(self) -> list[str]
Output contents as list
Category
Members
- NONE
- TEXT
- IMAGE
- MOVIE
- STAMP
- FILE
- CALL
- CALL_CANCELLED
- CALL_MISSED
- CONTACT
- UNSENT
- POLL
Methods
def fromLabel(cls, label: str)
GenerateCateory
from label string.
Reader
Methods
def readFile(file: str) -> list[Message]
Read a file from the path and return a list ofMessage
.
Copyright and License Information
Copyright (c) 2022 Yuji Sasaki. All rights reserved.
This software is released under the MIT License, see LICENSE.
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 Distribution
Built Distribution
File details
Details for the file linelog2py-0.1.2.tar.gz
.
File metadata
- Download URL: linelog2py-0.1.2.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | edc24a48e1685a92666d3f7276f78444801e962c0c29b4f7ecd825ff440e27fa |
|
MD5 | 6733c35cdbaff1a24ee635e4d6da4d38 |
|
BLAKE2b-256 | 01f056f2d4f09ba5a779cd05e12d0f55106f9d2497e39cb43142b0a7876aee7f |
File details
Details for the file linelog2py-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: linelog2py-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13c7c4c9c38c5d517a2333081f81f40b17a335221dd5b0b0efc621c88d74dfe9 |
|
MD5 | 513be29e549ad2a9f48083c030ce4a10 |
|
BLAKE2b-256 | 4fa9968022d94fcec5d99601b58875b04c37b77191a999b94c42f76d9adfa47d |