Skip to main content

Python Terminal Chat Using Apache Kafka

Project description

pyTxTchat

Python Terminal Text Chat

  • using Apache Kafka

using

  • ping
$ pip install pytxtchat

$ txtping
pong
  • chat
$ txtchat

chathome

chatui

  • run cat bot
$ txtbot living <KAFKA-URL>:9092
  • search_movie
$ txtsmovie 창동 --column directorNm tablefmt github
|      | movieNm   |   openDt | nationAlt   | genreAlt   | typeNm   | directorNm   |           |   movieCd |   year |
|------|-----------|----------|-------------|------------|----------|--------------|--------------------|-----------|--------|
|  449 | 버닝      | 20180517 | 한국        | 미스터리   | 장편     | 이창동       | 파인하우스필름(주) |  20173202 |   2018 |
| 6259 | 버닝      | 20180517 | 한국        | 미스터리   | 장편     | 이창동       | 나우필름(주)       |  20173202 |   2018 |

$ txtsmovie --help
NAME
    txtsmovie - 영화 검색 함수

SYNOPSIS
    txtsmovie WORD <flags>

DESCRIPTION
    영화 검색 함수

POSITIONAL ARGUMENTS
    WORD
        Type: str
        검색할 단어

FLAGS
    -c, --column=COLUMN
        Default: 'movieNm'
        검색할 컬럼 (기본값: 'movieNm') nationAlt, genreAlt, typeNm, directorNm, companyNm
    -i, --isprint=ISPRINT
        Default: 'True'
        검색 결과를 출력할지 여부 (기본값: 'True')
    -t, --tablefmt=TABLEFMT
        Default: 'github'
        출력 형식 (기본값: 'github') plain, simple, grid, pipe, pretty, tsv ... https://pypi.org/project/tabulate/

NOTES
    You can also use flags syntax for POSITIONAL ARGUMENTS


$ txtgmovie --star=True --column=directorNm
강정훈      [ 90]  ****************************
강현성      [ 87]  ***************************
나가에 타카미  [ 90]  ****************************
나기라 겐조   [ 63]  ********************
버드맨 텟페이  [132]  ****************************************
윤준세      [ 71]  **********************
조태호      [ 70]  **********************
테이 쟈가    [ 65]  ********************
토미죠 타로   [ 82]  *************************
한동호      [ 65]  ********************

$ txtgmovie --column=companyNm --limit=5 
(주)샤이커뮤니케이션즈  [132]  ███████▏
(주)소나무픽쳐스     [192]  ██████████▎
(주)영화사가을      [746]  ████████████████████████████████████████
(주)케이알씨지      [230]  ████████████▍
스마일컨텐츠        [192]  ██████████▎

$ txtgmovie --star=True --column=genreAlt    
공포(호러)              [ 311]  ******
다큐멘터리               [ 504]  **********
드라마                 [1520]  ****************************
멜로/로맨스              [2214]  ****************************************
멜로/로맨스,드라마          [1568]  *****************************
성인물(에로)             [1922]  ***********************************
성인물(에로),드라마,멜로/로맨스  [ 326]  ******
성인물(에로),멜로/로맨스      [ 374]  *******
애니메이션               [ 451]  *********
액션                  [ 351]  *******

$ txtgmovie --help                                                                                                                                                     
 Usage: txtgmovie [OPTIONS]                                                                                                                                
                                                                                                                                                           
 특정 컬럼을 기준으로 그룹화하여 데이터 개수를 세고 시각화하는 함수                                                                                        
 Args:   column (str, optional): 그룹화할 컬럼 명 (기본값: 'year').   star (str, optional): 그래프 축 라벨에 별 문자 사용 여부 (기본값: "False").          
 'True'이면 사용, 'False'이면 사용하지 않음.   limit (int, optional): 상위 N개 그룹만 표시할지 여부 (기본값: 10).                                          
 Returns:   None                                                                                                                                           
                                                                                                                                                           
╭─ Options ──────────────────────────────────────────────────────────────╮
│ --column        TEXT  [default: year]                                  │
│ --star          TEXT  [default: False]                                 │
│ --limit         TEXT  [default: 10]                                    │
│ --help                Show this message and exit.                      │
╰────────────────────────────────────────────────────────────────────────╯

if you're a developer

$ git clone ... & cd ...

$ pdm venv create
$ source .venv/bin/activate
$ pdm install

$ pytest --cov
================ test session starts =================
platform linux -- Python 3.11.9, pytest-8.3.2, pluggy-1.5.0
configfile: pyproject.toml
plugins: cov-5.0.0

---------- coverage: platform linux, python 3.11.9-final-0 -----------
Name                      Stmts   Miss  Cover
---------------------------------------------
src/pytchat/__init__.py       0      0   100%
src/pytchat/com.py            2      0   100%
tests/__init__.py             0      0   100%
tests/test_com.py             4      0   100%
---------------------------------------------
TOTAL                         6      0   100%


================= 1 passed in 0.05s ==================

Ref

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

pytxtchat-0.5.0.tar.gz (681.1 kB view details)

Uploaded Source

Built Distribution

pytxtchat-0.5.0-py3-none-any.whl (680.6 kB view details)

Uploaded Python 3

File details

Details for the file pytxtchat-0.5.0.tar.gz.

File metadata

  • Download URL: pytxtchat-0.5.0.tar.gz
  • Upload date:
  • Size: 681.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.18.1 CPython/3.12.4 Linux/5.15.153.1-microsoft-standard-WSL2

File hashes

Hashes for pytxtchat-0.5.0.tar.gz
Algorithm Hash digest
SHA256 8a284a69b581ef30438b8664d3b4cd52dfd36dda6d0a24b7e268d9a0c18742fb
MD5 7e16fcb67d164fdb4c22949da697707c
BLAKE2b-256 33dab0d3f1de8ffb83b44fec177592340f6a39ee08136c15b44124511515f83b

See more details on using hashes here.

File details

Details for the file pytxtchat-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: pytxtchat-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 680.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.18.1 CPython/3.12.4 Linux/5.15.153.1-microsoft-standard-WSL2

File hashes

Hashes for pytxtchat-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f94d58813747f2cb88a3394c4c86c3b30476fb80b440455d63ce08b77595047f
MD5 53ac1ccbf1ab469680a46eb760d4ff93
BLAKE2b-256 652f0eddb2d27fee8e47fb06e6493e63e0b8b9acf0ecff7f3e1fd0253635354d

See more details on using hashes here.

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