bigcommerce-toolkit


Namebigcommerce-toolkit JSON
Version 0.1.6 PyPI version JSON
download
home_pagehttps://github.com/TrellisCommerce/bigcommerce-toolkit
SummaryA UNIX-style tool which provides easy access to BigCommerce's API from the command line.
upload_time2024-09-18 22:01:51
maintainerNone
docs_urlNone
authorJoey Hoer
requires_python<4.0,>=3.12
licenseNone
keywords bigcommerce api cli
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # BigCommerce Toolkit

BigCommerce Toolkit is a command-line interface (CLI) tool for BigCommerce's API. It follows UNIX principles of "do one thing well" and organizes commands based on resource type and action. This structure aligns with RESTful API principles, providing a logical and hierarchical system for managing various BigCommerce resources.

## Features

- **Resource-based Commands:** Commands are structured around resource types (e.g., products, categories, customers) and their respective actions (e.g., get, add, update, delete).
- **Hierarchical Command Structure:** Similar to UNIX tools like `git`, commands are grouped logically to align with BigCommerce's API structure.
- **Environment Variable Support:** Store hash and authentication token can be set via environment variables for convenience.
- **Paginated Requests:** Supports fetching all pages of data for GET requests with pagination.
- **Standard Input (stdin) Support:** Allows reading values from stdin for easier scripting and piping data between commands.

## Installation

To install BigCommerce Toolkit, clone the repository and install the necessary dependencies.

```sh
pip install bigcommerce-toolkit
```

## Usage

### Basic Command Structure

The CLI uses a structure similar to UNIX commands, where you specify the resource type, action, and additional parameters or options as needed.

```sh
bigc [<options>] <resource> [<subresource>] <action> [<arguments>]
```

### Setting Up Environment Variables

Before using the tool, set the environment variables for your BigCommerce store hash and authentication token.

```sh
export BIGCOMMERCE_STORE_HASH=your_store_hash
export BIGCOMMERCE_AUTH_TOKEN=your_auth_token
```

Alternatively, you can pass these values directly via command-line options.

```sh
bigc --store-hash your_store_hash --auth-token your_auth_token …
```

### Example Commands

## Add a Product (via Arguments)

To add a new product with data provided as named arguments:

```sh
bigc products add --name "New Product" --price 19.99 --type physical --weight 0
```

## Add a Product (via Standard Input)

BigCommerce Toolkit also supports reading values from `stdin`, allowing for piping data between commands for easier scripting. For example:

```sh
echo '{"name": "New Product", "price": 19.99, "type": "physical", "weight": 0}' | bigc products add --data -
```

### Update a Product

This can be further leveraged by piping through additional tools like `jq`. First, retrieving a product's ID by the product's name, and then updating that product's price:

```sh
bigc products get --name:like "New Product" | jq -r '.data[0].id' | bigc product update --id - --price 24.99
```

## Fetching All Products

For endpoints that support pagination, you can fetch all pages of data. Using tools like `jq` and `csvlook`, it is possible to format the data into a more readable format.

```sh
bigc products get-all | jq -r '["id","sku","name"], (.data[] | [.id,.sku,.name]) | @csv' | csvlook
```

## Contributing

We welcome contributions to improve the project. Please submit issues and pull requests via GitHub.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/TrellisCommerce/bigcommerce-toolkit",
    "name": "bigcommerce-toolkit",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.12",
    "maintainer_email": null,
    "keywords": "bigcommerce, api, cli",
    "author": "Joey Hoer",
    "author_email": "me@joeyhoer.com",
    "download_url": "https://files.pythonhosted.org/packages/1d/48/20516b61d09d7e1080ef490670c2b769ef20ac8c69328ef90488c5314017/bigcommerce_toolkit-0.1.6.tar.gz",
    "platform": null,
    "description": "# BigCommerce Toolkit\n\nBigCommerce Toolkit is a command-line interface (CLI) tool for BigCommerce's API. It follows UNIX principles of \"do one thing well\" and organizes commands based on resource type and action. This structure aligns with RESTful API principles, providing a logical and hierarchical system for managing various BigCommerce resources.\n\n## Features\n\n- **Resource-based Commands:** Commands are structured around resource types (e.g., products, categories, customers) and their respective actions (e.g., get, add, update, delete).\n- **Hierarchical Command Structure:** Similar to UNIX tools like `git`, commands are grouped logically to align with BigCommerce's API structure.\n- **Environment Variable Support:** Store hash and authentication token can be set via environment variables for convenience.\n- **Paginated Requests:** Supports fetching all pages of data for GET requests with pagination.\n- **Standard Input (stdin) Support:** Allows reading values from stdin for easier scripting and piping data between commands.\n\n## Installation\n\nTo install BigCommerce Toolkit, clone the repository and install the necessary dependencies.\n\n```sh\npip install bigcommerce-toolkit\n```\n\n## Usage\n\n### Basic Command Structure\n\nThe CLI uses a structure similar to UNIX commands, where you specify the resource type, action, and additional parameters or options as needed.\n\n```sh\nbigc [<options>] <resource> [<subresource>] <action> [<arguments>]\n```\n\n### Setting Up Environment Variables\n\nBefore using the tool, set the environment variables for your BigCommerce store hash and authentication token.\n\n```sh\nexport BIGCOMMERCE_STORE_HASH=your_store_hash\nexport BIGCOMMERCE_AUTH_TOKEN=your_auth_token\n```\n\nAlternatively, you can pass these values directly via command-line options.\n\n```sh\nbigc --store-hash your_store_hash --auth-token your_auth_token \u2026\n```\n\n### Example Commands\n\n## Add a Product (via Arguments)\n\nTo add a new product with data provided as named arguments:\n\n```sh\nbigc products add --name \"New Product\" --price 19.99 --type physical --weight 0\n```\n\n## Add a Product (via Standard Input)\n\nBigCommerce Toolkit also supports reading values from `stdin`, allowing for piping data between commands for easier scripting. For example:\n\n```sh\necho '{\"name\": \"New Product\", \"price\": 19.99, \"type\": \"physical\", \"weight\": 0}' | bigc products add --data -\n```\n\n### Update a Product\n\nThis can be further leveraged by piping through additional tools like `jq`. First, retrieving a product's ID by the product's name, and then updating that product's price:\n\n```sh\nbigc products get --name:like \"New Product\" | jq -r '.data[0].id' | bigc product update --id - --price 24.99\n```\n\n## Fetching All Products\n\nFor endpoints that support pagination, you can fetch all pages of data. Using tools like `jq` and `csvlook`, it is possible to format the data into a more readable format.\n\n```sh\nbigc products get-all | jq -r '[\"id\",\"sku\",\"name\"], (.data[] | [.id,.sku,.name]) | @csv' | csvlook\n```\n\n## Contributing\n\nWe welcome contributions to improve the project. Please submit issues and pull requests via GitHub.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A UNIX-style tool which provides easy access to BigCommerce's API from the command line.",
    "version": "0.1.6",
    "project_urls": {
        "Homepage": "https://github.com/TrellisCommerce/bigcommerce-toolkit",
        "Repository": "https://github.com/TrellisCommerce/bigcommerce-toolkit"
    },
    "split_keywords": [
        "bigcommerce",
        " api",
        " cli"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "08c485d96eae69d374cc98f24cc9d88cbb886c91ddd29fc4770e72a6f98e177f",
                "md5": "124c41b2ad507060a8b5e03630ecfc77",
                "sha256": "b8f9f90cfc2332cde1c6a457205ad46643a4aae663dd7776c0617e68606f2145"
            },
            "downloads": -1,
            "filename": "bigcommerce_toolkit-0.1.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "124c41b2ad507060a8b5e03630ecfc77",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.12",
            "size": 7429,
            "upload_time": "2024-09-18T22:01:50",
            "upload_time_iso_8601": "2024-09-18T22:01:50.306190Z",
            "url": "https://files.pythonhosted.org/packages/08/c4/85d96eae69d374cc98f24cc9d88cbb886c91ddd29fc4770e72a6f98e177f/bigcommerce_toolkit-0.1.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1d4820516b61d09d7e1080ef490670c2b769ef20ac8c69328ef90488c5314017",
                "md5": "a8ee38210be53e8f8b883a6f1551340d",
                "sha256": "ef2369a37e224773c9d9cbc5b82918cc6dc5b599c47e2e70afc5312fe68b6919"
            },
            "downloads": -1,
            "filename": "bigcommerce_toolkit-0.1.6.tar.gz",
            "has_sig": false,
            "md5_digest": "a8ee38210be53e8f8b883a6f1551340d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.12",
            "size": 7657,
            "upload_time": "2024-09-18T22:01:51",
            "upload_time_iso_8601": "2024-09-18T22:01:51.154286Z",
            "url": "https://files.pythonhosted.org/packages/1d/48/20516b61d09d7e1080ef490670c2b769ef20ac8c69328ef90488c5314017/bigcommerce_toolkit-0.1.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-18 22:01:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "TrellisCommerce",
    "github_project": "bigcommerce-toolkit",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "bigcommerce-toolkit"
}
        
Elapsed time: 2.66743s