perekrestok-api


Nameperekrestok-api JSON
Version 0.1.7 PyPI version JSON
download
home_pageNone
SummaryA Python API client for Perekrestok catalog
upload_time2025-07-12 12:20:58
maintainerNone
docs_urlNone
authorMiskler
requires_python>=3.10
licenseNone
keywords api perekrestok store catalog
VCS
bugtrack_url
requirements hrequests requests pytest pytest-typed-schema-shot coverage coverage-badge sphinx sphinx-autoapi myst-parser
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Perekrestok API (not official)

[![Tests](https://github.com/Open-Inflation/perekrestok_api/actions/workflows/check-tests.yml/badge.svg)](https://github.com/Open-Inflation/perekrestok_api/actions/workflows/check-tests.yml)
[![Coverage](https://img.shields.io/badge/coverage-tested%20daily-brightgreen?logo=pytest&logoColor=white)](https://github.com/Open-Inflation/perekrestok_api/actions/workflows/check-tests.yml)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/perekrestok_api)
![PyPI - Package Version](https://img.shields.io/pypi/v/perekrestok_api?color=blue)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/perekrestok_api?label=PyPi%20downloads)](https://pypi.org/project/perekrestok-api/)
[![License](https://img.shields.io/github/license/Open-Inflation/perekrestok_api)](https://github.com/Open-Inflation/perekrestok_api/blob/main/LICENSE)
[![Discord](https://img.shields.io/discord/792572437292253224?label=Discord&labelColor=%232c2f33&color=%237289da)](https://discord.gg/UnJnGHNbBp)
[![Telegram](https://img.shields.io/badge/Telegram-24A1DE)](https://t.me/miskler_dev)

Perekrestok (Перекрёсток) - https://www.perekrestok.ru/

### Принцип работы

> Библиотека полностью повторяет сетевую работу обычного пользователя на сайте.


# Usage / Использование

```py
from perekrestok_api import PerekrestokAPI
from perekrestok_api import abstraction


def main():
    with PerekrestokAPI() as Api:
        geopos_handler = Api.Geolocation.current()
        geopos = geopos_handler.json()
        print(f'Текущий город сессии {geopos["content"]["city"]["name"]} ({geopos["content"]["city"]["id"]})')
    
        # Получаем список категорий
        categories = Api.Catalog.tree()
        cat = categories.json()
        print(f'Список категорий: {len(cat["content"]["items"])}')

        # Выводим первую категорию
        print(f'Категория: {cat["content"]["items"][0]["category"]["title"]} ({cat["content"]["items"][0]["category"]["id"]})')
        # Получаем список товаров
        filter = abstraction.CatalogFeedFilter()
        filter.CATEGORY_ID = cat["content"]["items"][0]["category"]["id"]
        products = Api.Catalog.feed(filter=filter)
        prod = products.json()

        # Выводим первый товар
        print(f'Первый товар: {prod["content"]["items"][0]["title"]} ({prod["content"]["items"][0]["id"]})')

if __name__ == "__main__":
    main()
```
```bash
> Текущий город сессии Москва (81)
> Список категорий: 31
> Категория: Летний сезон (1585)
> Первый товар: Пиво Василеостровское Тройной пшеничный эль нефильтрованное 6.9%, 750мл (66750)
```

---

### Report / Обратная связь

If you have any problems using it / suggestions, do not hesitate to write to the [project's GitHub](https://github.com/Open-Inflation/perekrestok_api/issues)!

Если у вас возникнут проблемы в использовании / пожелания, не стесняйтесь писать на [GitHub проекта](https://github.com/Open-Inflation/perekrestok_api/issues)!

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "perekrestok-api",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "api, perekrestok, store, catalog",
    "author": "Miskler",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/7c/5d/913112cb6d1786206246b125cc66a66b64b2a8dcf31ad854388d8ecd9e5a/perekrestok_api-0.1.7.tar.gz",
    "platform": null,
    "description": "# Perekrestok API (not official)\n\n[![Tests](https://github.com/Open-Inflation/perekrestok_api/actions/workflows/check-tests.yml/badge.svg)](https://github.com/Open-Inflation/perekrestok_api/actions/workflows/check-tests.yml)\n[![Coverage](https://img.shields.io/badge/coverage-tested%20daily-brightgreen?logo=pytest&logoColor=white)](https://github.com/Open-Inflation/perekrestok_api/actions/workflows/check-tests.yml)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/perekrestok_api)\n![PyPI - Package Version](https://img.shields.io/pypi/v/perekrestok_api?color=blue)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/perekrestok_api?label=PyPi%20downloads)](https://pypi.org/project/perekrestok-api/)\n[![License](https://img.shields.io/github/license/Open-Inflation/perekrestok_api)](https://github.com/Open-Inflation/perekrestok_api/blob/main/LICENSE)\n[![Discord](https://img.shields.io/discord/792572437292253224?label=Discord&labelColor=%232c2f33&color=%237289da)](https://discord.gg/UnJnGHNbBp)\n[![Telegram](https://img.shields.io/badge/Telegram-24A1DE)](https://t.me/miskler_dev)\n\nPerekrestok (\u041f\u0435\u0440\u0435\u043a\u0440\u0451\u0441\u0442\u043e\u043a) - https://www.perekrestok.ru/\n\n### \u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b\n\n> \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442 \u0441\u0435\u0442\u0435\u0432\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0441\u0430\u0439\u0442\u0435.\n\n\n# Usage / \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\n\n```py\nfrom perekrestok_api import PerekrestokAPI\nfrom perekrestok_api import abstraction\n\n\ndef main():\n    with PerekrestokAPI() as Api:\n        geopos_handler = Api.Geolocation.current()\n        geopos = geopos_handler.json()\n        print(f'\u0422\u0435\u043a\u0443\u0449\u0438\u0439 \u0433\u043e\u0440\u043e\u0434 \u0441\u0435\u0441\u0441\u0438\u0438 {geopos[\"content\"][\"city\"][\"name\"]} ({geopos[\"content\"][\"city\"][\"id\"]})')\n    \n        # \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439\n        categories = Api.Catalog.tree()\n        cat = categories.json()\n        print(f'\u0421\u043f\u0438\u0441\u043e\u043a \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439: {len(cat[\"content\"][\"items\"])}')\n\n        # \u0412\u044b\u0432\u043e\u0434\u0438\u043c \u043f\u0435\u0440\u0432\u0443\u044e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e\n        print(f'\u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f: {cat[\"content\"][\"items\"][0][\"category\"][\"title\"]} ({cat[\"content\"][\"items\"][0][\"category\"][\"id\"]})')\n        # \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0442\u043e\u0432\u0430\u0440\u043e\u0432\n        filter = abstraction.CatalogFeedFilter()\n        filter.CATEGORY_ID = cat[\"content\"][\"items\"][0][\"category\"][\"id\"]\n        products = Api.Catalog.feed(filter=filter)\n        prod = products.json()\n\n        # \u0412\u044b\u0432\u043e\u0434\u0438\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u0442\u043e\u0432\u0430\u0440\n        print(f'\u041f\u0435\u0440\u0432\u044b\u0439 \u0442\u043e\u0432\u0430\u0440: {prod[\"content\"][\"items\"][0][\"title\"]} ({prod[\"content\"][\"items\"][0][\"id\"]})')\n\nif __name__ == \"__main__\":\n    main()\n```\n```bash\n> \u0422\u0435\u043a\u0443\u0449\u0438\u0439 \u0433\u043e\u0440\u043e\u0434 \u0441\u0435\u0441\u0441\u0438\u0438 \u041c\u043e\u0441\u043a\u0432\u0430 (81)\n> \u0421\u043f\u0438\u0441\u043e\u043a \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439: 31\n> \u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f: \u041b\u0435\u0442\u043d\u0438\u0439 \u0441\u0435\u0437\u043e\u043d (1585)\n> \u041f\u0435\u0440\u0432\u044b\u0439 \u0442\u043e\u0432\u0430\u0440: \u041f\u0438\u0432\u043e \u0412\u0430\u0441\u0438\u043b\u0435\u043e\u0441\u0442\u0440\u043e\u0432\u0441\u043a\u043e\u0435 \u0422\u0440\u043e\u0439\u043d\u043e\u0439 \u043f\u0448\u0435\u043d\u0438\u0447\u043d\u044b\u0439 \u044d\u043b\u044c \u043d\u0435\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 6.9%, 750\u043c\u043b (66750)\n```\n\n---\n\n### Report / \u041e\u0431\u0440\u0430\u0442\u043d\u0430\u044f \u0441\u0432\u044f\u0437\u044c\n\nIf you have any problems using it / suggestions, do not hesitate to write to the [project's GitHub](https://github.com/Open-Inflation/perekrestok_api/issues)!\n\n\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 / \u043f\u043e\u0436\u0435\u043b\u0430\u043d\u0438\u044f, \u043d\u0435 \u0441\u0442\u0435\u0441\u043d\u044f\u0439\u0442\u0435\u0441\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 [GitHub \u043f\u0440\u043e\u0435\u043a\u0442\u0430](https://github.com/Open-Inflation/perekrestok_api/issues)!\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Python API client for Perekrestok catalog",
    "version": "0.1.7",
    "project_urls": {
        "Documentation": "https://open-inflation.github.io/perekrestok_api/",
        "Homepage": "https://github.com/Open-Inflation/perekrestok_api",
        "Repository": "https://github.com/Open-Inflation/perekrestok_api"
    },
    "split_keywords": [
        "api",
        " perekrestok",
        " store",
        " catalog"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "22f5da00f41244b2131fbd110a82d3444e679f6afb60c1085ac3905733bb3b6e",
                "md5": "2e44abc4c6cee76a2518474b8b0205e9",
                "sha256": "2096a3d1deb053cd465b4d2eaa69e6ea6a902d48f24299c604eb44421e78b618"
            },
            "downloads": -1,
            "filename": "perekrestok_api-0.1.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2e44abc4c6cee76a2518474b8b0205e9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 19002,
            "upload_time": "2025-07-12T12:20:56",
            "upload_time_iso_8601": "2025-07-12T12:20:56.267466Z",
            "url": "https://files.pythonhosted.org/packages/22/f5/da00f41244b2131fbd110a82d3444e679f6afb60c1085ac3905733bb3b6e/perekrestok_api-0.1.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "7c5d913112cb6d1786206246b125cc66a66b64b2a8dcf31ad854388d8ecd9e5a",
                "md5": "cac8b1b8ff73ad8100ce6813a5a262ec",
                "sha256": "8b8fe4bf87ef50fa20b0b0335cf8d3ca182c169df5e55f3bcee63d0daed1f149"
            },
            "downloads": -1,
            "filename": "perekrestok_api-0.1.7.tar.gz",
            "has_sig": false,
            "md5_digest": "cac8b1b8ff73ad8100ce6813a5a262ec",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 17119,
            "upload_time": "2025-07-12T12:20:58",
            "upload_time_iso_8601": "2025-07-12T12:20:58.256550Z",
            "url": "https://files.pythonhosted.org/packages/7c/5d/913112cb6d1786206246b125cc66a66b64b2a8dcf31ad854388d8ecd9e5a/perekrestok_api-0.1.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-12 12:20:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Open-Inflation",
    "github_project": "perekrestok_api",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "hrequests",
            "specs": []
        },
        {
            "name": "requests",
            "specs": []
        },
        {
            "name": "pytest",
            "specs": []
        },
        {
            "name": "pytest-typed-schema-shot",
            "specs": []
        },
        {
            "name": "coverage",
            "specs": []
        },
        {
            "name": "coverage-badge",
            "specs": []
        },
        {
            "name": "sphinx",
            "specs": []
        },
        {
            "name": "sphinx-autoapi",
            "specs": []
        },
        {
            "name": "myst-parser",
            "specs": []
        }
    ],
    "lcname": "perekrestok-api"
}
        
Elapsed time: 1.54247s