Skip to main content

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

Project description

coop-kobe-parser

PyPI version build License

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

Installation

You can install this library using PyPI:

pip install coop-kobe-parser

使用方法

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)

品番,商品名,本体価格,数量,小計
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

出力例

{
  "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 file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coop_kobe_parser-0.1.2.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

coop_kobe_parser-0.1.2-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file coop_kobe_parser-0.1.2.tar.gz.

File metadata

  • Download URL: coop_kobe_parser-0.1.2.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for coop_kobe_parser-0.1.2.tar.gz
Algorithm Hash digest
SHA256 89812f128175f99b526fde05cad09aa42d0af5e5a6ff547fe117900eaed1992d
MD5 8b3ab6369908e678e8bf8439bc75c6bb
BLAKE2b-256 dcc31354510adaae0b8cba7ecf05d6626a07397c01863183e639bcbd7c1275d9

See more details on using hashes here.

File details

Details for the file coop_kobe_parser-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for coop_kobe_parser-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 11bb65bede851cf8e624887abe19b620e21bc62f877a33cba12796102c80fdc2
MD5 5d6c7a1fb0257c6f28e4b1c39cc3628a
BLAKE2b-256 0c738f0b4871aa74e563c3deaae2f47c9ceac782d8aed9c942e5342940068590

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page