Giter VIP home page Giter VIP logo

pizzapi's Introduction

pizzapi

Description

This is a Python wrapper for the Dominos Pizza API.

It's a port of the pizzapi node.js module written by RIAEvangelist.

Quick Start

Pull the module into your namespace:

from pizzapi import *

First, construct a Customer object and set the customer's address:

customer = Customer('Donald', 'Trump', '[email protected]', '2024561111')
address = Address('700 Pennsylvania Avenue NW', 'Washington', 'DC', '20408')

Then, find a store that will deliver to the address.

store = address.closest_store()

In order to add items to your order, you'll need the items' product codes. To find the codes, get the menu from the store, then search for items you want to add. You can do this by asking your Store object for its Menu.

menu = store.get_menu()

Then search menu with menu.search. For example, running this command:

menu.search(Name='Coke')

Should print this to the console:

20BCOKE    20oz Bottle Coke®        $1.89
20BDCOKE   20oz Bottle Diet Coke®   $1.89
D20BZRO    20oz Bottle Coke Zero™   $1.89
2LDCOKE    2-Liter Diet Coke®       $2.99
2LCOKE     2-Liter Coke®            $2.99

After you've found your items' product codes, you can create an Order object add add your items:

order = Order(store, customer, address)
order.add_item('P12IPAZA') # add a 12-inch pan pizza
order.add_item('MARINARA') # with an extra marinara cup
order.add_item('20BCOKE')  # and a 20oz bottle of coke

You can remove items as well!

order.remove_item('20BCOKE')

Wrap your credit card information in a PaymentObject:

card = PaymentObject('4100123422343234', '0115', '777', '90210')

And that's it! Now you can place your order.

order.place(card)

Or if you're just testing and don't want to actually order something, use .pay_with.

order.pay_with(card)

pizzapi's People

Contributors

aluttik avatar cb-ndow avatar craigjmidwinter avatar danielorf avatar ggrammar avatar madison-ehlers avatar patoconnor43 avatar wrighterase avatar zedin27 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pizzapi's Issues

Placing orders

Does the place function still work for placing orders? It doesn't seem like the orders I'm sending are actually going through to the store. After running .place on a order with valid card the program sits for a second then finishes execution without any output or errors.

It looks like the tracker doesn't work because the trkweb url isn't in use anymore.

No local stores are currently open

When I put my address in, I get this:

Hackers-Air:pizzapi-master fantratic$ python3 tutorial.py
Traceback (most recent call last):
File "tutorial.py", line 31, in
my_local_dominos = StoreLocator.find_closest_store_to_customer(customer)
File "/Users/fantratic/Downloads/pizzapi-master/pizzapi-master/pizzapy/store.py", line 61, in find_closest_store_to_customer
raise Exception('No local stores are currently open')
Exception: No local stores are currently open

Domino's is literally 5 minutes away from my house.

Inconsistent use of tabs and spaces

Forgive my python inexperience, I come from the .net world:

I’m trying to use this library in an application of mine. I must use python3. On startup, python complains of an inconsistent use of tabs and spaces in Order.py, line 130. Is there a workaround or fix for this?

I’ve installed via pip3 if that helps.

Thanks

Traceback (most recent call last): File "pizza.py", line 10, in <module> from pizzapi import * File "/usr/local/lib/python3.5/dist-packages/pizzapi/__init__.py", line 5, in <module> from .order import Order File "/usr/local/lib/python3.5/dist-packages/pizzapi/order.py", line 130 return response ^ TabError: inconsistent use of tabs and spaces in indentation

Order custom pizzas

I think it would be cool to have a Pizza object, and a Menu.search_topping() function, where we could do something like this:

Menu.search_topping(Name="Cheese")
And that would return
NAME ID CHEESE CHESE
and then
cheese = "CHESE"
pizza = Pizza(Code="PIZZACODE")
pizza.add_toppping(cheese, AMOUNT)
ect....
Order.add_item(pizza)

Adding Toppings to Pizza

Hi @aluttik,

Did you have any ideas on how this should be implemented? It seems like picking toppings on the website and validating the order should have enough information to map what the letters mean for each topping. Is this something that you're already working on? If not, I may give it a shot this week.

Restructure Menu Categories

The Menu categorization that was taken from the pizzapi module were done well, however the product codes that were displayed are actually codes that describe categories, not codes that can be used to order items.

Re-organize the Menu object's data in a space efficient and intuitive way.

Does this still work, in countries other than US and Canada like France for example?

I've tried several things in the 3rd parameter of the adress object, here is the traceback :

Traceback (most recent call last):
  File "/home/marcman/projects/python/bin/../test.py", line 6, in <module>
    store = address.closest_store()
            ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/marcman/projects/python/lib/python3.12/site-packages/pizzapi/address.py", line 54, in closest_store
    stores = self.nearby_stores(service=service)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/marcman/projects/python/lib/python3.12/site-packages/pizzapi/address.py", line 49, in nearby_stores
    data = request_json(self.urls.find_url(), line1=self.line1, line2=self.line2, type=service)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/marcman/projects/python/lib/python3.12/site-packages/pizzapi/utils.py", line 16, in request_json
    r.raise_for_status()
  File "/home/marcman/projects/python/lib/python3.12/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://order.dominos.com/power/myaddresshere

SSLError

store = address.closest_store() File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pizzapi/address.py", line 54, in closest_store stores = self.nearby_stores(service=service) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pizzapi/address.py", line 49, in nearby_stores data = request_json(self.urls.find_url(), line1=self.line1, line2=self.line2, type=service) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pizzapi/utils.py", line 15, in request_json r = requests.get(url.format(**kwargs)) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/api.py", line 72, in get return request('get', url, params=params, **kwargs) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/api.py", line 58, in request return session.request(method=method, url=url, **kwargs) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/sessions.py", line 512, in request resp = self.send(prep, **send_kwargs) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/sessions.py", line 622, in send r = adapter.send(request, **kwargs) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/adapters.py", line 511, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='order.dominos.com', port=443): Max retries exceeded with url: /power/store-locator?s=MYADRESS&type=Delivery (Caused by SSLError(SSLError(1, u'[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:661)'),)) [Finished in 0.267s]

Any Idea what's going on here? I wrote my script last night and would say I've tested it 15-20 times since then using the order.pay_with() method. Have I really exceeded the retry limit or is something else happening? Any help is appreciated.

Add Address Parsing

Add an module to handle address parsing.
Maybe usaddress or postal-address?

Issue with order.py

I keep running into this issue:

order.place(card)
  File "/Users/sonic/Desktop/pizza_app/pizzapi/pizzapi/order.py", line 92, in place
    self.pay_with(card)

It has to do with the order.py file, but I'm not sure what's wrong with it. I cloned the master repository btw

'Customer' object has no attribute 'set_address'

set_address isn't defined anywhere that I can see.
`In [1]: from pizzapi import *

In [2]: customer = Customer('Barack', 'Obama', '[email protected]', '2024561111')

In [3]: customer.set_address('700 Pennsylvania Avenue NW', 'Washington', 'DC', '20408')

AttributeError Traceback (most recent call last)
in ()
----> 1 customer.set_address('700 Pennsylvania Avenue NW', 'Washington', 'DC', '20408')

AttributeError: 'Customer' object has no attribute 'set_address'`

store.get_menu raised an exception

this is my code

from pizzapi import *




print("Order dominos")
fname = input("What is your first name? : ")
lname = input('What is your last name? : ')
email = input("What is your email? : ")
phonenum = input("What is your phone number? : ")
customer = Customer(fname, lname, email, phonenum)


stradd = input("What is your street address? : ")
city = input("What is your city? : ")
state = input("What is your state? : ")
zip = input("What is your zip code? : ")
address = Address(stradd, city, state, zip)
store = address.closest_store()
print(f"{store} is your closest store. Would you still like to order? ")
yn = input("Yes or no? [y,n]")
if yn == "y":
  print("Ok hold on")
  menu = store.get_menu()
  menu.search(Name='Pizza')
  print(f"{menu}")
  print("Please respond with your product code")
  code = input("Code ? : ")
  order = Order(store, customer, address)
  order.add_item(code) 
  cnum = input("Card number? ")
  exp = input("Card expiration date? ")
  cvv = input("Card security code? ")
  card = PaymentObject(cnum, exp, cvv, zip)
  order.pay_with(card)
  
  
else:
  print("Ok i wont order")

and this is the error

Traceback (most recent call last):
  File "main.py", line 24, in <module>
    menu = store.get_menu()
  File "/home/runner/dominos-bot/venv/lib/python3.8/site-packages/pizzapi/store.py", line 24, in get_menu
    menu = Menu(response, self.country)
  File "/home/runner/dominos-bot/venv/lib/python3.8/site-packages/pizzapi/menu.py", line 50, in __init__
    self.root_categories[key] = self.build_categories(value)
  File "/home/runner/dominos-bot/venv/lib/python3.8/site-packages/pizzapi/menu.py", line 62, in build_categories
    new_subcategory = self.build_categories(subcategory, category)
  File "/home/runner/dominos-bot/venv/lib/python3.8/site-packages/pizzapi/menu.py", line 66, in build_categories
    raise Exception('PRODUCT NOT FOUND: %s %s' % (product_code, category.code))
Exception: PRODUCT NOT FOUND: 5156 CouponPizza

BUG: order initialization should have a credit_card arg

The README example(s) order.pay_with(card) and order.place(card) do not currently work because an order object expects to have a credit_card attribute. The function signature for order should have a credit_card attribute set to None:

def init(self, store, customer, address, credit_card=None, country=COUNTRY_USA):

And then the pay_with method should check if self.credit_card is None

I can contribute a fix if you'd like!

Not ordering

I ordered it says order placed for my name but nothing happened I called and they didn't have a order for my address checked to make sure it was right and it was

get price failed

I'm getting an exception saying "get price failed:" followed by a lot of information about the order (such as address, items, size, qty, store, etc) whenever I try to complete an order (with either pay_with() or place()). It's being raised in line 108 of order.py in the pay_with() method which is after checking "if response['Status'] == -1:" Any ideas what the issue could be/how to fix it?

Canadian addresses always raise a -1 status exception?

Hi there I've started messing around with this library a bit to make a discord bot for me and a group of friends to order pizzas through discord. I've gotten U.S. adresses working fine with the default settings and such but when I've been going in and trying with Canadian ones I've been getting an error raised in order.pay_with() Is this a known error/how could I fix it? I double checked and I am using the proper urls throughout and it adds to the order and shows the menu fine. Also has anyone discovered a way to add order instructions to it? I'd like to give the option to add that (or have a default one to be safe) but didn't seem to see that anywhere even in what's being sent that I could add/edit.

Thanks!

Cash

How do I use cash instead of credit card

Cash on delivery support!

Hi, can we order without providing the Credit Card information? Using the Cash on delivery option? Is it possible?

order.add_item throwing a self.menu.varients keyerror

for a fun side project i am making a linux program to order a pizza from the cli, I have run into a slight issue while using this api. Here is my code, thanks for all help.
`
import sys

import pizzapi.store
from pizzapi import *

customer_info = {
"First Name":"",
"Last Name":"",
"Address":"",
"City":"",
"State":"",
"Zipcode":"",
"Email":"",
"Phone": ""
}

order = []
order_id = []

if len(sys.argv) >= 2:
try:
if sys.argv[1] == '-name':
customer_info["First Name"] = sys.argv[2]
customer_info["Last Name"] = sys.argv[3]
assert "-" not in customer_info["First Name"] or customer_info["Last Name"]

    if "-email" in sys.argv:
        customer_info["Email"] = sys.argv[sys.argv.index("-email") + 1]

    if "-phone" in sys.argv:
        customer_info["Phone"] = sys.argv[sys.argv.index("-phone") + 1]

    try:
        address = Address(sys.argv[sys.argv.index("-address") + 1], sys.argv[sys.argv.index("-address") + 2], sys.argv[sys.argv.index("-address") + 3], sys.argv[sys.argv.index("-address") + 4])
        #print(sys.argv[sys.argv.index("-address") + 1], sys.argv[sys.argv.index("-address") + 2], sys.argv[sys.argv.index("-address") + 3], sys.argv[sys.argv.index("-address") + 4])
        customer_info["Address"] = sys.argv[sys.argv.index('-address') + 1]
    except ValueError:
        raise "-address isnt specified"

    try:
        card = PaymentObject(sys.argv[sys.argv.index("-card") + 1], sys.argv[sys.argv.index("-card") + 2], sys.argv[sys.argv.index("-card") + 3], sys.argv[sys.argv.index("-address") + 4])
        #print(sys.argv[sys.argv.index("-card") + 1], sys.argv[sys.argv.index("-card") + 2], sys.argv[sys.argv.index("-card") + 3], sys.argv[sys.argv.index("-address") + 4])
    except ValueError:
        raise "-card isnt specified"


    sys.argv.index("-order")
    for x in range(sys.argv.index("-order") + 1, len(sys.argv)):
        order.append(sys.argv[x])


except IndexError:
    None

"""
for x in customer_info:
print(customer_info[x])
DEBUG
for x in order:
print(x)
"""

if len(customer_info["First Name"]) and len(customer_info["First Name"]) and len(customer_info["Address"]) == 0:
print('Required field empty')
else:
address

try:
    store = address.closest_store()
    menu = store.get_menu()
    for x in order:
        print('')
        menu.search(Name=x)
        itemID = input(f'Which one! Please Type The Item ID:')
        order_id.append(itemID)

    order = Order(store, customer, address)
    for x in order_id:
        try:
            order.add_item(x)
        except ValueError:
            print('Invalid Order ID')

    print('\nYour Order Details! PLEASE REVIEW CAREFULLY!')
    print('Address: ',sys.argv[sys.argv.index("-address") + 1], sys.argv[sys.argv.index("-address") + 2], sys.argv[sys.argv.index("-address") + 3], sys.argv[sys.argv.index("-address") + 4])
    print('From Closest Store:')
    for x in range(order_id):
        print(order_id[x], order[x])

    confirmation = input('Place Order?! [y/n]:').lower()
    if confirmation == 'y':
        order.place(card)
    else:
        print('Ok :)')
        exit(0)


except ValueError:
    print('Sorry! No Dominos Stores Are Open Near You :( Regular Opening Times Are 10am')

print(order)
`

### with error
Traceback (most recent call last): File "C:\Users\stutzc\Desktop\pycharm\domino\pizzame.py", line 81, in <module> order.add_item(x) File "C:\Python310\lib\site-packages\pizzapi\order.py", line 41, in add_item item = self.menu.variants[code] KeyError: ''

Error when calling track_by_phone()

I tried to track my order using track_by_phone(), but I gave me an error. The error gave me info that contains personal info, so I can't show it to you. Could you please fix this

How to add a coupon in my order?

I tried to use one of the coupons from the list. In this case, I'm using the coupon number 9175 which is "Any Large Specialty Pizza". The number is supposed to retrieve the product code; but, in the function, add_coupon from the object class Order says missing 1 required positional argument: 'code'

What am I missing in here?

ConnectionError: HTTPSConnectionPool(host='order.dominos.com', port=443): Max retries exceeded with url: /power/store-locator?

ConnectionErrorTraceback (most recent call last)
in ()
----> 1 store = address.closest_store()

/Users/shajeelafzal/Untitled Folder/pizzapi/address.pyc in closest_store(self, service)
52
53 def closest_store(self, service='Delivery'):
---> 54 stores = self.nearby_stores(service=service)
55 if not stores:
56 raise Exception('No local stores are currently open')

/Users/shajeelafzal/Untitled Folder/pizzapi/address.pyc in nearby_stores(self, service)
47 and stores that are not currently in service (!['ServiceIsOpen']).
48 """
---> 49 data = request_json(self.urls.find_url(), line1=self.line1, line2=self.line2, type=service)
50 return [Store(x, self.country) for x in data['Stores']
51 if x['IsOnlineNow'] and x['ServiceIsOpen'][service]]

/Users/shajeelafzal/Untitled Folder/pizzapi/utils.pyc in request_json(url, **kwargs)
13 This will error on an invalid request (requests.Request.raise_for_status()), but will otherwise return a dict.
14 """
---> 15 r = requests.get(url.format(**kwargs))
16 r.raise_for_status()
17 return r.json()

/anaconda2/lib/python2.7/site-packages/requests/api.pyc in get(url, params, **kwargs)
70
71 kwargs.setdefault('allow_redirects', True)
---> 72 return request('get', url, params=params, **kwargs)
73
74

/anaconda2/lib/python2.7/site-packages/requests/api.pyc in request(method, url, **kwargs)
56 # cases, and look like a memory leak in others.
57 with sessions.Session() as session:
---> 58 return session.request(method=method, url=url, **kwargs)
59
60

/anaconda2/lib/python2.7/site-packages/requests/sessions.pyc in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
506 }
507 send_kwargs.update(settings)
--> 508 resp = self.send(prep, **send_kwargs)
509
510 return resp

/anaconda2/lib/python2.7/site-packages/requests/sessions.pyc in send(self, request, **kwargs)
616
617 # Send the request
--> 618 r = adapter.send(request, **kwargs)
619
620 # Total elapsed time of the request (approximately)

/anaconda2/lib/python2.7/site-packages/requests/adapters.pyc in send(self, request, stream, timeout, verify, cert, proxies)
506 raise SSLError(e, request=request)
507
--> 508 raise ConnectionError(e, request=request)
509
510 except ClosedPoolError as e:

ConnectionError: HTTPSConnectionPool(host='order.dominos.com', port=443): Max retries exceeded with url: /power/store-locator?s=700%20Pennsylvania%20Avenue%20NW&c=Washington,%20DC,%2020408&type=Delivery (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x106ad4650>: Failed to establish a new connection: [Errno 60] Operation timed out',))

store.get_menu() raised an exception

I was just going through the tutorial but can't get store.get_menu() to work.

My code:

from pizzapi import *
customer = Customer('Donald', 'Trump', '[email protected]', '2024561111')
address = Address('2175 S 11th Ave', 'Bozeman', 'MT', '59715')
store = address.closest_store()
menu = store.get_menu()

results in terminal:

from pizzapi import *
customer = Customer('Donald', 'Trump', '[email protected]', '2024561111')
address = Address('2175 S 11th Ave', 'Bozeman', 'MT', '59715')
store = address.closest_store()
menu = store.get_menu()
customer = Customer('Donald', 'Trump', '[email protected]', '2024561111')
address = Address('2175 S 11th Ave', 'Bozeman', 'MT', '59715')
store = address.closest_store()
menu = store.get_menu()
Traceback (most recent call last):
File "", line 1, in
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pizzapi/store.py", line 24, in get_menu
menu = Menu(response, self.country)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pizzapi/menu.py", line 50, in init
self.root_categories[key] = self.build_categories(value)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pizzapi/menu.py", line 62, in build_categories
new_subcategory = self.build_categories(subcategory, category)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pizzapi/menu.py", line 66, in build_categories
raise Exception('PRODUCT NOT FOUND: %s %s' % (product_code, category.code))
Exception: PRODUCT NOT FOUND: 9418 CouponPizza

my_local_dominos error

When i enter 'my_local_dominos = find_closest_store_to_customer(customer)' it throws:

Traceback (most recent call last):
File "<pyshell#4>", line 1, in
my_local_dominos = find_closest_store_to_customer(customer)
NameError: name 'find_closest_store_to_customer' is not defined.

Payment.py: "import re"

Seems you made a typo here. Line 1 of Payment.py is "import re", rather than "import requests". However, this may just be the fork I was using, specifically the one by Jarvis Johnson.

Search for Stores with General Addresses

Allow the Address object to have varying degrees of information to allow general store searches.
A full address should still be required for the order, though.

Connection attempt failed

getting this error when using the example code. What's going on?

  File "C:\Users\Ben\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests-2.13.0-py3.6.egg\requests\packages\urllib3\connection.py", line 141, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "C:\Users\Ben\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests-2.13.0-py3.6.egg\requests\packages\urllib3\util\connection.py", line 83, in create_connection
    raise err
  File "C:\Users\Ben\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests-2.13.0-py3.6.egg\requests\packages\urllib3\util\connection.py", line 73, in create_connection
    sock.connect(sa)
TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Ben\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests-2.13.0-py3.6.egg\requests\packages\urllib3\connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "C:\Users\Ben\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests-2.13.0-py3.6.egg\requests\packages\urllib3\connectionpool.py", line 345, in _make_request
    self._validate_conn(conn)
  File "C:\Users\Ben\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests-2.13.0-py3.6.egg\requests\packages\urllib3\connectionpool.py", line 844, in _validate_conn
    conn.connect()
  File "C:\Users\Ben\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests-2.13.0-py3.6.egg\requests\packages\urllib3\connection.py", line 284, in connect
    conn = self._new_conn()
  File "C:\Users\Ben\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests-2.13.0-py3.6.egg\requests\packages\urllib3\connection.py", line 150, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x05C67970>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Ben\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests-2.13.0-py3.6.egg\requests\adapters.py", line 423, in send
    timeout=timeout
  File "C:\Users\Ben\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests-2.13.0-py3.6.egg\requests\packages\urllib3\connectionpool.py", line 649, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "C:\Users\Ben\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests-2.13.0-py3.6.egg\requests\packages\urllib3\util\retry.py", line 376, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
requests.packages.urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='order.dominos.com', port=443): Max retries exceeded with url: /power/store-locator?s=700%20Pennsylvania%20Avenue%20NW&c=Washington,%20DC,%2020408&type=Delivery (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x05C67970>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 6, in <module>
    store = address.closest_store()
  File "C:\Users\Ben\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pizzapi\address.py", line 34, in closest_store
    stores = self.nearby_stores(service=service)
  File "C:\Users\Ben\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pizzapi\address.py", line 29, in nearby_stores
    data = request_json(self.urls.find_url(), line1=self.line1, line2=self.line2, type=service)
  File "C:\Users\Ben\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pizzapi\utils.py", line 6, in request_json
    r = requests.get(url.format(**kwargs))
  File "C:\Users\Ben\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests-2.13.0-py3.6.egg\requests\api.py", line 70, in get
    return request('get', url, params=params, **kwargs)
  File "C:\Users\Ben\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests-2.13.0-py3.6.egg\requests\api.py", line 56, in request
    return session.request(method=method, url=url, **kwargs)
  File "C:\Users\Ben\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests-2.13.0-py3.6.egg\requests\sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Users\Ben\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests-2.13.0-py3.6.egg\requests\sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
  File "C:\Users\Ben\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests-2.13.0-py3.6.egg\requests\adapters.py", line 487, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='order.dominos.com', port=443): Max retries exceeded with url: /power/store-locator?s=700%20Pennsylvania%20Avenue%20NW&c=Washington,%20DC,%2020408&type=Delivery (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x05C67970>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond',))```

Credit Card

What numbers are you supposed to use when you add the credit card info? I need better documentation as the readme doesn't say.

Add Better Documentation

The documentation is pretty lacking at this point.
Document all of the classes and functions, as well as the standard installation, usage, contributing, etc. sections.

No local stores are currently open

It is saying no stores are currently open but i know they are. Im in canada and it says it works in canada but im not sure how to make it work.

Trademark and Copyright symbols break menu search

When searching for some specific items in the menu certain ascii symbols break the menu.search() function.

20BCOKE ---------------------------------------------------------------------------
UnicodeEncodeError                        Traceback (most recent call last)
<ipython-input-6-6813dfebb3e9> in <module>()
----> 1 menu.search(Name='Coke')

/var/opt/cloudbolt/proserv/pizzapi/pizzapi/menu.py in search(self, **conditions)
    105             if all(y in v.get(x, '') for x, y in conditions.items()):
    106                 print(v['Code'], end=' ')
--> 107                 print(v['Name'], end=' ')
    108                 print('$' + v['Price'], end=' ')
    109                 print(v['SizeCode'], end=' ')

UnicodeEncodeError: 'ascii' codec can't encode character '\xae' in position 16: ordinal not in range(128)```

Integrate Disparate Implementations/Deployments

There are multiple Python implementations of the pizzapi functionality out there, and I'd like to pull them all together if possible:

https://github.com/tomasbasham/dominos has some neat ideas about rate-limiting awareness and working CI, as well as the UK URLs. The dominos package is also on pypi. I've reached out to Tomas, pending response.

wardcraigj owns the pypi deployment:
https://github.com/wardcraigj/pizzapi
https://pypi.python.org/pypi/pizzapi/0.0.2
https://pypi.python.org/pypi/pizzapi/0.0.3
Not sure how to get in touch with this guy.

That's about it for now. Maybe there's a consortium of pizza-ordering API implementations to join. The sky's really the limit on this one.

http://www.pizzahut.com/api/addPizza?size=large&topping1=Pepperoni&topping2=GreenPeppers
https://twitter.com/rogerclark/status/311280908462346240 # is there a dev token?
https://gizmodo.com/5091434/all-giz-wants-the-one-true-internet-pizza-ordering-app-framework
https://github.com/contra/papajohns # url does not work
https://gist.github.com/johnhamelink/33bab077efa8e456faf0 # UK url works - encouraging

Order class broken

I tried running your code example from README, but there is an inconsistent use of tabs and spaces in pizzapi/order.py:

Python 3.6.3 (default, Oct 3 2017, 21:45:48)
[GCC 7.2.0] on linux

>>> from pizzapi import Customer
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ilya/Desktop/subl/venv/lib/python3.6/site-packages/pizzapi/__init__.py", line 5, in <module>
    from .order import Order
  File "/home/ilya/Desktop/subl/venv/lib/python3.6/site-packages/pizzapi/order.py", line 130
    return response
                  ^
TabError: inconsistent use of tabs and spaces in indentation
>>> from pizzapi import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ilya/Desktop/subl/venv/lib/python3.6/site-packages/pizzapi/__init__.py", line 5, in <module>
    from .order import Order
  File "/home/ilya/Desktop/subl/venv/lib/python3.6/site-packages/pizzapi/order.py", line 130
    return response
                  ^
TabError: inconsistent use of tabs and spaces in indentation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.