8
8
9
9
> ** jsonparse** is a simple JSON parsing library. Extract what's needed from key: value pairs.
10
10
11
+ ## What's New
12
+ - New public (or hostable) [ web API] ( #web-api ) :tada :
13
+
14
+ # Python Library
15
+
11
16
## Install
12
17
``` bash
13
18
pip install jsonparse
@@ -170,30 +175,19 @@ p.find_key_value(data, 'chain', 'B')
170
175
[{' chain' : ' B' , ' rope' : 7 , ' string' : 0.7 , ' cable' : True }]
171
176
```
172
177
173
- <!--
174
- # Web API
175
- If you want to use a jsonparse web API, currently you can host it yourself.
176
-
177
- ## Install + Run
178
- ```bash
179
- pip install "jsonparse[webapi]"
180
178
181
- gunicorn -b 0.0.0.0:8000 jsonparse.webapi:app
182
- ```
179
+ # Web API
183
180
184
- > Alternatively, run the docker container
181
+ ## Documentation
185
182
186
- ```bash
187
- docker run -d ctomkow/jsonparse
188
- ```
183
+ Visit [ the swagger API documentation] ( https://jsonparse.dev/v1/docs )
189
184
190
185
191
186
## Quickstart
192
- The following quickstart section assumes you are running the web API locally on your machine (127.0.0.1). If the address of where
193
- the web API is hosted is different (e.g. docker container or external server), change the IP accordingly.
187
+ Let's practice using the public, free-to-use-no-authentication, web API hosted in GCP Cloud Run.
194
188
195
189
``` bash
196
- curl -X POST "http ://127.0.0.1:8000 /v1/key/key1" \
190
+ curl -X POST " https ://jsonparse.dev /v1/key/key1" \
197
191
-H ' Content-Type: application/json' \
198
192
-d ' [{"key0":{"key1":"result","key2":{"key1":"result1","key3":{"key1":"result2"}}}}]'
199
193
@@ -217,12 +211,20 @@ data = [{
217
211
}
218
212
}]
219
213
220
- requests.post('http ://127.0.0.1:8000 /v1/key/key1', json=data).json()
214
+ requests.post(' https ://jsonparse.dev /v1/key/key1' , json = data).json()
221
215
222
216
[' result2' , ' result1' , ' result' ]
223
217
```
224
218
225
- ## Web API Endpoints
219
+ ## Self-Hosted
220
+ ``` bash
221
+ pip install " jsonparse[webapi]"
226
222
227
- Visit https://api.jsonparse.dev to view the swagger API documentation
228
- -->
223
+ gunicorn -b 0.0.0.0:8000 jsonparse.webapi:app
224
+ ```
225
+
226
+ > Alternatively, run the docker container
227
+
228
+ ``` bash
229
+ docker run -d ctomkow/jsonparse
230
+ ```
0 commit comments