{"id":19312104,"url":"https://github.com/bigcommerce/bigcommerce-api-python","last_synced_at":"2025-04-05T01:08:13.318Z","repository":{"id":1627534,"uuid":"2339473","full_name":"bigcommerce/bigcommerce-api-python","owner":"bigcommerce","description":"Python client library for Bigcommerce API","archived":false,"fork":false,"pushed_at":"2024-01-25T19:41:53.000Z","size":339,"stargazers_count":91,"open_issues_count":24,"forks_count":81,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-03-29T00:08:52.321Z","etag":null,"topics":["api-client","bigcommerce","heroku-ready","oauth","python"],"latest_commit_sha":null,"homepage":"https://pypi.python.org/pypi/bigcommerce","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bigcommerce.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-09-07T04:48:59.000Z","updated_at":"2024-07-31T20:35:31.000Z","dependencies_parsed_at":"2024-01-08T21:50:39.937Z","dependency_job_id":"bb70fbcb-4633-415b-9f6b-8c409ae251b0","html_url":"https://github.com/bigcommerce/bigcommerce-api-python","commit_stats":{"total_commits":206,"total_committers":30,"mean_commits":6.866666666666666,"dds":0.6310679611650485,"last_synced_commit":"092c989c1da738982f987ea613e4a4a21edd1346"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigcommerce%2Fbigcommerce-api-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigcommerce%2Fbigcommerce-api-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigcommerce%2Fbigcommerce-api-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigcommerce%2Fbigcommerce-api-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bigcommerce","download_url":"https://codeload.github.com/bigcommerce/bigcommerce-api-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247271530,"owners_count":20911587,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","bigcommerce","heroku-ready","oauth","python"],"created_at":"2024-11-10T00:32:52.263Z","updated_at":"2025-04-05T01:08:13.297Z","avatar_url":"https://github.com/bigcommerce.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Bigcommerce API Python Client\n==================================\n\n|Build Status| |Package Version|\n\nWrapper over the ``requests`` library for communicating with the Bigcommerce v2 API.\n\nInstall with ``pip install bigcommerce`` or ``easy_install bigcommerce``. Tested with\npython 3.7-3.9, and only requires ``requests`` and ``pyjwt``.\n\nUsage\n-----\n\nConnecting\n~~~~~~~~~~\n\n.. code:: python\n\n    import bigcommerce\n\n    # Public apps (OAuth)\n    # Access_token is optional, if you don't have one you can use oauth_fetch_token (see below)\n    api = bigcommerce.api.BigcommerceApi(client_id='', store_hash='', access_token='')\n\n    # Private apps (Basic Auth)\n    api = bigcommerce.api.BigcommerceApi(host='store.mybigcommerce.com', basic_auth=('username', 'api token'))\n\n``BigcommerceApi`` also provides two helper methods for connection with OAuth2:\n\n-  ``api.oauth_fetch_token(client_secret, code, context, scope, redirect_uri)``\n   -- fetches and returns an access token for your application. As a\n   side effect, configures ``api`` to be ready for use.\n\n-  ``BigcommerceApi.oauth_verify_payload(signed_payload, client_secret)``\n   -- Returns user data from a signed payload.\n\nAccessing and objects\n~~~~~~~~~~~~~~~~~~~~~\n\nThe ``api`` object provides access to each API resource, each of which\nprovides CRUD operations, depending on capabilities of the resource:\n\n.. code:: python\n\n    api.Products.all()                         # GET /products (returns only a single page of products as a list)\n    api.Products.iterall()                     # GET /products (autopaging generator that yields all\n                                               #                  products from all pages product by product.)\n    api.Products.get(1)                        # GET /products/1\n    api.Products.create(name='', type='', ...) # POST /products\n    api.Products.get(1).update(price='199.90') # PUT /products/1\n    api.Products.delete_all()                  # DELETE /products\n    api.Products.get(1).delete()               # DELETE /products/1\n    api.Products.count()                       # GET /products/count\n\nThe client provides full access to subresources, both as independent\nresources:\n\n::\n\n    api.ProductOptions.get(1)                  # GET /products/1/options\n    api.ProductOptions.get(1, 2)               # GET /products/1/options/2\n\nAnd as helper methods on the parent resource:\n\n::\n\n    api.Products.get(1).options()              # GET /products/1/options\n    api.Products.get(1).options(1)             # GET /products/1/options/1\n\nThese subresources implement CRUD methods in exactly the same way as\nregular resources:\n\n::\n\n    api.Products.get(1).options(1).delete()\n\nFilters\n~~~~~~~\n\nFilters can be applied to ``all`` methods as keyword arguments:\n\n.. code:: python\n\n    customer = api.Customers.all(first_name='John', last_name='Smith')[0]\n    orders = api.Orders.all(customer_id=customer.id)\n\nError handling\n~~~~~~~~~~~~~~\n\nMinimal validation of data is performed by the client, instead deferring\nthis to the server. A ``HttpException`` will be raised for any unusual\nstatus code:\n\n-  3xx status code: ``RedirectionException``\n-  4xx status code: ``ClientRequestException``\n-  5xx status code: ``ServerException``\n\nThe low level API\n~~~~~~~~~~~~~~~~~\n\nThe high level API provided by ``bigcommerce.api.BigcommerceApi`` is a\nwrapper around a lower level api in ``bigcommerce.connection``. This can\nbe accessed through ``api.connection``, and provides helper methods for\nget/post/put/delete operations.\n\nAccessing V3 API endpoints\n~~~~~~~~~~~~~~~~~~~~~~~~~~\nAlthough this library currently only supports high-level modeling for V2 API endpoints,\nit can be used to access V3 APIs using the OAuthConnection object:\n\n::\n\n    v3client = bigcommerce.connection.OAuthConnection(client_id=client_id,\n                                                      store_hash=store_hash,\n                                                      access_token=access_token,\n                                                      api_path='/stores/{}/v3/{}')\n    v3client.get('/catalog/products', include_fields='name,sku', limit=5, page=1)\n\nAccessing GraphQL Admin API\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\nThere is a basic GraphQL client which allows you to submit GraphQL queries to the GraphQL Admin API.\n\n::\n\n    gql = bigcommerce.connection.GraphQLConnection(\n        client_id=client_id,\n        store_hash=store_hash,\n        access_token=access_token\n    )\n    # Make a basic query\n    time_query_result = gql.query(\"\"\"\n        query {\n          system {\n            time\n          }\n        }\n    \"\"\")\n    # Fetch the schema\n    schema = gql.introspection_query()\n\n\nManaging Rate Limits\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nYou can optionally pass a ``rate_limiting_management`` object into ``bigcommerce.api.BigcommerceApi`` or ``bigcommerce.connection.OAuthConnection`` for automatic rate limiting management, ex:\n\n.. code:: python\n\n    import bigcommerce\n\n    api = bigcommerce.api.BigcommerceApi(client_id='', store_hash='', access_token=''\n                                         rate_limiting_management= {'min_requests_remaining':2,\n                                                                    'wait':True,\n                                                                    'callback_function':None})\n\n``min_requests_remaining`` will determine the number of requests remaining in the rate limiting window which will invoke the management function\n\n``wait`` determines whether or not we should automatically sleep until the end of the window\n\n``callback_function`` is a function to run when the rate limiting management function fires. It will be invoked *after* the wait, if enabled.\n\n``callback_args`` is an optional parameter which is a dictionary passed as an argument to the callback function.\n\nFor simple applications which run API requests in serial (and aren't interacting with many different stores, or use a separate worker for each store) the simple sleep function may work well enough for most purposes. For more complex applications that may be parallelizing API requests on a given store, it's adviseable to write your own callback function for handling the rate limiting, use a ``min_requests_remaining`` higher than your concurrency, and not use the default wait function.\n\nFurther documentation\n---------------------\n\nFull documentation of the API is available on the Bigcommerce\n`Developer Portal \u003chttp://developer.bigcommerce.com\u003e`__\n\nTo do\n-----\n\n-  Automatic enumeration of multiple page responses for subresources.\n\n.. |Build Status| image:: https://api.travis-ci.org/bigcommerce/bigcommerce-api-python.svg?branch=master\n   :target: https://travis-ci.org/bigcommerce/bigcommerce-api-python\n.. |Package Version| image:: https://badge.fury.io/py/bigcommerce.svg\n   :target: https://pypi.python.org/pypi/bigcommerce\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigcommerce%2Fbigcommerce-api-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbigcommerce%2Fbigcommerce-api-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigcommerce%2Fbigcommerce-api-python/lists"}