You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-198Lines changed: 1 addition & 198 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,8 +25,7 @@ This Python SDK is designed to help developers easily implement Skyflow into the
25
25
-[Invoke Connection](#invoke-connection)
26
26
-[Logging](#logging)
27
27
-[Reporting a Vulnerability](#reporting-a-vulnerability)
28
-
-[Get](#get-1)
29
-
-[Update](#update-1)
28
+
30
29
31
30
## Features
32
31
@@ -722,199 +721,3 @@ Current the following 5 log levels are supported:
722
721
## Reporting a Vulnerability
723
722
724
723
If you discover a potential security issue in this project, please reach out to us at security@skyflow.com. Please do not create public GitHub issues or Pull Requests, as malicious actors could potentially view them.
725
-
726
-
### Get
727
-
728
-
To retrieve data using Skyflow IDs or unique column values, use the `get(records: dict)` method. The `records` parameter takes a Dictionary that contains either an array of Skyflow IDs or a unique column name and values.
729
-
730
-
Note: You can use either Skyflow IDs or `unique` values to retrieve records. You can't use both at the same time.
731
-
732
-
```python
733
-
{
734
-
'records': [
735
-
{
736
-
'columnName': str, # Name of the unique column.
737
-
'columnValues': [str], # List of unique column values.
738
-
'table': str, # Name of table holding the data.
739
-
'redaction': Skyflow.RedactionType, # Redaction applied to retrieved data.
740
-
}
741
-
]
742
-
}
743
-
or
744
-
{
745
-
'records': [
746
-
{
747
-
'ids': [str], # List of Skyflow IDs.
748
-
'table': str, # Name of table holding the data.
749
-
'redaction': Skyflow.RedactionType, # Redaction applied to retrieved data.
750
-
}
751
-
]
752
-
}
753
-
754
-
```
755
-
Sample usage
756
-
757
-
The following snippet shows how to use the `get()` method. For details, see [get_sample.py].(https://github.com/skyflowapi/skyflow-python/blob/main/samples/get_sample.py),
To update data in your vault, use the `update(records: dict, options: UpdateOptions)` method. The `records` parameter takes a Dictionary that contains records to fetch. If `UpdateTokens` is `True`, Skyflow returns tokens for the record you just updated. If `, ids if `UpdateOptions` is `False`, Skyflow returns IDs for the record you updated.
827
-
828
-
```python
829
-
# Optional, indicates whether to return all fields for updated data. Defaults to 'true'.
830
-
options: UpdateOptions
831
-
```
832
-
833
-
```python
834
-
{
835
-
'records': [
836
-
{
837
-
'id': str, # Skyflow ID of the record to be updated.
838
-
'table': str, # Name of table holding the skyflowID.
839
-
'fields': {
840
-
str: str# Name of the column and value to update.
841
-
}
842
-
}
843
-
]
844
-
}
845
-
```
846
-
Sample usage
847
-
848
-
The following snippet shows how to use the `update()` method. For details, see [update_sample.py](https://github.com/skyflowapi/skyflow-python/blob/main/samples/update_sample.py),
849
-
850
-
```python
851
-
records = {
852
-
'records': [
853
-
{
854
-
'id': '56513264-fc45-41fa-9cb0-d1ad3602bc49',
855
-
'table': 'cards',
856
-
'fields': {
857
-
'card_number': '45678910234'
858
-
}
859
-
}
860
-
]
861
-
}
862
-
try:
863
-
client.update(records, UpdateOptions(True))
864
-
except SkyflowError as e:
865
-
if e.data:
866
-
print(e.data)
867
-
else:
868
-
print(e)
869
-
```
870
-
871
-
Sample response
872
-
873
-
`UpdateOptions` set to `True`
874
-
875
-
```python
876
-
{
877
-
'records':[
878
-
{
879
-
'id':'56513264-fc45-41fa-9cb0-d1ad3602bc49',
880
-
'fields':{
881
-
'card_number':'0051-6502-5704-9879'
882
-
}
883
-
}
884
-
],
885
-
'errors':[]
886
-
}
887
-
```
888
-
889
-
`UpdateOptions` set to `False`
890
-
891
-
```python
892
-
{
893
-
'records':[
894
-
{
895
-
'id':'56513264-fc45-41fa-9cb0-d1ad3602bc49'
896
-
}
897
-
],
898
-
'errors':[]
899
-
}
900
-
```
901
-
902
-
Sample Error
903
-
904
-
```python
905
-
{
906
-
'records':[
907
-
{
908
-
'id':'56513264-fc45-41fa-9cb0-d1ad3602bc49'
909
-
}
910
-
],
911
-
'errors':[
912
-
{
913
-
'error':{
914
-
'code':404,
915
-
'description':'Token for skyflowID doesn"t exist in vault - Request ID: a8def196-9569-9cb7-9974-f899f9e4bd0a'
0 commit comments