fil


Namefil JSON
Version 1.4.3 PyPI version JSON
download
home_pagehttps://github.com/rec/fil
Summary🏺 Read/write JSON/TOML/Yaml/txt 🏺
upload_time2024-01-04 18:03:08
maintainer
docs_urlNone
authorTom Ritchford
requires_python>=3.8
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## Example 1: read a file

    d1 = fil.read('file.json')   # Any Json
    d2 = fil.read('file.toml')   # A dict
    d3 = fil.read('file.yaml')   # Any JSON
    d4 = fil.read('file.txt')    # A string

    # Reading a JSON Line file returns an interator:
    for record in fil.read('file.jsonl'):
        print(record)  # A sequence of JSON

## Example 2: write to a file

    fil.write(d1, 'file.json')  # d1 can be any JSON
    fil.write(d2, 'file.toml')  # d2 must be a dict
    fil.write(d3, 'file.yaml')  # d3 can be any JSON
    fil.write(d4, 'file.txt')   # d4 most be a str

    # Write an iterator to a JSON Line file
    dicts = ({'key': i} for i in range(10))
    fil.write(dicts, 'file.jsonl')


### [API Documentation](https://rec.github.io/fil#fil--api-documentation)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/rec/fil",
    "name": "fil",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "",
    "author": "Tom Ritchford",
    "author_email": "tom@swirly.com",
    "download_url": "https://files.pythonhosted.org/packages/f8/27/c439a008ea9fd1fab930d476e06435a6b56a91ad23e77dba2da666ea9ec1/fil-1.4.3.tar.gz",
    "platform": null,
    "description": "## Example 1: read a file\n\n    d1 = fil.read('file.json')   # Any Json\n    d2 = fil.read('file.toml')   # A dict\n    d3 = fil.read('file.yaml')   # Any JSON\n    d4 = fil.read('file.txt')    # A string\n\n    # Reading a JSON Line file returns an interator:\n    for record in fil.read('file.jsonl'):\n        print(record)  # A sequence of JSON\n\n## Example 2: write to a file\n\n    fil.write(d1, 'file.json')  # d1 can be any JSON\n    fil.write(d2, 'file.toml')  # d2 must be a dict\n    fil.write(d3, 'file.yaml')  # d3 can be any JSON\n    fil.write(d4, 'file.txt')   # d4 most be a str\n\n    # Write an iterator to a JSON Line file\n    dicts = ({'key': i} for i in range(10))\n    fil.write(dicts, 'file.jsonl')\n\n\n### [API Documentation](https://rec.github.io/fil#fil--api-documentation)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "\ud83c\udffa Read/write JSON/TOML/Yaml/txt \ud83c\udffa",
    "version": "1.4.3",
    "project_urls": {
        "Documentation": "https://rec.github.io/fil",
        "Homepage": "https://github.com/rec/fil",
        "Repository": "https://github.com/rec/fil"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fda9d4befb27cf684c6d813fdbe87695099fa47053fe01bb8683b1a6c331411a",
                "md5": "dd8406a92aea53ebf4260c8a65beb526",
                "sha256": "806901c6beee6668ff9f140e013cbfbb5ce7e925b6bf2086af706419f36a7ce6"
            },
            "downloads": -1,
            "filename": "fil-1.4.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "dd8406a92aea53ebf4260c8a65beb526",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 3631,
            "upload_time": "2024-01-04T18:03:06",
            "upload_time_iso_8601": "2024-01-04T18:03:06.497432Z",
            "url": "https://files.pythonhosted.org/packages/fd/a9/d4befb27cf684c6d813fdbe87695099fa47053fe01bb8683b1a6c331411a/fil-1.4.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f827c439a008ea9fd1fab930d476e06435a6b56a91ad23e77dba2da666ea9ec1",
                "md5": "4a7455d09d78b9152a0006c2b9de43f5",
                "sha256": "7abeb2ca11334d56e79a31e60c1482d445573733a18708496d96d83903c202e9"
            },
            "downloads": -1,
            "filename": "fil-1.4.3.tar.gz",
            "has_sig": false,
            "md5_digest": "4a7455d09d78b9152a0006c2b9de43f5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 3179,
            "upload_time": "2024-01-04T18:03:08",
            "upload_time_iso_8601": "2024-01-04T18:03:08.067383Z",
            "url": "https://files.pythonhosted.org/packages/f8/27/c439a008ea9fd1fab930d476e06435a6b56a91ad23e77dba2da666ea9ec1/fil-1.4.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-04 18:03:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rec",
    "github_project": "fil",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "fil"
}
        
Elapsed time: 0.18506s