filez


Namefilez JSON
Version 0.14 PyPI version JSON
download
home_pagehttps://github.com/hanzhichao/filez
SummaryEasy use for fetch data from kinds of files
upload_time2024-12-02 08:37:16
maintainerNone
docs_urlNone
authorHan Zhichao
requires_pythonNone
licenseMIT license
keywords filez email attachments
VCS
bugtrack_url
requirements pyyaml xlrd pytest openpyxl toml
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # filez

Easy use for fetch data from kinds of files

![Languate - Python](https://img.shields.io/badge/language-python-blue.svg)
![PyPI - License](https://img.shields.io/pypi/l/filez)
![PyPI](https://img.shields.io/pypi/v/filez)
![PyPI - Downloads](https://img.shields.io/pypi/dm/filez)

## 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
- HTML/XML to Dict

## 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')
data = file.load('tests/data.html')
data = file.load('tests/xml.html')
```

## 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: [],...}
- html/xml: {'tag': html, 'attrs': {}, 'text': '', children: [{'tag': 'head',...},{'tag': 'body',...}]}

## Todo
- load_xmind
- load_doc
- load_pdf
- all2json
- all2yaml
- all2all
- find
- change file and set value

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hanzhichao/filez",
    "name": "filez",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "filez, email, attachments",
    "author": "Han Zhichao",
    "author_email": "superhin@126.com",
    "download_url": "https://files.pythonhosted.org/packages/c0/e9/ed2b36953564dd1990ffe85b7c7d3170cec5bdccdac969193ebb2da86ae2/filez-0.14.tar.gz",
    "platform": null,
    "description": "# filez\n\nEasy use for fetch data from kinds of files\n\n![Languate - Python](https://img.shields.io/badge/language-python-blue.svg)\n![PyPI - License](https://img.shields.io/pypi/l/filez)\n![PyPI](https://img.shields.io/pypi/v/filez)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/filez)\n\n## Feature\n\n- Support load txt,csv,excel,conf/ini,json,yaml file to list or dict\n- Strip lines for txt\n- Ensure_number and ensure_boolean for csv or conf\n- Load all sheets or given sheets of excel file\n- HTML/XML to Dict\n\n## Install\n```\npip install filez\n```\n\n## Simple Use\n\n```\nfrom filez import file\ndata = file.load('tests/data.txt')\ndata = file.load('tests/with_header.csv', header=True)\ndata = file.load('tests/data.xlsx', header=True)\ndata = file.load('tests/data.conf')\ndata = file.load('tests/data.json'\uff09\ndata = file.load('tests/data.yaml'\uff09\ndata = file.load('tests/data.html')\ndata = file.load('tests/xml.html')\n```\n\n## File type data type mapping\n\n- txt: [line1, line2, line3]  # strip() for each line\n- csv: \n    - no header: [[...], [...], [...]]  # ensure_number and ensure_boolean\n    - with header: [OrderedDict([...]), OrderedDict([...]), OrderedDict([...])]\n- json/yaml: [...] or {...}\n- conf/ini: {section: {option1: value, option2: value, ...}, section2: {...}}\n- excel:\n    - default:\n        - no header: [[...], [...], [...]]  # ensure_number and ensure_boolean\n        - with header: [OrderedDict([...]), OrderedDict([...]), OrderedDict([...])]\n    - given sheets: {Sheet1: [], Sheet2: [],...}\n- html/xml: {'tag': html, 'attrs': {}, 'text': '', children: [{'tag': 'head',...},{'tag': 'body',...}]}\n\n## Todo\n- load_xmind\n- load_doc\n- load_pdf\n- all2json\n- all2yaml\n- all2all\n- find\n- change file and set value\n",
    "bugtrack_url": null,
    "license": "MIT license",
    "summary": "Easy use for fetch data from kinds of files",
    "version": "0.14",
    "project_urls": {
        "Homepage": "https://github.com/hanzhichao/filez"
    },
    "split_keywords": [
        "filez",
        " email",
        " attachments"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c0e9ed2b36953564dd1990ffe85b7c7d3170cec5bdccdac969193ebb2da86ae2",
                "md5": "4789ebc90314e98c9c9a427c166202db",
                "sha256": "d2c92ba622412bd87ce93a74e2c2ce6de663e16d923950bc8429a01dac7c0286"
            },
            "downloads": -1,
            "filename": "filez-0.14.tar.gz",
            "has_sig": false,
            "md5_digest": "4789ebc90314e98c9c9a427c166202db",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6856,
            "upload_time": "2024-12-02T08:37:16",
            "upload_time_iso_8601": "2024-12-02T08:37:16.414274Z",
            "url": "https://files.pythonhosted.org/packages/c0/e9/ed2b36953564dd1990ffe85b7c7d3170cec5bdccdac969193ebb2da86ae2/filez-0.14.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-02 08:37:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hanzhichao",
    "github_project": "filez",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "pyyaml",
            "specs": []
        },
        {
            "name": "xlrd",
            "specs": []
        },
        {
            "name": "pytest",
            "specs": []
        },
        {
            "name": "openpyxl",
            "specs": []
        },
        {
            "name": "toml",
            "specs": []
        }
    ],
    "lcname": "filez"
}
        
Elapsed time: 0.80666s