diff --git a/examples/example.py b/examples/check.py similarity index 54% rename from examples/example.py rename to examples/check.py index 58d77d0..6fdcd40 100644 --- a/examples/example.py +++ b/examples/check.py @@ -4,12 +4,12 @@ # Creating an Address Object example_address = lob.Address.create( - name='Joe Smith', - address_line1='104, Printing Boulevard', - address_city='Boston', - address_state='MA', - address_country='US', - address_zip='12345' + name = 'Joe Smith', + address_line1 = '104, Printing Boulevard', + address_city = 'Boston', + address_state = 'MA', + address_country = 'US', + address_zip = '12345' ) print "\n" print "Address Response" @@ -21,61 +21,7 @@ print "=======================================================" print "\n" -# Creating an Object - -example_object = lob.Object.create( - name='Example Object', - file='https://www.lob.com/test.pdf', - setting_id='201', - quantity=1, - double_sided=1 -) - -print "Object Response" -print "\n" -print "=======================================================" -print "\n" -print example_object -print "\n" -print "=======================================================" -print "\n" - -# Creating a Job using the previously created address and object - -example_job = lob.Job.create( - to_address = example_address, - from_address = example_address, - objects = example_object, -) - -print "Job Response" -print "\n" -print "=======================================================" -print "\n" -print example_job -print "\n" -print "=======================================================" -print "\n" - -# Creating a Postcard - -example_postcard = lob.Postcard.create( - to_address = example_address, - from_address = example_address, - front = 'https://www.lob.com/test.pdf', - back = 'https://www.lob.com/test.pdf' -) - -print "Postcard Response" -print "\n" -print "=======================================================" -print "\n" -print example_postcard -print "\n" -print "=======================================================" -print "\n" - -# Creating a Bank Account +# Creating a Bank Account using the previously created account_address example_bank_account = lob.BankAccount.create( routing_number = '123456789', diff --git a/examples/job.py b/examples/job.py new file mode 100644 index 0000000..34c5ec7 --- /dev/null +++ b/examples/job.py @@ -0,0 +1,58 @@ +import lob +lob.api_key = "test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc" # Replace this API key with your own. + +# Creating an Address Object + +example_address = lob.Address.create( + name = 'Joe Smith', + address_line1 = '104, Printing Boulevard', + address_city = 'Boston', + address_state = 'MA', + address_country = 'US', + address_zip = '12345' +) +print "\n" +print "Address Response" +print "\n" +print "=======================================================" +print "\n" +print example_address +print "\n" +print "=======================================================" +print "\n" + +# Creating an Object + +example_object = lob.Object.create( + name = 'Example Object', + file = 'https://www.lob.com/test.pdf', + setting_id = '201', + quantity = 1, + double_sided = 1 +) + +print "Object Response" +print "\n" +print "=======================================================" +print "\n" +print example_object +print "\n" +print "=======================================================" +print "\n" + +# Creating a Job using the previously created address and object + +example_job = lob.Job.create( + to_address = example_address, + from_address = example_address, + objects = example_object, +) + +print "Job Response" +print "\n" +print "=======================================================" +print "\n" +print example_job +print "\n" +print "=======================================================" +print "\n" diff --git a/examples/postcard.py b/examples/postcard.py new file mode 100644 index 0000000..c60ac1d --- /dev/null +++ b/examples/postcard.py @@ -0,0 +1,40 @@ +import lob +lob.api_key = "test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc" # Replace this API key with your own. + +# Creating an Address Object + +example_address = lob.Address.create( + name = 'Joe Smith', + address_line1 = '104, Printing Boulevard', + address_city = 'Boston', + address_state = 'MA', + address_country = 'US', + address_zip = '12345' +) +print "\n" +print "Address Response" +print "\n" +print "=======================================================" +print "\n" +print example_address +print "\n" +print "=======================================================" +print "\n" + +# Creating a Postcard + +example_postcard = lob.Postcard.create( + to_address = example_address, + from_address = example_address, + front = 'https://www.lob.com/test.pdf', + back = 'https://www.lob.com/test.pdf' +) + +print "Postcard Response" +print "\n" +print "=======================================================" +print "\n" +print example_postcard +print "\n" +print "=======================================================" +print "\n"