Skip to content

Commit 9625597

Browse files
committed
rename package name
1 parent 832865c commit 9625597

File tree

8 files changed

+20
-11
lines changed

8 files changed

+20
-11
lines changed

examples/at.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
Example of at()
33
"""
4-
from pyjsonq.query import JsonQ
4+
from pyjsonq import JsonQ
55

66
qe = JsonQ("./data.json").at("users").where("id", "<", 3).get()
77

examples/chunk.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
"""
22
Example of chunk()
33
"""
4-
from pyjsonq.query import JsonQ
4+
from pyjsonq import JsonQ
55

6-
e1 = JsonQ("./data.json").at("users").where("location", "=", "Barisal").chunk(2)
6+
e1 = JsonQ("./data.json").at("users")\
7+
.where("location", "=", "Barisal")\
8+
.chunk(2)
79

810
print("result", e1)

examples/group_by.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
Example of group_by()
33
"""
4-
from pyjsonq.query import JsonQ
4+
from pyjsonq import JsonQ
55

66
e1 = JsonQ("./data.json").at("products").group_by("price").get()
77

examples/sort_by.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
Example of sort_by()
33
"""
4-
from pyjsonq.query import JsonQ
4+
from pyjsonq import JsonQ
55

66
e1 = JsonQ("./data.json").at("products").sort_by("id", "desc").get()
77

examples/sum.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
Example of sum()
33
"""
4-
from pyjsonq.query import JsonQ
4+
from pyjsonq import JsonQ
55

66
e1 = JsonQ("./data.json").at("users.5.visits").sum("year")
77

examples/where.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
"""
22
Example of where()
33
"""
4-
from pyjsonq.query import JsonQ
4+
from pyjsonq import JsonQ
55

6-
e1 = JsonQ("./data.json").at("users").where("id", ">", 3).where("location", "=", "Barisal").get()
6+
e1 = JsonQ("./data.json").at("users")\
7+
.where("id", ">", 3)\
8+
.where("location", "=", "Barisal")\
9+
.get()
710

811
print("result", e1)
912

10-
e2 = JsonQ("./data.json").at("users").where("id", ">", 3).where("location", "=", "Barisal").get()
13+
e2 = JsonQ("./data.json").at("users")\
14+
.where("id", ">", 3)\
15+
.where("location", "=", "Barisal")\
16+
.get()
1117

1218
print("result", e2)

pyjsonq/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .query import JsonQ

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Just import the package before start using it.
1515
As a Python Package:
1616

1717
```python
18-
from pyjsonq.query import JsonQ
18+
from pyjsonq import JsonQ
1919
```
2020

2121
You can start using this package right away by importing your Json data from a file:
@@ -26,7 +26,7 @@ JsonQ('data.json')
2626
or
2727

2828
```Python
29-
JsonQ(data={"id": 1, "name": "shaonty"})
29+
JsonQ(data={"id": 1, "name": "shaonty"}) # must assign data if you want to pass data instead of file_path
3030
```
3131

3232
You can start Query your data using the various query methods such as **where**, **or_where**, **where_in**, **where_not_in**, **where_starts_with**, **where_ends_with**, **where_contains** and so on. Also you can aggregate your data after query using **sum**, **count**, **group_by**, **sort_by**, **max**, **min** etc.

0 commit comments

Comments
 (0)