Skip to content

Installation

Amir Iranmanesh edited this page Aug 11, 2026 · 2 revisions

Installation

go get github.com/amiranmanesh/go-persian-tools@latest

Pin a specific version:

go get github.com/amiranmanesh/go-persian-tools@v1.1.0

Requirements

  • Go 1.22+
  • No dependencies. Adding this module adds exactly one line to your go.mod and nothing to your go.sum.

Importing

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"
)

The command line tool

go install github.com/amiranmanesh/go-persian-tools/cmd/persian-tools@latest

Or 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.

Upgrading from v1.0.x

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 / PaymentId fields of bill.Params are now BillID / PaymentID. Struct fields cannot be aliased, so this is the one rename that is not source-compatible.
  • DigitToWord now emits grammatically correct Persian, with the ูˆ conjunctions the old library dropped.

Clone this wiki locally