Coder Social home page Coder Social logo

mercari's Introduction

Mercari Wrapper

A simple api wrapper around the Mercari jp site.

Simple usage can be something like

import mercari

for item in mercari.search("東方 ふもふも"):
    print("{}, {}".format(item.productName, item.productURL))

The search call will take a long time because it goes through all the pages to find every item. It does not return parts where you paginate yourself.

the item object contains the following properties:

  • id
  • productURL
  • imageURL
  • productName
  • price
  • status
  • soldOut

If you want to do more specific searching, you can use something like the following

from mercari import search, MercariSearchStatus, MercariSort, MercariOrder

for item in search(
        "",
        sort=MercariSort.SORT_PRICE,
        order=MercariOrder.ORDER_DESC,
        status=MercariSearchStatus.SOLD_OUT
    ):
    print("{}, {}".format(item.productName, item.productURL))

The defaults are currently:

  • sort=MercariSort.SORT_CREATED_TIME
  • order=MercariOrder.ORDER_DESC
  • status=MercariSearchStatus.ON_SALE

Which will sort by most recent to oldest, and only show on sale item.

MercariSort

  • STATUS_DEFAULT
  • STATUS_ON_SALE
  • STATUS_SOLD_OUT

MercariOrder

  • SORT_DEFAULT
  • SORT_CREATED_TIME
  • SORT_NUM_LIKES
  • SORT_SCORE
  • SORT_PRICE

MercariSearchStatus

  • ORDER_DESC
  • ORDER_ASC

You can also pass excluded_keywords="something to exclude" if you want to remove certain pieces from your search

Development

Clone this repo, install the dependencies in requirement.txt and off you go.

Deploying / Publishing

  • python setup.py sdist

  • twine upload dist/mercari-<version>.tar.gz

mercari's People

Contributors

marvinody avatar cashlo avatar yana9i avatar

Stargazers

jerryFAT avatar

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.