diff --git a/examples/README.md b/examples/README.md index 4cf2e2c..f9eaa02 100644 --- a/examples/README.md +++ b/examples/README.md @@ -2,17 +2,50 @@ Here we have put together a hand full of python examples to help get you started. As always feel free to [contact us](https://lob.com/support) directly if you have any questions on implementation. +## Getting started +Before running these examples make sure you are in the `examples/` directory. +``` +cd examples/ +``` -## csv_address_verification - -An example showing how to validate and cleanse a CSV spreadsheet full of shipping addresses using Lob's [Address Verifcation API](https://lob.com/verification/address). +## Examples -## csv_postcards +### Create postcards from CSV -An example showing how to dynamically create postcards from a CSV using HTML, a custom font, variable data, and Lob's [Postcard API](https://lob.com/services/postcards). +An example showing how to dynamically create postcards from a CSV using HTML, a custom font, variable data, and Lob's [Postcard API](https://lob.com/services/postcards). In order to run the program enter: -```python -python create_postcards.py input.csv +``` +cd create_postcards_from_csv/ +python create_postcards_from_csv.py input.csv +``` + +### Verify addresses from CSV + +An example showing how to validate and cleanse a CSV spreadsheet full of shipping addresses using Lob's [Address Verification API](https://lob.com/verification/address). + +``` +cd verify_addresses_from_csv/ +python verify_addresses_from_csv.py input.csv +``` + +### Create a check +``` +python check.py +``` + +### Create a job +``` +python job.py +``` + +### Create a letter +``` +python letter.py +``` + +### Create a postcard +``` +python postcard.py ``` diff --git a/examples/check.py b/examples/check.py index 095ea88..0cc8e95 100644 --- a/examples/check.py +++ b/examples/check.py @@ -1,3 +1,6 @@ +import sys, os +sys.path.insert(0, os.path.abspath(__file__+'../../..')) + import lob lob.api_key = "test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc" # Replace this API key with your own. diff --git a/examples/create_pdf.py b/examples/create_pdf.py deleted file mode 100644 index 5f5aab9..0000000 --- a/examples/create_pdf.py +++ /dev/null @@ -1,29 +0,0 @@ -import lob -import pdfkit - -lob.api_key = "test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc" # Replace this API key with your own. - -body = """ - -
- -