GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - unicod3/kargo: Kargo determines the carrier of a tracking number barcode and checks if that tracking number is valid

BranchesTags
Open more actions menu

Latest commit

 

History

60 Commits
60 Commits

Folders and files

NameName
Last commit message
Last commit date
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
fedex.go
fedex.go
 
 
fedex_test.go
fedex_test.go
 
 
kargo.go
kargo.go
 
 
kargo_test.go
kargo_test.go
 
 
package.go
package.go
 
 
package_test.go
package_test.go
 
 
ups.go
ups.go
 
 
ups_test.go
ups_test.go
 
 
usps.go
usps.go
 
 
usps_test.go
usps_test.go
 
 

Repository files navigation

LogoKargo

GoDoc Build Status Coverage Status

Kargo determines carrier of the tracking number barcode and checks if that tracking number barcode is valid by matching the format and calculating checksum validity. Feel free to create pull requests and issues.

Package supports

  • UPS
  • FedEx Express
  • FedEx Ground "96"
  • USPS IMpb
  • USPS UPU S10
  • USPS 20

But more on the way

  • DHL

Install

go get github.com/unicod3/kargo

Usage and Examples

Kargo's usage is pretty straight forward, supply a tracking number and get the Package struct

package main

import (
	"fmt"
	"github.com/unicod3/kargo"
)

func main() {
	pkg, err := kargo.Identify("1Z999AA10123456784")
	if err != nil {
		fmt.Println(err)
	}

	var trackingNumber string = pkg.TrackingNumber
	var carrier string = pkg.Carrier
	var isValid bool = pkg.IsValid
	fmt.Printf("Tracking Number: %v, Carrier: %v, Is Valid: %t",
		trackingNumber, carrier, isValid)
}

Output: Tracking Number: 1Z999AA10123456784, Carrier: UPS, Is Valid: true

For more examples please check out the test files.

Running the tests

You can run tests with standard test tool of Go:

go test -v 

Changelog

Version 1.1.2

  • Added support for USPS; IMpb, UPU S10, 20 character barcodes
  • Removed the unnecessary prefix from filenames
  • Improved the tests

Version 1.0.1

  • Fix stringutils package dependency issue

Version 1.0.0

  • Initial release

License

GNU General Public License v3.0 - see LICENSE for more details

About

Kargo determines the carrier of a tracking number barcode and checks if that tracking number is valid

Topics

carrierchecksum-calculationfedexkargotracking-numberupsusps

Resources

Readme
GPL-3.0 license
Activity

Stars

34 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.