Skip to main content

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)

# 画像のリサイズ (トリミング)
resized = contimg.resize(img_cv, (画像のサイズ(x,yのtuple)), fill=False)

# 画像のリサイズ (パディング)
resized = contimg.resize(img_cv, (画像のサイズ(x,yのtuple)), fill=True)

# 画像タイルの作成
img_tile = contimg.get_imagetile((画像パスのリスト), (タイルのサイズ(x,yのtuple)), (タイルの数(x,yのtuple)))

Metadata

Release files for reelib 1.4.1

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

Source distribution (sdist)

Source distribution for reelib 1.4.1
File Size Uploaded Provenance Actions
reelib-1.4.1.tar.gz 4.3 kB Without provenance Details for reelib-1.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for reelib 1.4.1
File Interpreter ABI Platform Actions
reelib-1.4.1-py3-none-any.whl Python 3 none any Details for reelib-1.4.1-py3-none-any.whl

Total release size: 9.2 kB

Release files / reelib-1.4.1.tar.gz

Download URL reelib-1.4.1.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
cfb638e0b7400143b828bacd7d92f50bb5f05a1f43e1e72f93d5f744843b001a
BLAKE2b-256 checksum
How to use checksums
471e4cd9066ab4948f067076a0be21ad9734d30b424d9aeef4ec6486f12533d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.9 CPython/3.7.6 Linux/4.15.0-112-generic

Release files / reelib-1.4.1-py3-none-any.whl

Download URL reelib-1.4.1-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d723dadb3ebc916554e5a78c8f5e49a51c213de23a27950c7f0b59810b70e5f9
BLAKE2b-256 checksum
How to use checksums
20bbb9c0d6dc08ea66ede26fb5c1ff9505a7c73c2a197f180f2d14cccedcf0a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.9 CPython/3.7.6 Linux/4.15.0-112-generic

Security for reelib 1.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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