Skip to main content

頻繁に利用する処理を集めたライブラリ

Project description

reelib

頻繁に利用する処理を集めたライブラリ

インストール方法

pip install reelib

ライブラリの内容

timestamp

  • 時刻文字列を扱う
from reelib import timestamp

# 現在時刻のタイムスタンプを取得
ts = timestamp.get_timestamp()
# ex) 20191025164844890916

# タイムスタンプをdatetimeに変換
t = timestamp.conv_time_from_timestamp(ts)
# ex) datetime.datetime(2019, 10, 25, 16, 48, 44, 890916, tzinfo=datetime.timezone(datetime.timedelta(0, 32400)))

contjson

  • JSONを扱う
from reelib import contjson

# ファイルからの読み込み
json_obj = load_from_file('test.json')

# ファイルへの書き込み
save_to_file(json_obj, 'test.json')

# JSONを整形して標準出力
print_json(json_obj)

# str型文字列をJSONに変換
json_obj = json_from_str('{"a":2, "b":3}')

# JSONをstr型文字列に変換
json_text = json_to_str(json_obj)

contimg

  • 画像ファイルを扱う
from reelib import contimg

# PIL型をOpenCV型に変換
img_cv = contimg.pil2cv(img_pil)

# OpenCV型をPIL型に変換
img_pil = contimg.cv2pil(img_cv)

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

reelib-1.2.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

reelib-1.2.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file reelib-1.2.0.tar.gz.

File metadata

  • Download URL: reelib-1.2.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.6 Linux/5.3.0-46-generic

File hashes

Hashes for reelib-1.2.0.tar.gz
Algorithm Hash digest
SHA256 64c1a7d8a1c89799d692d6287c10fb1da5afbbbc98c805ea928d7a6c9bc30f52
MD5 14771e35a13dce0073f92282d94597b1
BLAKE2b-256 b88038a21abc40a96949ccf413600aae1f68f73d457dd3872b8d88bb495aa52a

See more details on using hashes here.

File details

Details for the file reelib-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: reelib-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.6 Linux/5.3.0-46-generic

File hashes

Hashes for reelib-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2ce385b13b085c97ce3598f7a16343b0ea699b32123572b6f1e3aac70e8eb2f4
MD5 89583dcc16e1394e82fc1a7b23c243cd
BLAKE2b-256 6edd58163e5cea54ef9e8caaf8b8796948b45f75cf061c8e0b9427585f6aa3b2

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