@@ -12,42 +12,53 @@ def run():
1212
1313 # We recommend storing your secret keys in environment variables instead---it's safer!
1414 # for client-side requests (browser/mobile), use this code:
15- key = os .environ ['SMARTY_AUTH_WEB' ]
16- hostname = os .environ ['SMARTY_WEBSITE_DOMAIN' ]
15+ # key = os.environ['SMARTY_AUTH_WEB']
16+ # hostname = os.environ['SMARTY_WEBSITE_DOMAIN']
1717
18- credentials = SharedCredentials (key , hostname )
18+ # credentials = SharedCredentials(key, hostname)
1919
2020 # for server-to-server requests, use this code:
21- # auth_id = os.environ['SMARTY_AUTH_ID']
22- # auth_token = os.environ['SMARTY_AUTH_TOKEN']
21+ auth_id = os .environ ['SMARTY_AUTH_ID' ]
22+ auth_token = os .environ ['SMARTY_AUTH_TOKEN' ]
2323 #
24- # credentials = StaticCredentials(auth_id, auth_token)
24+ credentials = StaticCredentials (auth_id , auth_token )
25+
26+ client = ClientBuilder (credentials ).build_us_enrichment_api_client ()
2527
26- # The appropriate license values to be used for your subscriptions
27- # can be found on the Subscriptions page of the account dashboard.
28- # https://www.smartystreets.com/docs/cloud/licensing
29- client = ClientBuilder (credentials ).with_licenses (["us-property-data-principal-cloud" ]).build_us_enrichment_api_client ()
3028 # client = ClientBuilder(credentials).with_custom_header({'User-Agent': 'smartystreets (python@0.0.0)', 'Content-Type': 'application/json'}).build_us_enrichment_api_client()
3129 # client = ClientBuilder(credentials).with_http_proxy('localhost:8080', 'user', 'password').build_us_street_api_client()
3230 # Uncomment the line above to try it with a proxy instead
3331
34- smarty_key = "325023201 "
32+ smarty_key = "87844267 "
3533
3634 lookup = EnrichmentLookup ()
3735 freeform_lookup = EnrichmentLookup ()
3836
39- lookup .street = "56 Union Ave"
40- lookup .city = "Somerville"
41- lookup .state = "NJ"
42- lookup .zipcode = "08876"
37+ lookup .smartykey = smarty_key
38+ # lookup.street = "56 Union Ave"
39+ # lookup.city = "Somerville"
40+ # lookup.state = "NJ"
41+ # lookup.zipcode = "08876"
42+ lookup .features = "financial"
43+
44+ # Uncomment the below lines to add attributes to the "include" parameter
45+ # lookup.add_include_attribute('assessed_improvement_percent')
46+ # lookup.add_include_attribute('assessed_improvement_value')
47+
48+ # Uncomment the below lines to add attributes to the "exclude" parameter
49+ # lookup.add_exclude_attribute('assessed_land_value')
50+ # lookup.add_exclude_attribute('assessed_value')
51+
52+ # Uncomment the below line to add a custom parameter
53+ # lookup.add_custom_parameter("parameter", "value")
4354
4455 freeform_lookup .freeform = "56 Union Ave Somerville NJ 08876"
4556
4657 try :
4758 # use the below line to send a lookup with a smarty key
48- results = client .send_property_principal_lookup (smarty_key )
59+ # results = client.send_property_principal_lookup(smarty_key)
4960 # Or, uncomment the below line to send a lookup with an address in components
50- # results = client.send_property_principal_lookup(lookup)
61+ results = client .send_property_principal_lookup (lookup )
5162 # Or, uncomment the below line to send a lookup with an address in freeform
5263 # results = client.send_property_principal_lookup(freeform_lookup)
5364
0 commit comments