mercapi


Namemercapi JSON
Version 0.4.1 PyPI version JSON
download
home_pagehttps://github.com/take-kun/mercapi/
SummaryPython API for querying and browsing mercari.jp
upload_time2024-04-16 19:15:14
maintainerNone
docs_urlNone
authortake-kun
requires_python<4.0,>=3.8
licenseMIT
keywords api scraping
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # mercapi

![PyPI](https://img.shields.io/pypi/v/mercapi)
[![Tests](https://github.com/take-kun/mercapi/actions/workflows/check.yaml/badge.svg?branch=main)](https://github.com/take-kun/mercapi/actions/workflows/check.yaml)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/mercapi)

[API Documentation](https://take-kun.github.io/mercapi/)

## What is Mercapi?

Mercapi is a Python wrapper for *mercari.jp* API.
It's capable of producing HTTP requests implementing security mechanisms employed in native *mercari.jp* web app.
Requests and responses are mapped to custom classes with type-hinting and documentation.

## Quickstart

First, install the `mercapi` package using the package manager of your choice.

As an example, we want to run the search query `sharpnel`.

```python
from mercapi import Mercapi


m = Mercapi()
results = await m.search('sharpnel')

print(f'Found {results.meta.num_found} results')
for item in results.items:
    print(f'Name: {item.name}\\nPrice: {item.price}\\n')

```

We can use a single result object to retrieve full details of the listing.
```python
item = results.items[0]
full_item = await item.full_item()

print(full_item.description)
```

Or get it directly using an ID.
```python
item = await m.item('m90925725213')

print(item.description)
```

Refer to `mercapi.mercapi.Mercapi` documentation for all implemented features.

*Examples above are not executable. If you want to try them out, run `python example.py`.*

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/take-kun/mercapi/",
    "name": "mercapi",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": "api, scraping",
    "author": "take-kun",
    "author_email": "109226194+take-kun@users.noreply.github.com",
    "download_url": "https://files.pythonhosted.org/packages/b0/60/79dc1da4cb53c1f9f3841e45cac3961d4ac0dfb7a11a49fe72a7b5353352/mercapi-0.4.1.tar.gz",
    "platform": null,
    "description": "# mercapi\n\n![PyPI](https://img.shields.io/pypi/v/mercapi)\n[![Tests](https://github.com/take-kun/mercapi/actions/workflows/check.yaml/badge.svg?branch=main)](https://github.com/take-kun/mercapi/actions/workflows/check.yaml)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/mercapi)\n\n[API Documentation](https://take-kun.github.io/mercapi/)\n\n## What is Mercapi?\n\nMercapi is a Python wrapper for *mercari.jp* API.\nIt's capable of producing HTTP requests implementing security mechanisms employed in native *mercari.jp* web app.\nRequests and responses are mapped to custom classes with type-hinting and documentation.\n\n## Quickstart\n\nFirst, install the `mercapi` package using the package manager of your choice.\n\nAs an example, we want to run the search query `sharpnel`.\n\n```python\nfrom mercapi import Mercapi\n\n\nm = Mercapi()\nresults = await m.search('sharpnel')\n\nprint(f'Found {results.meta.num_found} results')\nfor item in results.items:\n    print(f'Name: {item.name}\\\\nPrice: {item.price}\\\\n')\n\n```\n\nWe can use a single result object to retrieve full details of the listing.\n```python\nitem = results.items[0]\nfull_item = await item.full_item()\n\nprint(full_item.description)\n```\n\nOr get it directly using an ID.\n```python\nitem = await m.item('m90925725213')\n\nprint(item.description)\n```\n\nRefer to `mercapi.mercapi.Mercapi` documentation for all implemented features.\n\n*Examples above are not executable. If you want to try them out, run `python example.py`.*\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python API for querying and browsing mercari.jp",
    "version": "0.4.1",
    "project_urls": {
        "Homepage": "https://github.com/take-kun/mercapi/",
        "Repository": "https://github.com/take-kun/mercapi/"
    },
    "split_keywords": [
        "api",
        " scraping"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ce651cbf5446258cb8e4846185fefebac24d07df90503761b2ee81773598badf",
                "md5": "78939fd3b9e5fb50072c8d2ed6fe2d26",
                "sha256": "76b07924ca8f0dff47f4ae4adf5678427d84e27b1cea293053c6d1710014b938"
            },
            "downloads": -1,
            "filename": "mercapi-0.4.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "78939fd3b9e5fb50072c8d2ed6fe2d26",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 18252,
            "upload_time": "2024-04-16T19:15:10",
            "upload_time_iso_8601": "2024-04-16T19:15:10.232118Z",
            "url": "https://files.pythonhosted.org/packages/ce/65/1cbf5446258cb8e4846185fefebac24d07df90503761b2ee81773598badf/mercapi-0.4.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b06079dc1da4cb53c1f9f3841e45cac3961d4ac0dfb7a11a49fe72a7b5353352",
                "md5": "590d11e14a357fc452b6cd892e4fdcb7",
                "sha256": "09da03362e82a9ae1782cbf85adfdfd4bdba4b7159cf11d476579c90f06cde00"
            },
            "downloads": -1,
            "filename": "mercapi-0.4.1.tar.gz",
            "has_sig": false,
            "md5_digest": "590d11e14a357fc452b6cd892e4fdcb7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 13392,
            "upload_time": "2024-04-16T19:15:14",
            "upload_time_iso_8601": "2024-04-16T19:15:14.779464Z",
            "url": "https://files.pythonhosted.org/packages/b0/60/79dc1da4cb53c1f9f3841e45cac3961d4ac0dfb7a11a49fe72a7b5353352/mercapi-0.4.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-16 19:15:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "take-kun",
    "github_project": "mercapi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "mercapi"
}
        
Elapsed time: 0.24415s