File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -13,16 +13,17 @@ pip3 install json2xml
13
13
14
14
### Usage
15
15
16
- #### Command Line
16
+ ### Command Line
17
17
18
18
```
19
19
python -m src.cli --file="examples/example.json"
20
20
python -m src.cli --url="https://coderwall.com/vinitcool76.json"
21
+ python -m src.cli --data '{"login":"mojombo","id":1,"avatar_url":"https://avatars0.githubusercontent.com/u/1?v=4"}'
21
22
```
22
23
23
- #### Inline in Code
24
+ ### Inline in Code
24
25
25
- - From a file
26
+ #### From a file
26
27
27
28
``` python
28
29
from src.json2xml import Json2xml
@@ -31,7 +32,7 @@ data_object = Json2xml(data)
31
32
data_object.json2xml() # xml output
32
33
```
33
34
34
- - From an URL
35
+ #### From an URL
35
36
36
37
``` python
37
38
from src.json2xml import Json2xml
@@ -40,6 +41,14 @@ data_object = Json2xml(data)
40
41
data_object.json2xml() # xml output
41
42
```
42
43
44
+ #### From JSON string
45
+
46
+ ``` python
47
+ from src.json2xml import Json2xml
48
+ data = Json2xml.fromstring(' {"login":"mojombo","id":1,"avatar_url":"https://avatars0.githubusercontent.com/u/1?v=4"}' ).data
49
+ data_object = Json2xml(data)
50
+ data_object.json2xml() # xml output
51
+ ```
43
52
44
53
### Bugs, features
45
54
You can’t perform that action at this time.
0 commit comments