coop-kobe-parser


Namecoop-kobe-parser JSON
Version 0.1.2 PyPI version JSON
download
home_pageNone
Summaryコープこうべの宅配の注文書(CSV)をパースするPythonパッケージ
upload_time2024-06-29 15:05:10
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License Copyright (c) 2024 日高 凌 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 coop csv japan japanese parser
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # coop-kobe-parser

[![PyPI version](https://badge.fury.io/py/coop-kobe-parser.svg)](https://badge.fury.io/py/coop-kobe-parser)
![build](https://github.com/ryohidaka/coop-kobe-parser/workflows/Build/badge.svg)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)

コープこうべの宅配の注文書(CSV)をパースする Python パッケージ

## Installation

You can install this library using PyPI:

```shell
pip install coop-kobe-parser
```

## 使用方法

```py
from coop_kobe_parser import CoopKobeParser


# パーサーのインスタンスを作成
parser = CoopKobeParser()

# 解析する CSV ファイルのパス
csv_path = "path/to/file.csv"

# CSV ファイルを解析
data = parser.parse(csv_path)

# 出力
print(json.dumps(data, indent=4, ensure_ascii=False))
```

### 入力例(csv)

```csv
品番,商品名,本体価格,数量,小計
001,ダミー商品A,"1,000",1,"1,080"
002,ダミー商品B,300,2,648
003,ダミー商品C,200,1,216
004,ダミー商品D,150,3,486
005,ダミー商品E,500,1,540
006,ダミー商品F,400,1,432
007,ダミー商品G,250,2,540
008,ダミー商品H,350,1,378
009,ダミー商品I,450,1,486
010,ダミー商品J,300,1,324
,値引き前本体合計金額(8%),,,"4,150"
,値引き額(8%),,,50
,本体合計金額(8%),,,"4,100"
,消費税(8%),,,328
,値引き前本体合計金額(10%),,,0
,値引き額(10%),,,0
,本体合計金額(10%),,,0
,消費税(10%),,,0
,値引き前本体合計金額(非課税),,,0
,値引き額(非課税),,,0
,本体合計金額(非課税),,,0
,本体合計金額,,,"4,100"
,消費税等,,,328
,ご注文金額(税込),,,"4,428"
,合計点数,,12,
,獲得予定ポイント,,,10

```

### 出力例

```json
{
  "products": [
    {
      "name": "ダミー商品A",
      "price": 1000,
      "amount": 1,
      "subtotal": 1080
    },
    {
      "name": "ダミー商品B",
      "price": 300,
      "amount": 2,
      "subtotal": 648
    },
    {
      "name": "ダミー商品C",
      "price": 200,
      "amount": 1,
      "subtotal": 216
    },
    {
      "name": "ダミー商品D",
      "price": 150,
      "amount": 3,
      "subtotal": 486
    },
    {
      "name": "ダミー商品E",
      "price": 500,
      "amount": 1,
      "subtotal": 540
    },
    {
      "name": "ダミー商品F",
      "price": 400,
      "amount": 1,
      "subtotal": 432
    },
    {
      "name": "ダミー商品G",
      "price": 250,
      "amount": 2,
      "subtotal": 540
    },
    {
      "name": "ダミー商品H",
      "price": 350,
      "amount": 1,
      "subtotal": 378
    },
    {
      "name": "ダミー商品I",
      "price": 450,
      "amount": 1,
      "subtotal": 486
    },
    {
      "name": "ダミー商品J",
      "price": 300,
      "amount": 1,
      "subtotal": 324
    }
  ],
  "summary": {
    "pre_total_8": 4150,
    "discount_8": 50,
    "total_8": 4100,
    "tax_8": 328,
    "pre_total_10": 0,
    "discount_10": 0,
    "total_10": 0,
    "tax_10": 0,
    "pre_total_non_tax": 0,
    "discount_non_tax": 0,
    "total_non_tax": 0,
    "total_amount": 4100,
    "total_tax": 328,
    "order_amount_incl_tax": 4428,
    "expected_points": 10,
    "total_items": 12
  }
}
```

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "coop-kobe-parser",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "coop, csv, japan, japanese, parser",
    "author": null,
    "author_email": "ryohidaka <39184410+ryohidaka@users.noreply.github.com>",
    "download_url": "https://files.pythonhosted.org/packages/dc/c3/1354510adaae0b8cba7ecf05d6626a07397c01863183e639bcbd7c1275d9/coop_kobe_parser-0.1.2.tar.gz",
    "platform": null,
    "description": "# coop-kobe-parser\n\n[![PyPI version](https://badge.fury.io/py/coop-kobe-parser.svg)](https://badge.fury.io/py/coop-kobe-parser)\n![build](https://github.com/ryohidaka/coop-kobe-parser/workflows/Build/badge.svg)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\n\u30b3\u30fc\u30d7\u3053\u3046\u3079\u306e\u5b85\u914d\u306e\u6ce8\u6587\u66f8(CSV)\u3092\u30d1\u30fc\u30b9\u3059\u308b Python \u30d1\u30c3\u30b1\u30fc\u30b8\n\n## Installation\n\nYou can install this library using PyPI:\n\n```shell\npip install coop-kobe-parser\n```\n\n## \u4f7f\u7528\u65b9\u6cd5\n\n```py\nfrom coop_kobe_parser import CoopKobeParser\n\n\n# \u30d1\u30fc\u30b5\u30fc\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\nparser = CoopKobeParser()\n\n# \u89e3\u6790\u3059\u308b CSV \u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\ncsv_path = \"path/to/file.csv\"\n\n# CSV \u30d5\u30a1\u30a4\u30eb\u3092\u89e3\u6790\ndata = parser.parse(csv_path)\n\n# \u51fa\u529b\nprint(json.dumps(data, indent=4, ensure_ascii=False))\n```\n\n### \u5165\u529b\u4f8b(csv)\n\n```csv\n\u54c1\u756a,\u5546\u54c1\u540d,\u672c\u4f53\u4fa1\u683c,\u6570\u91cf,\u5c0f\u8a08\n001,\u30c0\u30df\u30fc\u5546\u54c1A,\"1,000\",1,\"1,080\"\n002,\u30c0\u30df\u30fc\u5546\u54c1B,300,2,648\n003,\u30c0\u30df\u30fc\u5546\u54c1C,200,1,216\n004,\u30c0\u30df\u30fc\u5546\u54c1D,150,3,486\n005,\u30c0\u30df\u30fc\u5546\u54c1E,500,1,540\n006,\u30c0\u30df\u30fc\u5546\u54c1F,400,1,432\n007,\u30c0\u30df\u30fc\u5546\u54c1G,250,2,540\n008,\u30c0\u30df\u30fc\u5546\u54c1H,350,1,378\n009,\u30c0\u30df\u30fc\u5546\u54c1I,450,1,486\n010,\u30c0\u30df\u30fc\u5546\u54c1J,300,1,324\n,\u5024\u5f15\u304d\u524d\u672c\u4f53\u5408\u8a08\u91d1\u984d(8%),,,\"4,150\"\n,\u5024\u5f15\u304d\u984d(8%),,,50\n,\u672c\u4f53\u5408\u8a08\u91d1\u984d(8%),,,\"4,100\"\n,\u6d88\u8cbb\u7a0e(8%),,,328\n,\u5024\u5f15\u304d\u524d\u672c\u4f53\u5408\u8a08\u91d1\u984d(10%),,,0\n,\u5024\u5f15\u304d\u984d(10%),,,0\n,\u672c\u4f53\u5408\u8a08\u91d1\u984d(10%),,,0\n,\u6d88\u8cbb\u7a0e(10%),,,0\n,\u5024\u5f15\u304d\u524d\u672c\u4f53\u5408\u8a08\u91d1\u984d\uff08\u975e\u8ab2\u7a0e\uff09,,,0\n,\u5024\u5f15\u304d\u984d(\u975e\u8ab2\u7a0e),,,0\n,\u672c\u4f53\u5408\u8a08\u91d1\u984d(\u975e\u8ab2\u7a0e),,,0\n,\u672c\u4f53\u5408\u8a08\u91d1\u984d,,,\"4,100\"\n,\u6d88\u8cbb\u7a0e\u7b49,,,328\n,\u3054\u6ce8\u6587\u91d1\u984d(\u7a0e\u8fbc),,,\"4,428\"\n,\u5408\u8a08\u70b9\u6570,,12,\n,\u7372\u5f97\u4e88\u5b9a\u30dd\u30a4\u30f3\u30c8,,,10\n\n```\n\n### \u51fa\u529b\u4f8b\n\n```json\n{\n  \"products\": [\n    {\n      \"name\": \"\u30c0\u30df\u30fc\u5546\u54c1A\",\n      \"price\": 1000,\n      \"amount\": 1,\n      \"subtotal\": 1080\n    },\n    {\n      \"name\": \"\u30c0\u30df\u30fc\u5546\u54c1B\",\n      \"price\": 300,\n      \"amount\": 2,\n      \"subtotal\": 648\n    },\n    {\n      \"name\": \"\u30c0\u30df\u30fc\u5546\u54c1C\",\n      \"price\": 200,\n      \"amount\": 1,\n      \"subtotal\": 216\n    },\n    {\n      \"name\": \"\u30c0\u30df\u30fc\u5546\u54c1D\",\n      \"price\": 150,\n      \"amount\": 3,\n      \"subtotal\": 486\n    },\n    {\n      \"name\": \"\u30c0\u30df\u30fc\u5546\u54c1E\",\n      \"price\": 500,\n      \"amount\": 1,\n      \"subtotal\": 540\n    },\n    {\n      \"name\": \"\u30c0\u30df\u30fc\u5546\u54c1F\",\n      \"price\": 400,\n      \"amount\": 1,\n      \"subtotal\": 432\n    },\n    {\n      \"name\": \"\u30c0\u30df\u30fc\u5546\u54c1G\",\n      \"price\": 250,\n      \"amount\": 2,\n      \"subtotal\": 540\n    },\n    {\n      \"name\": \"\u30c0\u30df\u30fc\u5546\u54c1H\",\n      \"price\": 350,\n      \"amount\": 1,\n      \"subtotal\": 378\n    },\n    {\n      \"name\": \"\u30c0\u30df\u30fc\u5546\u54c1I\",\n      \"price\": 450,\n      \"amount\": 1,\n      \"subtotal\": 486\n    },\n    {\n      \"name\": \"\u30c0\u30df\u30fc\u5546\u54c1J\",\n      \"price\": 300,\n      \"amount\": 1,\n      \"subtotal\": 324\n    }\n  ],\n  \"summary\": {\n    \"pre_total_8\": 4150,\n    \"discount_8\": 50,\n    \"total_8\": 4100,\n    \"tax_8\": 328,\n    \"pre_total_10\": 0,\n    \"discount_10\": 0,\n    \"total_10\": 0,\n    \"tax_10\": 0,\n    \"pre_total_non_tax\": 0,\n    \"discount_non_tax\": 0,\n    \"total_non_tax\": 0,\n    \"total_amount\": 4100,\n    \"total_tax\": 328,\n    \"order_amount_incl_tax\": 4428,\n    \"expected_points\": 10,\n    \"total_items\": 12\n  }\n}\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 \u65e5\u9ad8 \u51cc  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": "\u30b3\u30fc\u30d7\u3053\u3046\u3079\u306e\u5b85\u914d\u306e\u6ce8\u6587\u66f8(CSV)\u3092\u30d1\u30fc\u30b9\u3059\u308bPython\u30d1\u30c3\u30b1\u30fc\u30b8",
    "version": "0.1.2",
    "project_urls": {
        "Changelog": "https://github.com/ryohidaka/blob/main/coop-kobe-parser/CHANGELOG.md",
        "Homepage": "https://github.com/ryohidaka/coop-kobe-parser",
        "Issues": "https://github.com/ryohidaka/coop-kobe-parser/issues",
        "Repository": "https://github.com/ryohidaka/coop-kobe-parser"
    },
    "split_keywords": [
        "coop",
        " csv",
        " japan",
        " japanese",
        " parser"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0c738f0b4871aa74e563c3deaae2f47c9ceac782d8aed9c942e5342940068590",
                "md5": "5d6c7a1fb0257c6f28e4b1c39cc3628a",
                "sha256": "11bb65bede851cf8e624887abe19b620e21bc62f877a33cba12796102c80fdc2"
            },
            "downloads": -1,
            "filename": "coop_kobe_parser-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5d6c7a1fb0257c6f28e4b1c39cc3628a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 8505,
            "upload_time": "2024-06-29T15:05:08",
            "upload_time_iso_8601": "2024-06-29T15:05:08.998767Z",
            "url": "https://files.pythonhosted.org/packages/0c/73/8f0b4871aa74e563c3deaae2f47c9ceac782d8aed9c942e5342940068590/coop_kobe_parser-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dcc31354510adaae0b8cba7ecf05d6626a07397c01863183e639bcbd7c1275d9",
                "md5": "8b3ab6369908e678e8bf8439bc75c6bb",
                "sha256": "89812f128175f99b526fde05cad09aa42d0af5e5a6ff547fe117900eaed1992d"
            },
            "downloads": -1,
            "filename": "coop_kobe_parser-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "8b3ab6369908e678e8bf8439bc75c6bb",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 7972,
            "upload_time": "2024-06-29T15:05:10",
            "upload_time_iso_8601": "2024-06-29T15:05:10.705420Z",
            "url": "https://files.pythonhosted.org/packages/dc/c3/1354510adaae0b8cba7ecf05d6626a07397c01863183e639bcbd7c1275d9/coop_kobe_parser-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-29 15:05:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ryohidaka",
    "github_project": "blob",
    "github_not_found": true,
    "lcname": "coop-kobe-parser"
}
        
Elapsed time: 0.56093s