Easy use for fetch data from kinds of files
Project description
filez
Easy use for fetch data from kinds of files
Feature
- Support load txt,csv,excel,conf/ini,json,yaml file to list or dict
- Strip lines for txt
- Ensure_number and ensure_boolean for csv or conf
- Load all sheets or given sheets of excel file
Install
pip install filez
Simple Use
from filez import file
data = file.load('tests/data.txt')
data = file.load('tests/with_header.csv', header=True)
data = file.load('tests/data.xlsx', header=True)
data = file.load('tests/data.conf')
data = file.load('tests/data.json')
data = file.load('tests/data.yaml')
File type data type mapping
- txt: [line1, line2, line3] # strip() for each line
- csv:
- no header: [[...], [...], [...]] # ensure_number and ensure_boolean
- with header: [OrderedDict([...]), OrderedDict([...]), OrderedDict([...])]
- json/yaml: [...] or {...}
- conf/ini: {section: {option1: value, option2: value, ...}, section2: {...}}
- excel:
- default:
- no header: [[...], [...], [...]] # ensure_number and ensure_boolean
- with header: [OrderedDict([...]), OrderedDict([...]), OrderedDict([...])]
- given sheets: {Sheet1: [], Sheet2: [],...}
- default:
Todo
- load_xml
- load_html
- load_xmind
- load_doc
- load_pdf
- all2json
- all2yaml
- all2all
- find
- change file and set value
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
filez-0.1.tar.gz
(4.0 kB
view details)
File details
Details for the file filez-0.1.tar.gz
.
File metadata
- Download URL: filez-0.1.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9a4eddda2993a2c946dd00c7f83d2df55c1d807376b2b00fbf9b44c22b98d41 |
|
MD5 | b078f9b621d54131f8fb700e383d94e5 |
|
BLAKE2b-256 | 036062f015f9b0ba452372b9b3a70319f04eb9876d38511fbf72f03d1cb4dea2 |