Skip to main content

save and load a structured collection of data as folder

Project description

Basically, noformat treats a folder structure as a single dict that contains data and attributes. Pandas dataframe and numpy array can be used for dict values.

import numpy as np
import pandas as pd
from noformat import File
data = File('data/temp', 'w-')
data['first_array'] = np.random.randn(10, 10)
data['second_array'] = pd.DataFrame(data=np.random.randn(10, 4), columns=['1', '2', '3', '4'])

Files will be automatically saved upon object destruction. And loaded later

read_data = File('data/temp', 'w+')
assert(read_data['first_array'].shape == (10, 10))

Attributes will be saved in ‘attributes.json’ files

read_data = File('data/temp', 'w+')
read_data.attrs['first_attribute'] = 64

This will create a folder with the following structure

data/temp/
|   first_array.npy
|   second_array.msg
└───attributes.json

Logging files for the data can be included: 1. in json format with .log extension 2. in cell array format with .mat extension It can only be written in the first type

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

noformat-0.1.4.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

noformat-0.1.4-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file noformat-0.1.4.tar.gz.

File metadata

  • Download URL: noformat-0.1.4.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.6

File hashes

Hashes for noformat-0.1.4.tar.gz
Algorithm Hash digest
SHA256 74a5aee315c285c2630b5330b153812669be0b335b93a13f6edfca8db07a106e
MD5 dafde5061345f5a44794049550a08cd3
BLAKE2b-256 7a249651b62f723a46b72065ded2b59c62b1600a26461b5cec60d02d1a23023d

See more details on using hashes here.

File details

Details for the file noformat-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: noformat-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.6

File hashes

Hashes for noformat-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2c999028e9325b5d77ba6035472ce6d71f38afcfacc4d6a6d5ccce7c331d4e00
MD5 3ed1a1be209bd497dd7e4b35bbe0f81d
BLAKE2b-256 e84681883c5967c6dbd0fe59094bb5fca06969f0bf03fd4476e1e4b3b722f7e6

See more details on using hashes here.

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