grailed_api


Namegrailed_api JSON
Version 0.1.5 PyPI version JSON
download
home_pageNone
SummaryAPI exposes most important Grailed API endpoints
upload_time2024-09-15 10:19:45
maintainerNone
docs_urlNone
authorpznamir00
requires_python<4.0,>=3.8
licenseNone
keywords grailed api python python3
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Grailed API

This repository provides most important features when it comes to Grailed API.
This is only for searching objects, since there is no official API, or API key.

## How to install

In order to install the package, just run following command `pip install grailed_api`

### How to install locally
1. Install `poetry` (https://python-poetry.org/)
2. Clone repo `git clone https://github.com/pznamir00/Grailed-API`
2. Run `poetry install` command.

## How to use

In order to use the features, just import `GrailedAPIClient`

```python
from grailed_api import GrailedAPIClient

client = GrailedAPIClient()
```

Then you are ready to use searching functions


### Methods

- `find_products` - returns products list
    - Parameters:
        - `sold` (bool, optional): include sold products. Defaults to True.
        - `on_sale` (bool, optional): include products on sale. Defaults to True.
        - `staff_pick` (bool, optional): get only products that have been marked by staff. Defaults to False.
        - `department` (Departments, optional): department, menswear or womenwear. Defaults to Departments.MENSWEAR.
        - `query_search` (str, optional): filter by keyword. Defaults to "".
        - `page` (int, optional): page index. Defaults to 1.
        - `hits_per_page` (int, optional): products number in one page. Defaults to 40.
        - `price_from` (int, optional): filter by min price. Defaults to 0.
        - `price_to` (int, optional): filter by max price. Defaults to 1_000_000.
        - `categories` (Iterable[Category], optional): filter by categories. Defaults to ().
        - `sizes` (Iterable[Size], optional): filter by sizes. Defaults to ().
        - `designers` (Iterable[str], optional): filter by designer names. Defaults to ().
        - `conditions` (Iterable[Condition], optional): filter by conditions. Defaults to ().
        - `markets` (Iterable[Markets], optional): filter by markets. Defaults to ().
        - `locations` (Iterable[Locations], optional): filter by locations. Defaults to ().
        - `max_values_per_facet` (int, optional): Defaults to 100.
        - `facets` (Iterable[Facets], optional): Defaults to all facets.
        - `verbose` (bool, optional): show http request. Defaults to False.
    - Description:
        For parameters `department`, `categories`, `sizes`, `conditions`, `markets`, `locations`, `facets` use builtin enums that are available in `enums.categories` module. There are following categories: `Tops`, `Bottoms`, `Outerwear`, `Footwear`, `Tailoring`, `Accessories` available under `enums.categories` module.

        `sizes` parameter should contain categories' sizes that are accessible in `.sizes` properties (e.g. `Tops.sizes` or `Outerwear.sizes`). Note if you are gonna include size and won't include it's category, it won't be affected as well as including category with sizes of different categories. You can see the example below
    - Example:
        ```python
        from grailed_api.enums import Conditions, Markets, Locations
        from grailed_api.enums.categories import Tops

        products = client.find_products(
            sold=False,
            query_search='vintage',
            categories=[Tops.BUTTON_UPS, Tops.JERSEYS],
            sizes=[Tops.sizes.L, Tops.sizes.M, Tops.sizes.S],
            price_from=100,
            price_to=200,
            conditions=[Conditions.IS_GENTLY_USED, Conditions.IS_NEW],
            markets=[Markets.BASIC, Markets.GRAILED],
            locations=[Locations.ASIA, Locations.EUROPE]
        )
        ```


- `find_product_by_id` - find one product with provided id. If product doesn't exist, an error will be thrown
    - Parameters:
        - `id` (str): product id
        - `verbose` (bool, optional): show http request. Defaults to False.
    - Example:
        ```python
        product = client.find_product_by_id(id='123456789')
        ```

- `find_brands` - find brands that match to query search
    - Parameters:
        - `query` (str): keyword to search a brand
        - `verbose` (bool, optional): show http request. Defaults to False.
    - Example:
        ```python
        brands = client.find_brands(query='levis')
        ```

## How to test

To test the API, just run `poetry run pytest` command.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "grailed_api",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": "grailed, api, python, python3",
    "author": "pznamir00",
    "author_email": "pznamir00@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/6a/a6/e39c76a40af930e24c3957b01393c1b6ce51bc1646aa9070597fbdfdae47/grailed_api-0.1.5.tar.gz",
    "platform": null,
    "description": "# Grailed API\n\nThis repository provides most important features when it comes to Grailed API.\nThis is only for searching objects, since there is no official API, or API key.\n\n## How to install\n\nIn order to install the package, just run following command `pip install grailed_api`\n\n### How to install locally\n1. Install `poetry` (https://python-poetry.org/)\n2. Clone repo `git clone https://github.com/pznamir00/Grailed-API`\n2. Run `poetry install` command.\n\n## How to use\n\nIn order to use the features, just import `GrailedAPIClient`\n\n```python\nfrom grailed_api import GrailedAPIClient\n\nclient = GrailedAPIClient()\n```\n\nThen you are ready to use searching functions\n\n\n### Methods\n\n- `find_products` - returns products list\n    - Parameters:\n        - `sold` (bool, optional): include sold products. Defaults to True.\n        - `on_sale` (bool, optional): include products on sale. Defaults to True.\n        - `staff_pick` (bool, optional): get only products that have been marked by staff. Defaults to False.\n        - `department` (Departments, optional): department, menswear or womenwear. Defaults to Departments.MENSWEAR.\n        - `query_search` (str, optional): filter by keyword. Defaults to \"\".\n        - `page` (int, optional): page index. Defaults to 1.\n        - `hits_per_page` (int, optional): products number in one page. Defaults to 40.\n        - `price_from` (int, optional): filter by min price. Defaults to 0.\n        - `price_to` (int, optional): filter by max price. Defaults to 1_000_000.\n        - `categories` (Iterable[Category], optional): filter by categories. Defaults to ().\n        - `sizes` (Iterable[Size], optional): filter by sizes. Defaults to ().\n        - `designers` (Iterable[str], optional): filter by designer names. Defaults to ().\n        - `conditions` (Iterable[Condition], optional): filter by conditions. Defaults to ().\n        - `markets` (Iterable[Markets], optional): filter by markets. Defaults to ().\n        - `locations` (Iterable[Locations], optional): filter by locations. Defaults to ().\n        - `max_values_per_facet` (int, optional): Defaults to 100.\n        - `facets` (Iterable[Facets], optional): Defaults to all facets.\n        - `verbose` (bool, optional): show http request. Defaults to False.\n    - Description:\n        For parameters `department`, `categories`, `sizes`, `conditions`, `markets`, `locations`, `facets` use builtin enums that are available in `enums.categories` module. There are following categories: `Tops`, `Bottoms`, `Outerwear`, `Footwear`, `Tailoring`, `Accessories` available under `enums.categories` module.\n\n        `sizes` parameter should contain categories' sizes that are accessible in `.sizes` properties (e.g. `Tops.sizes` or `Outerwear.sizes`). Note if you are gonna include size and won't include it's category, it won't be affected as well as including category with sizes of different categories. You can see the example below\n    - Example:\n        ```python\n        from grailed_api.enums import Conditions, Markets, Locations\n        from grailed_api.enums.categories import Tops\n\n        products = client.find_products(\n            sold=False,\n            query_search='vintage',\n            categories=[Tops.BUTTON_UPS, Tops.JERSEYS],\n            sizes=[Tops.sizes.L, Tops.sizes.M, Tops.sizes.S],\n            price_from=100,\n            price_to=200,\n            conditions=[Conditions.IS_GENTLY_USED, Conditions.IS_NEW],\n            markets=[Markets.BASIC, Markets.GRAILED],\n            locations=[Locations.ASIA, Locations.EUROPE]\n        )\n        ```\n\n\n- `find_product_by_id` - find one product with provided id. If product doesn't exist, an error will be thrown\n    - Parameters:\n        - `id` (str): product id\n        - `verbose` (bool, optional): show http request. Defaults to False.\n    - Example:\n        ```python\n        product = client.find_product_by_id(id='123456789')\n        ```\n\n- `find_brands` - find brands that match to query search\n    - Parameters:\n        - `query` (str): keyword to search a brand\n        - `verbose` (bool, optional): show http request. Defaults to False.\n    - Example:\n        ```python\n        brands = client.find_brands(query='levis')\n        ```\n\n## How to test\n\nTo test the API, just run `poetry run pytest` command.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "API exposes most important Grailed API endpoints",
    "version": "0.1.5",
    "project_urls": {
        "Homepage": "https://github.com/pznamir00/Grailed-API",
        "Issues": "https://github.com/pznamir00/Grailed-API/issues"
    },
    "split_keywords": [
        "grailed",
        " api",
        " python",
        " python3"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b346758d16762e613f42a03641a2054c83efebc1b10ef4c0a0cb95a44e0a8030",
                "md5": "f284fa61ef817688253db5c9ac1d724e",
                "sha256": "2fd6b73a20f4e72a0f40a692b4f7b0fe998b5d9fd6bc77ac7c59e8bd491f493c"
            },
            "downloads": -1,
            "filename": "grailed_api-0.1.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f284fa61ef817688253db5c9ac1d724e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 22637,
            "upload_time": "2024-09-15T10:19:44",
            "upload_time_iso_8601": "2024-09-15T10:19:44.141165Z",
            "url": "https://files.pythonhosted.org/packages/b3/46/758d16762e613f42a03641a2054c83efebc1b10ef4c0a0cb95a44e0a8030/grailed_api-0.1.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6aa6e39c76a40af930e24c3957b01393c1b6ce51bc1646aa9070597fbdfdae47",
                "md5": "9ec628b4a830fd60dccdac3b1ce3025d",
                "sha256": "2925f65683b83ea3f853e47fa401064b6fc779e6ae2f8542c8769d36157622e6"
            },
            "downloads": -1,
            "filename": "grailed_api-0.1.5.tar.gz",
            "has_sig": false,
            "md5_digest": "9ec628b4a830fd60dccdac3b1ce3025d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 15350,
            "upload_time": "2024-09-15T10:19:45",
            "upload_time_iso_8601": "2024-09-15T10:19:45.916177Z",
            "url": "https://files.pythonhosted.org/packages/6a/a6/e39c76a40af930e24c3957b01393c1b6ce51bc1646aa9070597fbdfdae47/grailed_api-0.1.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-15 10:19:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pznamir00",
    "github_project": "Grailed-API",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "grailed_api"
}
        
Elapsed time: 1.80909s