Skip to content

Commit 0bee4a4

Browse files
committed
test
1 parent dc77ff9 commit 0bee4a4

File tree

1 file changed

+0
-147
lines changed

1 file changed

+0
-147
lines changed

README.rst

Lines changed: 0 additions & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -2,150 +2,3 @@ Modified WooCommerce API - Python Client
22
===============================
33

44
A Python wrapper for the WooCommerce REST API. Easily interact with the WooCommerce REST API using this library.
5-
6-
.. image:: https://github.com/woocommerce/wc-api-python/actions/workflows/ci.yml/badge.svg?branch=trunk
7-
:target: https://github.com/woocommerce/wc-api-python/actions/workflows/ci.yml
8-
9-
.. image:: https://img.shields.io/pypi/v/woocommerce.svg
10-
:target: https://pypi.python.org/pypi/WooCommerce
11-
12-
13-
Installation
14-
------------
15-
16-
.. code-block:: bash
17-
18-
pip install woocommerce
19-
20-
Getting started
21-
---------------
22-
23-
Generate API credentials (Consumer Key & Consumer Secret) following this instructions http://woocommerce.github.io/woocommerce-rest-api-docs/#rest-api-keys.
24-
25-
Check out the WooCommerce API endpoints and data that can be manipulated in http://woocommerce.github.io/woocommerce-rest-api-docs/.
26-
27-
Setup
28-
-----
29-
30-
.. code-block:: python
31-
32-
from woocommerce import API
33-
34-
wcapi = API(
35-
url="http://example.com",
36-
consumer_key="ck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
37-
consumer_secret="cs_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
38-
version="wc/v3"
39-
)
40-
41-
Options
42-
~~~~~~~
43-
44-
+-----------------------+-------------+----------+-------------------------------------------------------------------------------------------------------+
45-
| Option | Type | Required | Description |
46-
+=======================+=============+==========+=======================================================================================================+
47-
| ``url`` | ``string`` | yes | Your Store URL, example: http://woo.dev/ |
48-
+-----------------------+-------------+----------+-------------------------------------------------------------------------------------------------------+
49-
| ``consumer_key`` | ``string`` | yes | Your API consumer key |
50-
+-----------------------+-------------+----------+-------------------------------------------------------------------------------------------------------+
51-
| ``consumer_secret`` | ``string`` | yes | Your API consumer secret |
52-
+-----------------------+-------------+----------+-------------------------------------------------------------------------------------------------------+
53-
| ``version`` | ``string`` | no | API version, default is ``wc/v3`` |
54-
+-----------------------+-------------+----------+-------------------------------------------------------------------------------------------------------+
55-
| ``timeout`` | ``integer`` | no | Connection timeout, default is ``5`` |
56-
+-----------------------+-------------+----------+-------------------------------------------------------------------------------------------------------+
57-
| ``verify_ssl`` | ``bool`` | no | Verify SSL when connect, use this option as ``False`` when need to test with self-signed certificates |
58-
+-----------------------+-------------+----------+-------------------------------------------------------------------------------------------------------+
59-
| ``query_string_auth`` | ``bool`` | no | Force Basic Authentication as query string when ``True`` and using under HTTPS, default is ``False`` |
60-
+-----------------------+-------------+----------+-------------------------------------------------------------------------------------------------------+
61-
| ``user_agent`` | ``string`` | no | Set a custom User-Agent, default is ``WooCommerce-Python-REST-API/3.0.0`` |
62-
+-----------------------+-------------+----------+-------------------------------------------------------------------------------------------------------+
63-
| ``oauth_timestamp`` | ``integer`` | no | Custom timestamp for requests made with oAuth1.0a |
64-
+-----------------------+-------------+----------+-------------------------------------------------------------------------------------------------------+
65-
| ``wp_api`` | ``bool`` | no | Set to ``False`` in order to use the legacy WooCommerce API (deprecated) |
66-
+-----------------------+-------------+----------+-------------------------------------------------------------------------------------------------------+
67-
68-
Methods
69-
-------
70-
71-
+--------------+----------------+------------------------------------------------------------------+
72-
| Params | Type | Description |
73-
+==============+================+==================================================================+
74-
| ``endpoint`` | ``string`` | WooCommerce API endpoint, example: ``customers`` or ``order/12`` |
75-
+--------------+----------------+------------------------------------------------------------------+
76-
| ``data`` | ``dictionary`` | Data that will be converted to JSON |
77-
+--------------+----------------+------------------------------------------------------------------+
78-
| ``**kwargs`` | ``dictionary`` | Accepts ``params``, also other Requests arguments |
79-
+--------------+----------------+------------------------------------------------------------------+
80-
81-
GET
82-
~~~
83-
84-
- ``.get(endpoint, **kwargs)``
85-
86-
POST
87-
~~~~
88-
89-
- ``.post(endpoint, data, **kwargs)``
90-
91-
PUT
92-
~~~
93-
94-
- ``.put(endpoint, data), **kwargs``
95-
96-
DELETE
97-
~~~~~~
98-
99-
- ``.delete(endpoint, **kwargs)``
100-
101-
OPTIONS
102-
~~~~~~~
103-
104-
- ``.options(endpoint, **kwargs)``
105-
106-
Response
107-
--------
108-
109-
All methods will return `Response <http://docs.python-requests.org/en/latest/api/#requests.Response>`_ object.
110-
111-
Example of returned data:
112-
113-
.. code-block:: bash
114-
115-
>>> r = wcapi.get("products")
116-
>>> r.status_code
117-
200
118-
>>> r.headers['content-type']
119-
'application/json; charset=UTF-8'
120-
>>> r.encoding
121-
'UTF-8'
122-
>>> r.text
123-
u'{"products":[{"title":"Flying Ninja","id":70,...' // Json text
124-
>>> r.json()
125-
{u'products': [{u'sold_individually': False,... // Dictionary data
126-
127-
Request with `params` example
128-
-----------------------------
129-
130-
.. code-block:: python
131-
132-
from woocommerce import API
133-
134-
wcapi = API(
135-
url="http://example.com",
136-
consumer_key="ck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
137-
consumer_secret="cs_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
138-
version="wc/v3"
139-
)
140-
141-
# Force delete example.
142-
print(wcapi.delete("products/100", params={"force": True}).json())
143-
144-
# Query example.
145-
print(wcapi.get("products", params={"per_page": 20}).json())
146-
147-
148-
Changelog
149-
---------
150-
151-
See `CHANGELOG.md <https://github.com/woocommerce/wc-api-python/blob/trunk/CHANGELOG.md>`_.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy