"packing slip" objects) without subclassing. (This is particularly useful if |
"packing slip" objects) without subclassing. (This is particularly useful if |
you are extending a CRM or other database that was written by somebody else.) |
you are extending a CRM or other database that was written by somebody else.) |
|
|
|
This version of PyDicia is an alpha proof-of-concept release. It is actually |
|
usable -- I've already used it to print about a dozen international shipping |
|
labels to almost as many countries. However, the API is subject to change, |
|
the reference documentation is sketchy, and the developer's guide lacks detail |
|
about some of the more advanced features. This should improve in future |
|
releases, but I just want to get this milestone out to start with. Reading the |
|
DAZzle XML API specification is a good idea if you want to use this; make sure |
|
you get the 7.0.x version, as that's required. |
|
|
PyDicia uses the ElementTree, simplegeneric, and DecoratorTools packages, and |
PyDicia uses the ElementTree, simplegeneric, and DecoratorTools packages, and |
requires Python 2.4 or higher (due to use of decorators and the ``Decimal`` |
requires Python 2.4 or higher (due to use of decorators and the ``Decimal`` |
type). |
type). It also requires MS Windows (due to DAZzle only being available on |
|
that platform). Actually printing any labels requires that you have an Endicia |
|
"premium" account. |
|
|
IMPORTANT |
IMPORTANT |
Please note that PyDicia does not attempt to implement all of the US Postal |
Please note that PyDicia does not attempt to implement all of the US Postal |
been warned! |
been warned! |
|
|
|
|
TODO: |
.. contents:: **Table of Contents** |
|
|
* Launching for multi-batch, remote, queued, and other async processing |
|
|
|
|
|
|
|
----------------- |
----------------- |
|
|
The ``add_package()`` method accepts zero or more objects that can manipulate |
The ``add_package()`` method accepts zero or more objects that can manipulate |
PyDicia package objects. It also accepts tuples or lists of such objects, |
PyDicia package objects. It also accepts tuples or lists of such objects, |
nested to arbitrary depth. |
nested to arbitrary depth:: |
|
|
>>> b.add_package([Services.COD, (Stealth, ToName('Ty Sarna'))], FlatRateBox) |
>>> b.add_package([Services.COD, (Stealth, ToName('Ty Sarna'))], FlatRateBox) |
|
|
(ala ``subprocess.call``). |
(ala ``subprocess.call``). |
|
|
XXX async batch status retrieval |
XXX async batch status retrieval |
|
|
XXX DAZzle.exe_path, DAZzle.get_preference(), DAZzle.LayoutDirectory |
XXX DAZzle.exe_path, DAZzle.get_preference(), DAZzle.LayoutDirectory |
|
|
|
XXX Launching for multi-batch, remote, queued, and other async processing |
|
|
|
|
|
|
Advanced Customization |
Advanced Customization |
====================== |
====================== |
|
|
Using Option elements, add_to_package() |
XXX Using Option elements, add_to_package() |
|
|
|
|
|
|
Basic Package Options |
Basic Package Options |
===================== |
===================== |
|
|
MailClass(text), NoPostage |
XXX MailClass(text), NoPostage |
|
|
DateAdvance(), Today, Tomorrow |
DateAdvance(), Today, Tomorrow |
Value() |
Value() |
Description() |
Description() |
Addresses |
Addresses |
========= |
========= |
|
|
|
:: |
>>> ToName("Phillip J. Eby") |
>>> ToName("Phillip J. Eby") |
ToName('Phillip J. Eby') |
ToName('Phillip J. Eby') |
|
|
ToCompany('Dirt Simple, Inc.') |
ToCompany('Dirt Simple, Inc.') |
|
|
|
|
ToAddress(*lines) |
XXX ToAddress(\*lines) |
ToCity(text), ToState(text), ToPostalCode(text), ToZIP4(text), ToCountry(text) |
ToCity(text), ToState(text), ToPostalCode(text), ToZIP4(text), ToCountry(text) |
|
|
ReturnAddress(*lines) |
XXX ReturnAddress(\*lines) |
|
|
ToDeliveryPoint(text) |
ToDeliveryPoint(text) |
EndorsementLine(text) |
EndorsementLine(text) |
ToCarrierRoute(text) |
ToCarrierRoute(text) |
Package Details |
Package Details |
=============== |
=============== |
|
|
PackageType() |
XXX PackageType() |
FlatRateEnvelope |
FlatRateEnvelope |
FlatRateBox |
FlatRateBox |
RectangularParcel |
RectangularParcel |
Postcard |
Postcard |
Flat |
Flat |
Envelope |
Envelope |
|
|
Width(), Length(), Depth() |
Width(), Length(), Depth() |
|
|
NonMachinable |
NonMachinable |
BalloonRate |
BalloonRate |
|
|
|
|
|
|
Service Options |
Service Options |
=============== |
=============== |
|
|
ReplyPostage |
XXX ReplyPostage |
Stealth |
Stealth |
|
|
SignatureWaiver |
SignatureWaiver |
NoWeekendDelivery |
NoWeekendDelivery |
NoHolidayDelivery |
NoHolidayDelivery |
ReturnToSender |
ReturnToSender |
|
|
Insurance.USPS |
Insurance.USPS |
Insurance.Endicia |
Insurance.Endicia |
Insurance.UPIC |
Insurance.UPIC |
Insurance.NONE |
Insurance.NONE |
|
|
Services.RegisteredMail |
Services.RegisteredMail |
Services.CertifiedMail |
Services.CertifiedMail |
Services.RestrictedDelivery |
Services.RestrictedDelivery |
Services.DeliveryConfirmation |
Services.DeliveryConfirmation |
Services.SignatureConfirmation |
Services.SignatureConfirmation |
Services.COD |
Services.COD |
|
|
Services.InsuredMail() |
Services.InsuredMail() |
|
|
|
|
Processing Options |
Processing Options |
================== |
================== |
|
|
DAZzle.Test |
XXX DAZzle.Test |
DAZzle.Layout(filename) |
DAZzle.Layout(filename) |
DAZzle.OutputFile(filename) |
DAZzle.OutputFile(filename) |
DAZzle.Print |
DAZzle.Print |
DAZzle.Verify |
DAZzle.Verify |
|
|
DAZzle.SkipUnverified |
DAZzle.SkipUnverified |
DAZzle.AutoClose |
DAZzle.AutoClose |
DAZzle.Prompt |
DAZzle.Prompt |
DAZzle.AbortOnError |
DAZzle.AbortOnError |
DAZzle.AutoPrintCustomsForms |
DAZzle.AutoPrintCustomsForms |
|
|
DAZzle.XMLDirectory |
DAZzle.XMLDirectory |
DAZzle.LayoutDirectory |
DAZzle.LayoutDirectory |
DAZzle.exe_path |
DAZzle.exe_path |
Miscellaneous |
Miscellaneous |
============= |
============= |
|
|
RubberStamp(n, text) |
XXX RubberStamp(n, text) |
ReferenceID(text) |
ReferenceID(text) |
CostCenter(int) |
CostCenter(int) |
|
|
Internals and Tests |
Internals and Tests |
------------------- |
------------------- |
|
|
|
Misc imports for tests:: |
|
|
>>> from pydicia import add_to_package, ET, Option, Batch, Package |
>>> from pydicia import add_to_package, ET, Option, Batch, Package |
|
|
Packages:: |
Packages:: |
</Package> |
</Package> |
</DAZzle> |
</DAZzle> |
|
|
|
|
Option inversion:: |
Option inversion:: |
|
|
>>> ~Envelope |
>>> ~Envelope |