-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from Kyash/feature/get-ready-for-oss
Feature/get ready for oss
- Loading branch information
Showing
12 changed files
with
309 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (c) 2024 Kyash Inc | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# zengin-go | ||
|
||
**zengin-go** は、日本の銀行が金融取引を行うために一般的に使用する全銀フォーマットのテキストファイルを解析するためのGoライブラリです。 | ||
|
||
## 特徴 | ||
|
||
- 全銀フォーマットのテキストファイルを解析し、CSV形式のデータまたはすべてのフィールドを含むGo構造体として取得できます。 | ||
- UTF-8およびShift-JISの両方のエンコーディングをサポートし、他のエンコーディングもサポートする可能性があります(未テスト)。 | ||
|
||
## インターフェース | ||
|
||
このライブラリは、全銀フォーマットのテキストファイルをCSV形式のデータまたはGo構造体に変換するために使用できます。 | ||
|
||
```go | ||
// 全銀フォーマットファイルを解析し、すべてのフィールドを含む行を返します | ||
func Parse(reader zengin.Reader) ([]types.Transfer, error) | ||
|
||
// 全銀フォーマットファイルを解析し、以下のフィールド名を持つCSV形式のテーブルを返します | ||
// SenderName,TransferDate,BankCode,BranchCode,AccountType,AccountNumber,AccountName,Amount | ||
func ToCSV(reader zengin.Reader) ([][]string, error) | ||
|
||
// 全銀フォーマットファイルを解析し、以下のフィールド名を持つCSV形式のテーブルを返します | ||
// 振込名義人, 振込日, 金融機関コード, 支店コード, 科目, 口座番号, 口座名義人, 金額 | ||
func ToCSVJa(reader zengin.Reader) ([][]string, error) | ||
``` | ||
|
||
解析可能なフィールドは [types/fields.go](./types/fields.go) にあります。 | ||
|
||
|
||
## インストール | ||
|
||
このライブラリをインストールするには、`go get` コマンドを使用します: | ||
|
||
```bash | ||
go get github.com/Kyash/zengin-go | ||
``` | ||
|
||
## 使用方法 | ||
|
||
[サンプル](./samples/main.go)を参照にしてください。 | ||
|
||
## コントリビュート | ||
|
||
問題や機能リクエストがある場合は、イシューを作成するかプルリクエストを作ってください。 | ||
|
||
## ライセンス | ||
|
||
このプロジェクトはMITライセンスの下でライセンスされています。詳細については [LICENSE](./LICENSE) ファイルを参照してください。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,50 @@ | ||
# zengin-go | ||
全銀フォーマット用のライブラリ | ||
|
||
[Japanese](./README.ja.md) | ||
|
||
**zengin-go** is a Go library designed to parse Zengin format text files, | ||
which are commonly used by Japanese banks to conduct financial transactions. | ||
|
||
## Features | ||
|
||
- Parses Zengin format text files (全銀フォーマット) and get CSV-like data or all the fields as a go struct. | ||
- Supports both UTF-8 and Shift-JIS encodings and possibly other encodings (not tested). | ||
|
||
## Interface | ||
|
||
The library can be used to convert Zengin format text files into CSV-like data or Go structs. | ||
```go | ||
// Parse Zengin format file and return rows with all fields | ||
func Parse(reader zengin.Reader) ([]types.Transfer, error) | ||
|
||
// Parse Zengin format file and return a csv like table with field names as below: | ||
// SenderName,TransferDate,BankCode,BranchCode,AccountType,AccountNumber,AccountName,Amount | ||
func ToCSV(reader zengin.Reader) ([][]string, error) | ||
|
||
// Parse Zengin format file and return a csv like table with field names as below: | ||
// 振込名義人,振込日,金融機関コード,支店コード,科目,口座番号,口座名義人,金額 | ||
func ToCSVJa(reader zengin.Reader) ([][]string, error) { | ||
``` | ||
Parsable fields can be found in [types/fields.go](./types/fields.go). | ||
## Installation | ||
To install the library, use the `go get` command: | ||
```bash | ||
go get github.com/Kyash/zengin-go | ||
``` | ||
## Usage | ||
See [sample](./samples/main.go) | ||
## Contributing | ||
If there are any issues or feature requests, please create an issue or a pull request. | ||
## License | ||
This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.