# 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.9",
"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/4e/47/e0b2ce0d819d0edfcbba56cf97667fd7ea4fc1d51a6d771aab3f15c322a9/mercapi-0.4.2.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.2",
"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": "2622aaece71efdbe854e72178641c3cceff63e11396205ede356c757cdbd6c1e",
"md5": "f8eb0bb72f9c2721f7735cfdf9f7057e",
"sha256": "e55ca4470e464faddcc05cf6e935d50bfe2c261de38ba3370fe8605c953ee7dc"
},
"downloads": -1,
"filename": "mercapi-0.4.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f8eb0bb72f9c2721f7735cfdf9f7057e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 18601,
"upload_time": "2024-11-10T23:09:36",
"upload_time_iso_8601": "2024-11-10T23:09:36.381798Z",
"url": "https://files.pythonhosted.org/packages/26/22/aaece71efdbe854e72178641c3cceff63e11396205ede356c757cdbd6c1e/mercapi-0.4.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4e47e0b2ce0d819d0edfcbba56cf97667fd7ea4fc1d51a6d771aab3f15c322a9",
"md5": "a375fbf5d6ab9c5b1afe0e328f6c9461",
"sha256": "0b2d51f2caaba2082ab073b398c7188dd456d9d0d183a86acf812ded174feee9"
},
"downloads": -1,
"filename": "mercapi-0.4.2.tar.gz",
"has_sig": false,
"md5_digest": "a375fbf5d6ab9c5b1afe0e328f6c9461",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 13725,
"upload_time": "2024-11-10T23:09:38",
"upload_time_iso_8601": "2024-11-10T23:09:38.357678Z",
"url": "https://files.pythonhosted.org/packages/4e/47/e0b2ce0d819d0edfcbba56cf97667fd7ea4fc1d51a6d771aab3f15c322a9/mercapi-0.4.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-10 23:09:38",
"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"
}