csv-to-custom-json


Namecsv-to-custom-json JSON
Version 0.0.4 PyPI version JSON
download
home_page
SummaryEasily convert your CSV to custom JSON
upload_time2023-11-01 15:59:00
maintainer
docs_urlNone
author
requires_python>=3.6
licenseMIT License Copyright (c) 2021 n4n5 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords csv custom_json custom-json json csv-to-json csv_to_json convert convert-json convert_json convert-to-json convert_to_json to-json to_json csv-to-custom-json csv_to_custom_json
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            # csv-to-custom-json-python

- [PyPi page](https://pypi.org/project/csv-to-custom-json/)
- [PyPiStats](https://pypistats.org/packages/csv-to-custom-json)

## How to install

- [installation docs](https://github.com/Its-Just-Nans/csv-to-custom-json-python/tree/master/docs/How-to-install.md)

```sh
python3 -m pip install csv-to-custom-json
```

## Tests && coverage

Coverage is 100%

```sh
# install
python -m pip install coverage unittest

# only test
python -m unittest

# coverage
coverage run -m unittest  && coverage report -m
```

## How to use csv-to-custom-json

## Classic usage

Just import the function and use it !

```python
from csv_to_custom_json import parseFile

result = parseFile("myfile.csv")
```

## How to use the schema

Create a schema variable and put it as second parameter !

Exemple with a simple `csv` :

```csv
num1,num2,num3
1,2,3
4,5,6
7,8,9
```

```python
from csv_to_custom_json import parseFile

def callback(value):
    return None

schema = {
    "num1": "string",
    "num2": callback,
    "num3": "int"
}

result = parseFile("myfile.csv", schema)
```

> Caption :
>
> - ad you can see the schema can contains function, or string with the type
> - the values with type will be parsed
> - attribute of the object are the word in the first line of the csv

## More complexe schema

It's the same as a simple schema :

```python
from csv_to_custom_json import parseFile

schema = {
    "obj1": {
        "obj2": {
            "num4": "string"
        }
    },
    "num2": "",
    "num3": ""
}
result = parseFile("myfile.csv", schema)
```

If you want to check some real case, check out the folder `test` in the [GitHub repository](https://github.com/Its-Just-Nans/csv-to-custom-json-python)

If you want to see and use options check that documentation: [How-to-options](https://github.com/Its-Just-Nans/csv-to-custom-json-python/tree/master/docs/How-to-options.md)

## See also

- [Tricks](https://github.com/Its-Just-Nans/csv-to-custom-json-python/tree/master/docs/How-to-know-more.md)
- [How-to-options](https://github.com/Its-Just-Nans/csv-to-custom-json-python/tree/master/docs/How-to-options.md)
- [CHANGELOG.md](https://github.com/Its-Just-Nans/csv-to-custom-json-python/tree/master/CHANGELOG.md)
- [csv-to-custom-json in JavaScript](https://github.com/Its-Just-Nans/csv-to-custom-json)

## License

Licensed under the MIT License - [LICENSE](LICENSE)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "csv-to-custom-json",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "csv,custom_json,custom-json,json,csv-to-json,csv_to_json,convert,convert-json,convert_json,convert-to-json,convert_to_json,to-json,to_json,csv-to-custom-json,csv_to_custom_json",
    "author": "",
    "author_email": "n4n5 <its.just.n4n5@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/36/17/a973f8e9044602f54934a0dac331883b2af91387a871983e9b1757cf56bb/csv-to-custom-json-0.0.4.tar.gz",
    "platform": null,
    "description": "# csv-to-custom-json-python\n\n- [PyPi page](https://pypi.org/project/csv-to-custom-json/)\n- [PyPiStats](https://pypistats.org/packages/csv-to-custom-json)\n\n## How to install\n\n- [installation docs](https://github.com/Its-Just-Nans/csv-to-custom-json-python/tree/master/docs/How-to-install.md)\n\n```sh\npython3 -m pip install csv-to-custom-json\n```\n\n## Tests && coverage\n\nCoverage is 100%\n\n```sh\n# install\npython -m pip install coverage unittest\n\n# only test\npython -m unittest\n\n# coverage\ncoverage run -m unittest  && coverage report -m\n```\n\n## How to use csv-to-custom-json\n\n## Classic usage\n\nJust import the function and use it !\n\n```python\nfrom csv_to_custom_json import parseFile\n\nresult = parseFile(\"myfile.csv\")\n```\n\n## How to use the schema\n\nCreate a schema variable and put it as second parameter !\n\nExemple with a simple `csv` :\n\n```csv\nnum1,num2,num3\n1,2,3\n4,5,6\n7,8,9\n```\n\n```python\nfrom csv_to_custom_json import parseFile\n\ndef callback(value):\n    return None\n\nschema = {\n    \"num1\": \"string\",\n    \"num2\": callback,\n    \"num3\": \"int\"\n}\n\nresult = parseFile(\"myfile.csv\", schema)\n```\n\n> Caption :\n>\n> - ad you can see the schema can contains function, or string with the type\n> - the values with type will be parsed\n> - attribute of the object are the word in the first line of the csv\n\n## More complexe schema\n\nIt's the same as a simple schema :\n\n```python\nfrom csv_to_custom_json import parseFile\n\nschema = {\n    \"obj1\": {\n        \"obj2\": {\n            \"num4\": \"string\"\n        }\n    },\n    \"num2\": \"\",\n    \"num3\": \"\"\n}\nresult = parseFile(\"myfile.csv\", schema)\n```\n\nIf you want to check some real case, check out the folder `test` in the [GitHub repository](https://github.com/Its-Just-Nans/csv-to-custom-json-python)\n\nIf you want to see and use options check that documentation: [How-to-options](https://github.com/Its-Just-Nans/csv-to-custom-json-python/tree/master/docs/How-to-options.md)\n\n## See also\n\n- [Tricks](https://github.com/Its-Just-Nans/csv-to-custom-json-python/tree/master/docs/How-to-know-more.md)\n- [How-to-options](https://github.com/Its-Just-Nans/csv-to-custom-json-python/tree/master/docs/How-to-options.md)\n- [CHANGELOG.md](https://github.com/Its-Just-Nans/csv-to-custom-json-python/tree/master/CHANGELOG.md)\n- [csv-to-custom-json in JavaScript](https://github.com/Its-Just-Nans/csv-to-custom-json)\n\n## License\n\nLicensed under the MIT License - [LICENSE](LICENSE)\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2021 n4n5  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Easily convert your CSV to custom JSON",
    "version": "0.0.4",
    "project_urls": {
        "Bug Tracker": "https://github.com/its-just-nans/csv-to-custom-json-python/issues",
        "Homepage": "https://github.com/its-just-nans/csv-to-custom-json-python"
    },
    "split_keywords": [
        "csv",
        "custom_json",
        "custom-json",
        "json",
        "csv-to-json",
        "csv_to_json",
        "convert",
        "convert-json",
        "convert_json",
        "convert-to-json",
        "convert_to_json",
        "to-json",
        "to_json",
        "csv-to-custom-json",
        "csv_to_custom_json"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9634a912213e4231f2b50e08e230e333104dc22b9990232e3ca4acc44dec1f43",
                "md5": "383f728808a4980b1c929fcd60a3bcf6",
                "sha256": "5bba2252e1ea2f6d0e8c4b5fac869951bc6afefdfc7b91af7546cdf471b0c253"
            },
            "downloads": -1,
            "filename": "csv_to_custom_json-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "383f728808a4980b1c929fcd60a3bcf6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 6088,
            "upload_time": "2023-11-01T15:58:58",
            "upload_time_iso_8601": "2023-11-01T15:58:58.552307Z",
            "url": "https://files.pythonhosted.org/packages/96/34/a912213e4231f2b50e08e230e333104dc22b9990232e3ca4acc44dec1f43/csv_to_custom_json-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3617a973f8e9044602f54934a0dac331883b2af91387a871983e9b1757cf56bb",
                "md5": "8e08e27e02c1a1799e5ec2cac1aa4de4",
                "sha256": "9f56e7b164cd2da01b5d33a16fe7d79fd7ff0fcc14fcc6961dd5d9f1c4adc94a"
            },
            "downloads": -1,
            "filename": "csv-to-custom-json-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "8e08e27e02c1a1799e5ec2cac1aa4de4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 8993,
            "upload_time": "2023-11-01T15:59:00",
            "upload_time_iso_8601": "2023-11-01T15:59:00.219669Z",
            "url": "https://files.pythonhosted.org/packages/36/17/a973f8e9044602f54934a0dac331883b2af91387a871983e9b1757cf56bb/csv-to-custom-json-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-01 15:59:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "its-just-nans",
    "github_project": "csv-to-custom-json-python",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "lcname": "csv-to-custom-json"
}
        
Elapsed time: 0.13129s