bigc


Namebigc JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/MedShift/bigc
SummaryUnofficial client for the BigCommerce API
upload_time2025-07-18 17:19:59
maintainerNone
docs_urlNone
authorAdam Walsh
requires_python>=3.10
licenseMIT
keywords bigcommerce api client
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # bigc

An unofficial Python client for the BigCommerce API.

## Installation

```shell
pip install bigc
```

## Usage

To authenticate, you'll need the BigCommerce store's hash and an access token.

```python
from bigc import BigCommerceAPI

store_hash = '000000000'
access_token = '0000000000000000000000000000000'
bigcommerce = BigCommerceAPI(store_hash, access_token)

order = bigcommerce.orders_v2.get(101)
list_of_orders = list(bigcommerce.orders_v2.all(params={'customer_id': 1}))
```

The following resources are currently supported:

- `carts_v3`
- `categories_v3`
- `checkouts_v3`
- `currencies_v2`
- `customers_v3`
- `customer_groups_v2`
- `orders_v2`
- `orders_v3`
- `pricing_v3`
- `products_v3`
- `product_variants_v3`
- `webhooks_v3`

### Exceptions

If a request is not successful, `bigc` will raise an exception inheriting from `BigCommerceException`. The full exception hierarchy is available in `bigc.exceptions`. Most exceptions correspond to a specific status code (e.g. `DoesNotExistError` will be raised for 404s).

If BigCommerce provides an error message in its response, it will be available as `exc.message`. More detailed error information may be available as `exc.errors`.

### Timeouts

A timeout may be set on individual requests, or a default may be set for all requests. This specifies the maximum amount of time, in seconds, that may pass between receiving data from the server.

If a request times out, a `GatewayTimeoutError` will be raised.

```python
from bigc import BigCommerceAPI

bigcommerce = BigCommerceAPI('store_hash', 'access_token', timeout=7)
bigcommerce.checkouts_v3.create_order('checkout_id', timeout=16)
```

### Automatic Retries

`bigc` can automatically retry requests that fail due to network problems or certain types of server errors. You can specify the maximum number of retries as a default for all `GET` requests, or on a per-request basis.

```python
from bigc import BigCommerceAPI

bigcommerce = BigCommerceAPI('store_hash', 'access_token', get_retries=2)
bigcommerce.customers_v3.get(1, retries=5)
```

### Direct API Access

For resources that aren't officially supported yet, `bigc` also includes a flexible API client that can be used to make direct requests to the BigCommerce API.

```python
from bigc import BigCommerceAPI

bigcommerce = BigCommerceAPI('store_hash', 'access_token')

product = bigcommerce.api_v3.get('/products/77', params={'include': 'videos'})
order_messages = list(bigcommerce.api_v2.get_many('/orders/101/messages'))
```

### Utilities

Some extra utility functions that don't interact with the BigCommerce API are available in `bigc.utils`.

- `bigc.utils.parse_rfc2822_date`: Convert an [RFC-2822 date] (used by some BigCommerce APIs) to a `datetime`

[RFC-2822 date]: https://www.rfc-editor.org/rfc/rfc2822#section-3.3

### Constants

For convenience, some constants are made available in `bigc.data`.

- `bigc.data.BigCommerceOrderStatus`: An `IntEnum` of order statuses and their IDs

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/MedShift/bigc",
    "name": "bigc",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "bigcommerce, api, client",
    "author": "Adam Walsh",
    "author_email": "adam@medshift.com",
    "download_url": "https://files.pythonhosted.org/packages/36/b7/fca26fb487b0f5d826a307dce89ff152639a1d9e8390c8edea9c6fe8268b/bigc-1.0.0.tar.gz",
    "platform": null,
    "description": "# bigc\n\nAn unofficial Python client for the BigCommerce API.\n\n## Installation\n\n```shell\npip install bigc\n```\n\n## Usage\n\nTo authenticate, you'll need the BigCommerce store's hash and an access token.\n\n```python\nfrom bigc import BigCommerceAPI\n\nstore_hash = '000000000'\naccess_token = '0000000000000000000000000000000'\nbigcommerce = BigCommerceAPI(store_hash, access_token)\n\norder = bigcommerce.orders_v2.get(101)\nlist_of_orders = list(bigcommerce.orders_v2.all(params={'customer_id': 1}))\n```\n\nThe following resources are currently supported:\n\n- `carts_v3`\n- `categories_v3`\n- `checkouts_v3`\n- `currencies_v2`\n- `customers_v3`\n- `customer_groups_v2`\n- `orders_v2`\n- `orders_v3`\n- `pricing_v3`\n- `products_v3`\n- `product_variants_v3`\n- `webhooks_v3`\n\n### Exceptions\n\nIf a request is not successful, `bigc` will raise an exception inheriting from `BigCommerceException`. The full exception hierarchy is available in `bigc.exceptions`. Most exceptions correspond to a specific status code (e.g. `DoesNotExistError` will be raised for 404s).\n\nIf BigCommerce provides an error message in its response, it will be available as `exc.message`. More detailed error information may be available as `exc.errors`.\n\n### Timeouts\n\nA timeout may be set on individual requests, or a default may be set for all requests. This specifies the maximum amount of time, in seconds, that may pass between receiving data from the server.\n\nIf a request times out, a `GatewayTimeoutError` will be raised.\n\n```python\nfrom bigc import BigCommerceAPI\n\nbigcommerce = BigCommerceAPI('store_hash', 'access_token', timeout=7)\nbigcommerce.checkouts_v3.create_order('checkout_id', timeout=16)\n```\n\n### Automatic Retries\n\n`bigc` can automatically retry requests that fail due to network problems or certain types of server errors. You can specify the maximum number of retries as a default for all `GET` requests, or on a per-request basis.\n\n```python\nfrom bigc import BigCommerceAPI\n\nbigcommerce = BigCommerceAPI('store_hash', 'access_token', get_retries=2)\nbigcommerce.customers_v3.get(1, retries=5)\n```\n\n### Direct API Access\n\nFor resources that aren't officially supported yet, `bigc` also includes a flexible API client that can be used to make direct requests to the BigCommerce API.\n\n```python\nfrom bigc import BigCommerceAPI\n\nbigcommerce = BigCommerceAPI('store_hash', 'access_token')\n\nproduct = bigcommerce.api_v3.get('/products/77', params={'include': 'videos'})\norder_messages = list(bigcommerce.api_v2.get_many('/orders/101/messages'))\n```\n\n### Utilities\n\nSome extra utility functions that don't interact with the BigCommerce API are available in `bigc.utils`.\n\n- `bigc.utils.parse_rfc2822_date`: Convert an [RFC-2822 date] (used by some BigCommerce APIs) to a `datetime`\n\n[RFC-2822 date]: https://www.rfc-editor.org/rfc/rfc2822#section-3.3\n\n### Constants\n\nFor convenience, some constants are made available in `bigc.data`.\n\n- `bigc.data.BigCommerceOrderStatus`: An `IntEnum` of order statuses and their IDs\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Unofficial client for the BigCommerce API",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/MedShift/bigc",
        "Repository": "https://github.com/MedShift/bigc.git"
    },
    "split_keywords": [
        "bigcommerce",
        " api",
        " client"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "77d94e0c1a9e5aa1611ac828d87298e3b285846752291aec1e3d6088a60bb4dc",
                "md5": "112c08779a2c4ef01ec27f7b5ca6b4f1",
                "sha256": "550b434bbafe19341c00ca8a07b9341f486d4c7ab1ec711038545a870903dbb9"
            },
            "downloads": -1,
            "filename": "bigc-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "112c08779a2c4ef01ec27f7b5ca6b4f1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 18081,
            "upload_time": "2025-07-18T17:19:59",
            "upload_time_iso_8601": "2025-07-18T17:19:59.042770Z",
            "url": "https://files.pythonhosted.org/packages/77/d9/4e0c1a9e5aa1611ac828d87298e3b285846752291aec1e3d6088a60bb4dc/bigc-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "36b7fca26fb487b0f5d826a307dce89ff152639a1d9e8390c8edea9c6fe8268b",
                "md5": "af4a4106d17b2bcbf02400afdd4572ae",
                "sha256": "4a3f9500b40cd1da19bf4ddebf96a810fc45b45546b2807d1afdb3738af25f7e"
            },
            "downloads": -1,
            "filename": "bigc-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "af4a4106d17b2bcbf02400afdd4572ae",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 11473,
            "upload_time": "2025-07-18T17:19:59",
            "upload_time_iso_8601": "2025-07-18T17:19:59.829470Z",
            "url": "https://files.pythonhosted.org/packages/36/b7/fca26fb487b0f5d826a307dce89ff152639a1d9e8390c8edea9c6fe8268b/bigc-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-18 17:19:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "MedShift",
    "github_project": "bigc",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "bigc"
}
        
Elapsed time: 1.88918s