Skip to content

Commit 56a6447

Browse files
committed
Merge branch 'release/v0.0.7'
2 parents 16dc651 + 62581ed commit 56a6447

18 files changed

+120
-82
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
__pycache__
2-
src/Rocketstore/test
2+
.venv

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ keywords:
1717
- file
1818
- rocket
1919
license: MIT
20-
version: 0.0.6
20+
version: 0.0.7

MANIFEST.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ include README.md
44
include *.toml
55
recursive-include src *.py
66
recursive-include src/Rocketstore *.py
7-
recursive-include src/Rocketstore/utils *.py
7+
recursive-include src/Rocketstore/utils *.py
8+
prune */__pycache__
9+
recursive-exclude Samples/*

README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,31 @@ Compare Rocket-Store, SQL and file system terms:
4848
To use Rocketstore, you must first import the library:
4949

5050
```python
51-
from Rocketstore import Rocketstore, _FORMAT_JSON
51+
from Rocketstore import Rocketstore
5252

5353
rs = Rocketstore()
54+
```
55+
56+
usage of constants:
57+
```python
58+
59+
#method 1:
60+
rs = Rocketstore()
61+
rs.post(..., rs._FORMAT_JSON)
62+
63+
#or
64+
65+
rs.post(..., Rocketstore._FORMAT_JSON)
5466

5567
```
5668

69+
5770
### Post
5871

5972
```python
60-
rs.post(collection="delete_fodders1", key="1", record={"some":"json input"}, flags=_FORMAT_JSON)
73+
rs.post(collection="delete_fodders1", key="1", record={"some":"json input"}, flags=Rocketstore._FORMAT_JSON)
6174
# or
62-
rs.post("delete_fodders1", "1", {"some":"json input"}, _FORMAT_JSON)
75+
rs.post("delete_fodders1", "1", {"some":"json input"}, Rocketstore._FORMAT_JSON)
6376
```
6477

6578
Stores a record in a collection identified by a unique key
@@ -153,10 +166,10 @@ __Options__:
153166
* data_format: Specify which format the records are stored in. Values are: _FORMAT_NATIVE - default. and RS_FORMAT_JSON - Use JSON data format.
154167

155168
```python
156-
rs.options(data_format=_FORMAT_JSON)
169+
rs.options(data_format=Rocketstore._FORMAT_JSON)
157170
# or
158171
rs.options(**{
159-
"data_format": _FORMAT_JSON,
172+
"data_format": Rocketstore._FORMAT_JSON,
160173
...
161174
})
162175
```

Samples/Post/README.md renamed to Samples/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Sample implementation
22

3+
Files:
4+
* `generial`: post, get, count, delete
5+
* `post`: post
6+
37
1) create virtual environment `virtual ./.venv`
48
2) activate it ` . ./venv/bin/activate`
59
3) install dependencies `pip install Rocket-Store`

src/Rocketstore/example.py renamed to Samples/generic_example.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,20 @@
99
Docs: documentation
1010
"""
1111

12-
from .Rocketstore import Rocketstore, _FORMAT_JSON, _FORMAT_NATIVE, _FORMAT_XML, _ADD_AUTO_INC, _ORDER_DESC
12+
from Rocketstore import Rocketstore
1313

14-
rs = Rocketstore(**{"data_storage_area": "./webapp",
15-
"data_format": _FORMAT_JSON})
14+
rs = Rocketstore(**{"data_storage_area": "./test",
15+
"data_format": Rocketstore._FORMAT_JSON})
1616

1717
rs.post("cars", "Mercedes_Benz_GT_R", {"owner": "Lisa Simpson"})
1818

1919
print("GET: ", rs.get("cars", ""), "\n-----\n")
2020
# GET: {'count': 1, 'key': ['Mercedes_Benz_GT_R'], 'result': [{'owner': 'Lisa Simpson'}]}
2121

22-
rs.post("cars", "BMW_740li", {"owner": "Greg Onslow"}, _ADD_AUTO_INC)
23-
rs.post("cars", "BMW_740li", {"owner": "Sam Wise"}, _ADD_AUTO_INC)
24-
rs.post("cars", "BMW_740li", {"owner": "Bill Bo"}, _ADD_AUTO_INC)
22+
rs.post("cars", "BMW_740li", {
23+
"owner": "Greg Onslow"}, Rocketstore._ADD_AUTO_INC)
24+
rs.post("cars", "BMW_740li", {"owner": "Sam Wise"}, Rocketstore._ADD_AUTO_INC)
25+
rs.post("cars", "BMW_740li", {"owner": "Bill Bo"}, Rocketstore._ADD_AUTO_INC)
2526
# tienen que haber un BMW_740li
2627

2728
print("GET ALL CARS: ", rs.get("cars", "*"), "\n-----\n")
@@ -60,7 +61,7 @@
6061

6162

6263
print("Get list ordered by alphabetically descending keys: ",
63-
rs.get("cars", "", _ORDER_DESC), "\n-----\n")
64+
rs.get("cars", "", Rocketstore._ORDER_DESC), "\n-----\n")
6465
'''
6566
Get list ordered by alphabetically descending keys:
6667
{

Samples/Post/test.py renamed to Samples/post.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
from Rocketstore import Rocketstore, _ADD_AUTO_INC
1+
from Rocketstore import Rocketstore
22

33
rs = Rocketstore(**{"data_storage_area": "./test"})
44

55
print(rs)
6+
print("test Constants:", rs._ADD_AUTO_INC)
7+
print("test Constants: ", Rocketstore._ADD_AUTO_INC)
68

79
dataInput = {
810
"content": "hello asfalsdfsalfaslflasl",
@@ -17,6 +19,11 @@
1719

1820

1921
out = rs.post("glOtc6EzYQTZEt0J18cU1f4Ycdz1H8WWTDVkBQTp1Gv2BWgb",
20-
"memories", dataInput, _ADD_AUTO_INC)
22+
"memories", dataInput, rs._ADD_AUTO_INC)
23+
24+
print(out)
25+
26+
out = rs.post("glOtc6EzYQTZEt0J18cU1f4Ycdz1H8WWTDVkBQTp1Gv2BWgb",
27+
"memories", dataInput, Rocketstore._ADD_AUTO_INC)
2128

2229
print(out)

dist/Rocket-Store-0.0.5.tar.gz

-20.7 KB
Binary file not shown.

dist/Rocket-Store-0.0.7.tar.gz

16.9 KB
Binary file not shown.
-16.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)