Skip to main content

汎用ユーティリティ(ファイル操作、ログ出力など)

Project description

Utilities

Pythonで汎用的なファイル操作・ディレクトリ操作・ログ出力を支援するライブラリです。


📦 主な機能

確認系

  • is_exist(path) : パスの存在確認
  • is_file(path) : ファイルか確認
  • is_dir(path) : ディレクトリか確認

作成系

  • create_file(path) : 空ファイル作成
  • create_dir(path) : ディレクトリ作成

取得系

  • read_current_dir() : カレントディレクトリ取得
  • read_file(path) : ファイル内容取得
  • read_list_dir(path) : ディレクトリ内一覧取得

更新系

  • overwrite_file(path, content) : ファイルに上書き
  • append_file(path, content) : ファイルに追記

削除系

  • delete_file(path) : ファイル削除
  • delete_dir(path) : ディレクトリ削除

操作系

  • copy_file(src_path, dst_path) : ファイルコピー
  • move_file(src_path, dst_path) : ファイル移動

🚀 インストール

ローカル開発モードでインストールするには:

pip install -e .

🛠️ 使用例

ファイル作成書き込み削除
from Utilities.files import *

# ファイル作成
create_file('sample.txt')

# ファイル上書き
overwrite_file('sample.txt', 'Hello World')

# ファイル削除
delete_file('sample.txt')

ディレクトリ操作

from Utilities.files import *

# ディレクトリ作成
create_dir('new_folder')

# ディレクトリ内一覧取得
items = read_list_dir('new_folder')

# ディレクトリ削除
delete_dir('new_folder')

⚙️ 対応バージョン

  • Python 3.7以上

📄 ライセンス

MITライセンス

👤 作者情報

作者: Hiroki Umatani プロジェクトURL: Github

Utilitiesは、実業務に直結するファイル管理作業の効率化を目指して開発されました。 営業・開発・レポート作成などのプロジェクトを圧倒的スピードで推進するための基盤ライブラリです。

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

playground-common-utils-1.0.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

playground_common_utils-1.0.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file playground-common-utils-1.0.0.tar.gz.

File metadata

  • Download URL: playground-common-utils-1.0.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.6

File hashes

Hashes for playground-common-utils-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3803003bb327b1d234e806588d5e1d68a0ac0e6be6f4e87bb16c9f3d8ed076d0
MD5 3fe0258c9403dadee31659351dae3052
BLAKE2b-256 7c8064059cfc7f215dbd1c4936a86a51cda42fbb7f041d6033b86e03a5741e34

See more details on using hashes here.

File details

Details for the file playground_common_utils-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for playground_common_utils-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b71b9045c63ad2d8bacf98a3fdbb9bda0d94aacef4969e1fc87d49a01c93868d
MD5 09790ba1538e889e83e147fcfcd97fd0
BLAKE2b-256 39c2315ba32a647a7d4fc81d6e8f89eb61cd5b2cd88162d9940b07b4989a70de

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page