Skip to content
This repository was archived by the owner on May 23, 2025. It is now read-only.

democracyworks/imbarcode

Repository files navigation

imbarcode

A Clojure/ClojureScript library designed to generate USPS Intelligent Mail Barcodes. The core functionality is in imbarcode.core/encode. Given the necessary parameters, this will output a string representing the extenders in the computed barcode.

See https://ribbs.usps.gov/onecodesolution for a complete specification of USPS Intelligent Mail Barcodes, a font file to properly display your encoded barcode, and other useful resources.

Installation

The library is available as a Maven artifact from Clojars.

Latest version badge for democracyworks/imbarcode

Usage

The top-level encoding functionality is provided in the imbarcode.core namespace.

Require it in the REPL:

(require '[imbarcode.core :as imb])

Require it in your application:

(ns my-app.core
  (:require [imbarcode.core :as imb]))
user=> ; Destination tracing
user=> (imb/encode imb/barcode-id:default imb/service-type-id:destination "123456789" "123456" "123456789")
"ADFFDTDATDTDDDTTDTTFTFFAFTATFATATDATDDDDDFDAFAFFATTADDTATDDDAFFFA"
user=> ; Origin tracing
user=> (imb/encode imb/barcode-id:default imb/service-type-id:origin "999888777666555" "012345678")
"FAADADDDTAFTAFDFFTDAADADTAFTTDATAAFTAFTTFAATAAFTFATDTFATFFTATTAAF"

See resources/public/dev-index.html and resources/public/index.html for examples of usage in ClojureScript

Development

To run all the tests (Clojure and ClojureScript):

lein test

To run just the Clojure tests:

lein clj-test

To run just the ClojureScript tests:

lein cljs-test

License

Copyright (C) 2014-2016 Democracy Works, Inc.

Distributed under the Eclipse Public License, the same as Clojure.

About

Generate USPS Intelligent Mail Barcodes

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 6