Skip to content

b3ni/pymcm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pymcm

A python client for web MagicCardMarket https://www.magiccardmarket.eu/

Requires

  • httplib2
  • mechanize
  • lxml

Installation

pip install pymcm

If you install lxml from pip, you must install the following packages on Ubuntu.:

sudo apt-get install libxml2-dev libxslt-dev

Usage

Login and search card

import pymcm

mcm = MCMApi(username='foo', password='duu')

for result in mcm.search('sun titan'):
    prind result.card.name, result.available

Read want lists

for wl in mcm.get_wants_list():
    print wl.name

    for want_card in wl.wants:
        print want_card.card.name, want_card.amount

Read a card prices

one_card = wl.wants[0].card

for pc in mcm.list_prices(one_card):
    print "{0} ({1}): {2} {3}".format(pc.seller.name, pc.seller.country, pc.condition, pc.price)

Add a card to cart

pc = mcm.list_prices(one_card)[0]
mcm.add_to_cart(pc)

Read a cart

cart = mcm.get_cart()

print cart.total()
for ship in cart.ships():
    print ship.seller.name
    for a in ship.articles:
        print a.card.name, a.price

Contacts

pymcm is written by:

Suggestions, bugs,... https://github.com/b3ni/pymcm/issues

About

A python client for web MagicCardMarket https://www.magiccardmarket.eu/

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.es

Stars

Watchers

Forks

Packages

No packages published

Languages