Skip to main content

Python library for easy input/output file operations.

Project description


Python GitHubCode Style

pyeio

Short for Python Easy Input Output, pyeio is a python library meant to simplify file IO processes. You can find detailed documentation by clicking the logo above.

Details

For example, you can use it to avoid rewriting the code below hundreds of times.

import json
with open("data/example.json", "r") as file:
    data = json.load(file)
file.close()

By simplifying it to the following line.

from pyeio import EIO
easy = EIO()
data = easy.load("data/example.json")

While this might not seem like a large improvement, the specific benefit is twofold:

  1. You can load/save many different file types with this one method. Furthermore, you can cast the loaded data to a specific type or format in the same call. (Under development)
  2. Various additional functionality. (Under development)

Installation

The package requires Python 3.10. I recommend configuring a Python environment on your machine and installing pyeio inside of it.

User Installation

Install the current version of pyeio with pip.

pip install pyeio

To upgrade to a newer release use the --upgrade flag.

pip install pyeio --upgrade

Developer Installation

First clone the repository. You can do this using SSH, or HTTPS. I recommend SSH, as it's more secure.

SSH

git clone git@github.com:harttraveller/pyeio.git

HTTPS

git clone https://github.com/harttraveller/pyeio.git

Next install the package with pip. The setup.py package contains the requirements for basic functionality, however the requirements.txt file also includes requirements for testing and using the notebooks.

cd pyeio
pip install -r requirements.txt
pip install -e .

You can update pyeio by running the following command in the same directory. There may be new requirements added.

git pull origin main
pip install -r requirements.txt
pip install -e . --upgrade

Testing

The package uses pytest for testing. You can learn more about pytest on their homepage. To run the tests, you can run the following command.

pytest pyeio

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

pyeio-0.0.3.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

pyeio-0.0.3-py3-none-any.whl (4.9 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