頻繁に利用する処理を集めたライブラリ
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
Release history Release notifications | RSS feed
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.2.tar.gz
(3.4 kB
view details)
Built Distribution
File details
Details for the file reelib-1.2.2.tar.gz
.
File metadata
- Download URL: reelib-1.2.2.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-53-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b997d9243cc656767044b656512e870f600db2b94b1a352521bcb1f620473b5 |
|
MD5 | 445afd1e4693f8dc136470a06a37231e |
|
BLAKE2b-256 | 9bf63d9ed8165042162290802bcd53e3c051d887896264575fdf1aae77e5fb8e |
File details
Details for the file reelib-1.2.2-py3-none-any.whl
.
File metadata
- Download URL: reelib-1.2.2-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-53-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f276c7db06e3b5a864b64aaeb989037cd18cd55d9e113406c956f117d2654c5b |
|
MD5 | 51ef13c7b117bf6f5f2b0dd4d9e9a0ae |
|
BLAKE2b-256 | 8e1469e89291c0edda60417ac05151f05b447a802c5c3fdc8e0b2ac1905d4d53 |