Skip to main content

A tool to easily read and write json files, pickle files, binary files and plain text files.

Project description

fies

下の方に日本語の説明があります

Overview

  • A tool to easily read and write json files, pickle files, binary files and plain text files.
  • It will be extended to csv format.

Usage

import fies

# Save json file
fies["./test.json"] = {"hoge": 23, "dummy_data": "fuga"}

# Read json file
print(fies["./test.json"])	# -> {'hoge': 23, 'dummy_data': 'fuga'}

# Save plain text file
fies["./test.txt"] = "hogehoge"

# Read plain text file
print(fies["./test.txt"])	# -> hogehoge

# Save pickle file
fies["./test.pickle"] = [("hoge", 23), 5.7]

# Read pickle file
print(fies["./test.pickle"])	# -> [('hoge', 23), 5.7]

Advanced usage

# Save binary file
fies["./test.bin", "binary"] = b"hoge"

# format-specified save
fies["./test.myext", "json"] = {"hoge": 23, "dummy_data": "fuga"}

概要

  • jsonファイル, pickleファイル, バイナリファイル, プレーンテキストのファイルを簡単に読み書きできるツールです。
  • csv形式にも拡張予定です。

使い方

import fies

# jsonファイル保存
fies["./test.json"] = {"hoge": 23, "dummy_data": "fuga"}

# jsonファイル読み込み
print(fies["./test.json"])	# -> {'hoge': 23, 'dummy_data': 'fuga'}

# プレーンテキストファイル書き出し
fies["./test.txt"] = "hogehoge"

# プレーンテキストファイル読み込み
print(fies["./test.txt"])	# -> hogehoge

# pickleファイル書き出し
fies["./test.pickle"] = [("hoge", 23), 5.7]

# pickleファイル読み込み
print(fies["./test.pickle"])	# -> [('hoge', 23), 5.7]

発展的な使い方

# バイナリファイル書き出し
fies["./test.bin", "binary"] = b"hoge"

# フォーマット指定書き出し
fies["./test.myext", "json"] = {"hoge": 23, "dummy_data": "fuga"}

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

fies-0.3.1.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

fies-0.3.1-py3-none-any.whl (4.8 kB view hashes)

Uploaded Python 3

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