Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mavolin/standards
📄 Boringly simple parsing and validation for IBANs, BICs, ISO3166 alpha-2s, German Health Insurance Numbers, German Tax IDs, German Pension Insurance Numbers, and German Postal Codes.
https://github.com/mavolin/standards
bic german go golang health-insurance-number iban iso3166 iso3166-1 postal-code ssn tax-id validation
Last synced: about 2 months ago
JSON representation
📄 Boringly simple parsing and validation for IBANs, BICs, ISO3166 alpha-2s, German Health Insurance Numbers, German Tax IDs, German Pension Insurance Numbers, and German Postal Codes.
- Host: GitHub
- URL: https://github.com/mavolin/standards
- Owner: mavolin
- License: mit
- Created: 2023-01-20T18:36:13.000Z (almost 2 years ago)
- Default Branch: v1
- Last Pushed: 2024-06-29T20:50:29.000Z (6 months ago)
- Last Synced: 2024-06-29T21:40:09.781Z (6 months ago)
- Topics: bic, german, go, golang, health-insurance-number, iban, iso3166, iso3166-1, postal-code, ssn, tax-id, validation
- Language: Go
- Homepage:
- Size: 152 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
standards
[![Go Reference](https://pkg.go.dev/badge/github.com/mavolin/standards.svg)](https://pkg.go.dev/github.com/mavolin/standards)
[![Test](https://github.com/mavolin/standards/actions/workflows/test.yml/badge.svg)](https://github.com/mavolin/standards/actions)
[![Code Coverage](https://codecov.io/gh/mavolin/standards/branch/develop/graph/badge.svg?token=ewFEQGgMES)](https://codecov.io/gh/mavolin/standards)
[![Go Report Card](https://goreportcard.com/badge/github.com/mavolin/standards)](https://goreportcard.com/report/github.com/mavolin/standards)
[![License MIT](https://img.shields.io/github/license/mavolin/standards)](https://github.com/mavolin/standards/blob/develop/LICENSE)---
## About
Boringly simple parsing and validation for various notations.
## Supported Standards
* 🏦 BICs
* 💰 IBANs with country-specific BBAN validation
* 🏴☠️ ISO3166-1 Alpha2 (e.g. `DE`, or `ES`)
* 🚑 German Health Insurance Numbers (Krankenversicherungsnummern)
* 🧓 German Pension Insurance Numbers (Renten-/ Sozialversicherungsnummern)
* 💲 German Tax Identification Numbers (Steuer-IDs)
* ✉ German Postal Codes (Postleitzahlen)## Each Package Is the Same
Each standard is implemented in its own package,
and each package provides a type for the standard, e.g. `bic.BIC` for BICs.
That type contains all the information that can be extracted from the notation.```go
package bictype BIC struct {
BusinessPartyPrefix string
CountryCode string
BusinessPartySuffix string
BranchCode string
}
```Each type implements:
* `String() string` to get the notation pretty-printed
* `Compact() string` to get the notation in compact, machine-readable form
* `MarshalText() ([]byte, error)` same as `Compact`
* `UnmarshalText([]byte) error` to parse the notationAdditionally, each package provides these two functions:
* `Parse(string) (Type, error)` parses the given string, and validates it
* `IsValid(string) bool` simply checks whether the given string is valid in the given standard.## License
Built with ❤ by [Maximilian von Lindern](https://github.com/mavolin).
Available under the [MIT License](./LICENSE).