Skip to main content

𝙤𝙟𝙞𝙘𝙝𝙖𝙩.𝙥𝙮

𝑶𝒋𝒊𝒔𝒂𝒏 𝑵𝒂𝒏𝒄𝒉𝒂𝒕𝒕𝒆 (𝒐𝒋𝒊𝒄𝒉𝒂𝒕) 𝑮𝒆𝒏𝒆𝒓𝒂𝒕𝒐𝒓

なんだこれは

Go製ツールojichatのPython移植版です

開発環境

Python 3.11
*海外の方の利用を1ミリも想定していないため、docstringも含めすべて日本語で整備していますのでご了承ください。

インストール

pip install ojichat-py

ojichatというパッケージもありますが別のパッケージですのでご注意ください。
おじさんで環境が汚れるのが嫌な方は仮想環境でご利用ください。
Windowsの方はReleasesに.exeがあります。

使い方

CLI

Usage:
  ojichat [options]
Options:
  -h, --help        ヘルプを表示
  -V, --version     バージョンを表示
  -s, --seed <Any>  シード値を指定する
  -n, --name <Any>  女の子の名前を指定する(-1でランダム)
  -e <number>       絵文字/顔文字の最大連続数 [default: 4]
  -p <level>        句読点挿入頻度レベル [min:0, max:3] [default: 0]
  -q, --quiet       出力を結果のみにします  デバッグモードと併用不可
  -d, --debug       デバッグモード
  --json            結果をJSON形式で返す
std I/O:
  標準入力から入力があった場合、--nameを指定しても標準入力の値に上書きされます
  また、出力は結果のみが標準出力に出力されます

example:

基本
$ ojichat

ログを出さない
$ ojichat -q
->ハナチャン、今日もお仕事かな🎵😂出張で愛知に行ってきたよ(^_^)観光でも、行きたいなぁ😂モチロン、ハナチャントネ

JSONで出力する
$ ojichat -q --json
->{"name": "クレハ", "seed": 53304354378, "punc_level": 0, "emoji_num": 4,
   "message": "クレハチャン、お疲れ様〜🎵😋(笑)ちょっと電話できるかな❓( ̄ー ̄?)🤔❓このホテル🏨、クラブサンドイッチ🥪がオイシイんだって❗💗😊オレと一緒に行こうよ😘😃なんてね😘😃☀ "}

上の情報を元に名前だけ変更する
$ ojichat -q -n ミコ -s 53304354378 --json
->{"name": "ミコ", "seed": 53304354378, "punc_level": 0, "emoji_num": 4,
  "message": "ミコチャン、お疲れ様〜🎵😋(笑)ちょっと電話できるかな❓( ̄ー ̄?)🤔❓このホテル🏨、クラブサンドイッチ🥪がオイシイんだって❗💗😊オレと一緒に行こうよ😘😃なんてね😘😃☀ "}

名前だけをランダムに変更する
$ ojichat -q -n -1 -s 53304354378 --json
->{"name": "萌美", "seed": 53304354378, "punc_level": 0, "emoji_num": 4,
  "message": "萌美チャン、お疲れ様〜🎵😋(笑)ちょっと電話できるかな❓( ̄ー ̄?)🤔❓このホテル🏨、クラブサンドイッチ🥪がオイシイんだって❗💗😊オレと一緒に行こうよ😘😃なんてね😘😃☀ "}

標準入力から名前を渡す(ただし、PowerShellで日本語をパイプで渡すと文字化けします)
$ echo リン | ojichat
->リンちゃん、オッハー(^з<)❗お弁当のフレンチトースト🍞が美味しくて、それと一緒にリンちゃんのことも食べちゃいたいナ〜(笑)🎵😃♥なんちゃって💗😃☀

ランダムで出力したいときは空文字を渡します
$ echo "" | ojichat
カズホチャン、こんな遅い時間😤に何をしているのかな🤔⁉今日はもう寝ちゃったのかな(# ̄З ̄)🛌( ̄▽ ̄)😪オジサンはプライベートで、カズホチャンを癒やして(笑)😚あげたい😋って思ってるヨ😒😎💤(^^;;

組み込み

from ojichat import OjichatGenerator

ojichat = OjichatGenerator()
# 戻り値はOjiMessageクラス
result = ojichat.generator()
print(result)

# 新たな文章を生成する
ojichat.reset()
result = ojichat.generator()

# 引数にTrueを与えると生成後にプロパティを初期値に戻せます
for i in range(10):
    print(ojichat.generator(True))

# 生成した文章の名前だけ変更する
result1 = ojichat.generator()
ojichat.set_props(name="ひな")
result2 = ojichat.generator()

# シード値で文章を固定しつつ名前をランダムに変更する
result1 = ojichat.generator()
ojichat.set_props(name=-1)
result2 = ojichat.generator()

# 生成した文章の名前だけ利用して新たな文章を生成する
result1 = ojichat.generator()
ojichat.set_props(name=result1.name, seed=-1)
result2 = ojichat.generator()

# インスタンス生成時にプロパティを渡す
ojichat = OjichatGenerator(name="れな")
result = ojichat.generator()

# 渡せる引数等はdocstringをご覧ください

注意事項

  • 引数は基本的に本家を参考にしてますので本家の説明も合わせてご覧ください。
  • おじさんは一途なので本家の変更に追随していくつもりですが、おじさんは気まぐれでもあるので違う道を走り始めるかもしれません。

問い合わせ

Twitter

Metadata

Release files for ojichat-py 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ojichat-py 0.1.0
File Size Uploaded
ojichat_py-0.1.0.tar.gz 21.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ojichat-py 0.1.0
File Interpreter ABI Platform
ojichat_py-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 45.6 kB

Release files / ojichat_py-0.1.0.tar.gz

Download URL ojichat_py-0.1.0.tar.gz
Size 21.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2cc24801e4259d7053b805f8187c91490a0e7facc779409d64b24e7fb4f10373
BLAKE2b-256 checksum
How to use checksums
dd512e61bd105b1b86d0604efb519d0bc37599c95f199370f652c6ab41bccec8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.6.0 CPython/3.10.6

Release files / ojichat_py-0.1.0-py3-none-any.whl

Download URL ojichat_py-0.1.0-py3-none-any.whl
Size 23.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
894333d08bf60a123bff68b1b1c94dd6bc1b908f504f2da3336796942d366b34
BLAKE2b-256 checksum
How to use checksums
79d39be942f559659ec30635f5bfe9527f45a18ac8e01b8fb87ac7c0505df439
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.6.0 CPython/3.10.6

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page