Name | fjson JSON |
Version |
0.1.6
JSON |
| download |
home_page | |
Summary | Python JSON writer with float formatting |
upload_time | 2022-11-30 10:59:51 |
maintainer | |
docs_url | None |
author | Nico Schlömer |
requires_python | |
license | The MIT License (MIT) opyright (c) 2020-2022 Nico Schlömer 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 |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<p align="center">
<a href="https://github.com/nschloe/fjson"><img alt="fjson" src="https://nschloe.github.io/fjson/logo.svg" width="50%"></a>
<p align="center">JSON with float formatting.</p>
</p>
[![PyPi Version](https://img.shields.io/pypi/v/fjson.svg?style=flat-square)](https://pypi.org/project/fjson)
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/fjson.svg?style=flat-square)](https://pypi.org/pypi/fjson/)
[![GitHub stars](https://img.shields.io/github/stars/nschloe/fjson.svg?style=flat-square&logo=github&label=Stars&logoColor=white)](https://github.com/nschloe/fjson)
[![Downloads](https://pepy.tech/badge/fjson/month?style=flat-square)](https://pepy.tech/project/fjson)
<!--[![PyPi downloads](https://img.shields.io/pypi/dm/fjson.svg?style=flat-square)](https://pypistats.org/packages/fjson)-->
[![gh-actions](https://img.shields.io/github/workflow/status/nschloe/fjson/ci?style=flat-square)](https://github.com/nschloe/fjson/actions?query=workflow%3Aci)
[![codecov](https://img.shields.io/codecov/c/github/nschloe/fjson.svg?style=flat-square)](https://codecov.io/gh/nschloe/fjson)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/psf/black)
The [json](https://docs.python.org/3/library/json.html) module in the Python standard
library does not allow you to specify the format in which `float`s are written out the
file. This module adds the `float_format` parameter.
```python
import math
import fjson
data = {"a": 1, "b": math.pi}
string = fjson.dumps(data, float_format=".6e", indent=2, separators=(", ", ": "))
print(string)
```
<!--pytest-codeblocks:expected-output-->
```json
{
"a": 1,
"b": 3.141593e+00
}
```
### License
fjson is published under the [MIT license](https://en.wikipedia.org/wiki/MIT_License).
Raw data
{
"_id": null,
"home_page": "",
"name": "fjson",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Nico Schl\u00f6mer",
"author_email": "nico.schloemer@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/31/b4/89fb81641de93ea0c0b7eafb680f666e8a5bb74902efa18598e1dd834d5f/fjson-0.1.6.tar.gz",
"platform": null,
"description": "<p align=\"center\">\n <a href=\"https://github.com/nschloe/fjson\"><img alt=\"fjson\" src=\"https://nschloe.github.io/fjson/logo.svg\" width=\"50%\"></a>\n <p align=\"center\">JSON with float formatting.</p>\n</p>\n\n[![PyPi Version](https://img.shields.io/pypi/v/fjson.svg?style=flat-square)](https://pypi.org/project/fjson)\n[![PyPI pyversions](https://img.shields.io/pypi/pyversions/fjson.svg?style=flat-square)](https://pypi.org/pypi/fjson/)\n[![GitHub stars](https://img.shields.io/github/stars/nschloe/fjson.svg?style=flat-square&logo=github&label=Stars&logoColor=white)](https://github.com/nschloe/fjson)\n[![Downloads](https://pepy.tech/badge/fjson/month?style=flat-square)](https://pepy.tech/project/fjson)\n<!--[![PyPi downloads](https://img.shields.io/pypi/dm/fjson.svg?style=flat-square)](https://pypistats.org/packages/fjson)-->\n\n[![gh-actions](https://img.shields.io/github/workflow/status/nschloe/fjson/ci?style=flat-square)](https://github.com/nschloe/fjson/actions?query=workflow%3Aci)\n[![codecov](https://img.shields.io/codecov/c/github/nschloe/fjson.svg?style=flat-square)](https://codecov.io/gh/nschloe/fjson)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/psf/black)\n\nThe [json](https://docs.python.org/3/library/json.html) module in the Python standard\nlibrary does not allow you to specify the format in which `float`s are written out the\nfile. This module adds the `float_format` parameter.\n\n```python\nimport math\nimport fjson\n\n\ndata = {\"a\": 1, \"b\": math.pi}\nstring = fjson.dumps(data, float_format=\".6e\", indent=2, separators=(\", \", \": \"))\nprint(string)\n```\n\n<!--pytest-codeblocks:expected-output-->\n\n```json\n{\n \"a\": 1,\n \"b\": 3.141593e+00\n}\n```\n\n### License\n\nfjson is published under the [MIT license](https://en.wikipedia.org/wiki/MIT_License).\n",
"bugtrack_url": null,
"license": "The MIT License (MIT) opyright (c) 2020-2022 Nico Schl\u00f6mer 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": "Python JSON writer with float formatting",
"version": "0.1.6",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "795bba3f0f1c9a5e757924f2d0a269a3",
"sha256": "5b968a9734aa587c3fb8cbd05809e9c22b34d95a67dde8124913e61ceb629b5b"
},
"downloads": -1,
"filename": "fjson-0.1.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "795bba3f0f1c9a5e757924f2d0a269a3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 4965,
"upload_time": "2022-11-30T10:59:50",
"upload_time_iso_8601": "2022-11-30T10:59:50.681517Z",
"url": "https://files.pythonhosted.org/packages/6b/63/b2ee807afb39ec8af6cfbc49db85d75150aae7bc66217c8fd7af5a436f55/fjson-0.1.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "1e340a36461f337eb7c06faa6deafe4d",
"sha256": "0ea0a6df68104239b57acf542bfebd9bf23e009af7f6d34861ace36742d6b383"
},
"downloads": -1,
"filename": "fjson-0.1.6.tar.gz",
"has_sig": false,
"md5_digest": "1e340a36461f337eb7c06faa6deafe4d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 4098,
"upload_time": "2022-11-30T10:59:51",
"upload_time_iso_8601": "2022-11-30T10:59:51.934218Z",
"url": "https://files.pythonhosted.org/packages/31/b4/89fb81641de93ea0c0b7eafb680f666e8a5bb74902efa18598e1dd834d5f/fjson-0.1.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-11-30 10:59:51",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "fjson"
}