forked from persian-tools/go-persian-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Installation
Amir Iranmanesh edited this page Aug 11, 2026
·
2 revisions
go get github.com/amiranmanesh/go-persian-tools@latestPin a specific version:
go get github.com/amiranmanesh/go-persian-tools@v1.1.0- Go 1.22+
- No dependencies. Adding this module adds exactly one line to your
go.modand nothing to yourgo.sum.
Import only the sub-packages you need:
import (
"github.com/amiranmanesh/go-persian-tools/bank"
"github.com/amiranmanesh/go-persian-tools/bill"
"github.com/amiranmanesh/go-persian-tools/digit"
"github.com/amiranmanesh/go-persian-tools/nationalid"
"github.com/amiranmanesh/go-persian-tools/phonenumbers"
"github.com/amiranmanesh/go-persian-tools/text"
)go install github.com/amiranmanesh/go-persian-tools/cmd/persian-tools@latestOr run it without installing anything:
docker run --rm ghcr.io/amiranmanesh/go-persian-tools:latest normalize "ุนูู ูุฑูู
"Prebuilt binaries for Linux, macOS and Windows (amd64 and arm64) are attached to
every release, with
checksums.txt to verify them.
Everything still compiles. Four names were renamed to match Go's conventions and the old ones remain as deprecated aliases:
| Old | New |
|---|---|
bill.BillParams |
bill.Params |
digit.DigitToWord |
digit.ToWord |
nationalid.IPlaceByNationalId |
nationalid.Place |
nationalid.GetPlaceByIranNationalId |
nationalid.GetPlaceByIranNationalID |
Two things do change behavior:
- The
BillId/PaymentIdfields ofbill.Paramsare nowBillID/PaymentID. Struct fields cannot be aliased, so this is the one rename that is not source-compatible. -
DigitToWordnow emits grammatically correct Persian, with theูconjunctions the old library dropped.
Packages
Project