Skip to content

Commit 9228cd0

Browse files
Release 26.1.4 → main (#253)
* SK-2813: Python SDK v2 — code quality, security hardening, and message fixes (#242) * SK-2833: Add backward-compatible deprecation shims for update_log_level and FileUploadRequest (#244) * SK-2813: Fix and clean up SDK sample files (#243) * SK-2842: configure to show README on PyPI
1 parent 7ce51fb commit 9228cd0

53 files changed

Lines changed: 4884 additions & 1278 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 2 additions & 159 deletions
Original file line numberDiff line numberDiff line change
@@ -1,162 +1,5 @@
11
# Changelog
22

3-
All notable changes to this project will be documented in this file.
3+
All notable changes to this project will be documented as part of the release notes.
44

5-
## [1.15.1] - 2023-12-07
6-
## Fixed
7-
- Not receiving tokens when calling Get with options tokens as true.
8-
9-
## [1.15.0] - 2023-10-30
10-
## Added
11-
- options tokens support for Get method.
12-
13-
## [1.14.0] - 2023-09-29
14-
## Added
15-
- Support for different BYOT modes in Insert method.
16-
17-
## [1.13.1] - 2023-09-14
18-
### Changed
19-
- Add `request_index` in responses for insert method.
20-
21-
## [1.13.0] - 2023-09-04
22-
### Added
23-
- Added new Query method.
24-
25-
## [1.12.0] - 2023-09-01
26-
### Added
27-
- Support for Bulk request with Continue on Error in Detokenize Method
28-
- Support for Continue on Error in Insert Method
29-
30-
## [1.11.0] - 2023-08-25
31-
### Added
32-
- Support for BYOT in Insert method.
33-
34-
## [1.10.1] - 2023-07-28
35-
### Fixed
36-
- Fixed delete method
37-
38-
## [1.10.0] - 2023-07-21
39-
### Added
40-
- Added delete method
41-
42-
## [1.9.2] - 2023-06-22
43-
### Fixed
44-
- Multiple record error in get method
45-
46-
## [1.9.1] - 2023-06-07
47-
### Fixed
48-
- Fixed bug in metrics
49-
50-
## [1.9.0] - 2023-06-07
51-
### Added
52-
- Added redaction type in detokenize
53-
54-
## [1.8.1] - 2023-03-17
55-
### Removed
56-
- removed grace period logic in bearer token generation
57-
58-
## [1.8.0] - 2023-01-10
59-
### Added
60-
- update and get methods.
61-
62-
## [1.7.0] - 2022-12-07
63-
### Added
64-
- `upsert` support for insert method.
65-
66-
## [1.6.2] - 2022-06-28
67-
68-
### Added
69-
- Copyright header to all files
70-
- Security email in README
71-
72-
## [1.6.1] - 2022-05-17
73-
74-
### Fixed
75-
76-
- Insert with multiple records returning invalid output
77-
78-
## [1.6.0] - 2022-04-12
79-
80-
### Added
81-
82-
- support for application/x-www-form-urlencoded and multipart/form-data content-type's in connections.
83-
84-
## [1.5.1] - 2022-03-29
85-
86-
### Added
87-
88-
- Validation to token obtained from `tokenProvider`
89-
90-
### Fixed
91-
92-
- Request headers not getting overridden due to case sensitivity
93-
94-
## [1.5.0] - 2022-03-22
95-
96-
### Changed
97-
98-
- `getById` changed to `get_by_id`
99-
- `invokeConnection`changed to `invoke_connection`
100-
- `generateBearerToken` changed to `generate_bearer_token`
101-
- `generateBearerTokenDromCreds` changed to `generate_bearer_token_from_creds`
102-
- `isExpired` changed to `is_expired`
103-
- `setLogLevel` changed to `set_log_level`
104-
105-
### Removed
106-
107-
- `isValid` function
108-
- `GenerateToken` function
109-
110-
## [1.4.0] - 2022-03-15
111-
112-
### Changed
113-
114-
- deprecated `isValid` in favour of `isExpired`
115-
116-
## [1.3.0] - 2022-02-24
117-
118-
### Added
119-
120-
- Request ID in error logs and error responses for API Errors
121-
- Caching to accessToken token
122-
- `isValid` method for validating Service Account bearer token
123-
124-
## [1.2.1] - 2022-01-18
125-
126-
### Fixed
127-
128-
- `generateBearerTokenFromCreds` raising error "invalid credentials" on correct credentials
129-
130-
## [1.2.0] - 2022-01-04
131-
132-
### Added
133-
134-
- Logging functionality
135-
- `setLogLevel` function for setting the package-level LogLevel
136-
- `generateBearerTokenFromCreds` function which takes credentials as string
137-
138-
### Changed
139-
140-
- Renamed and deprecated `GenerateToken` in favor of `generateBearerToken`
141-
- Make `vaultID` and `vaultURL` optional in `Client` constructor
142-
143-
## [1.1.0] - 2021-11-10
144-
145-
### Added
146-
147-
- `insert` vault API
148-
- `detokenize` vault API
149-
- `getById` vault API
150-
- `invokeConnection`
151-
152-
## [1.0.1] - 2021-10-26
153-
154-
### Changed
155-
156-
- Package description
157-
158-
## [1.0.0] - 2021-10-19
159-
160-
### Added
161-
162-
- Service Account Token generation
5+
See [Github](https://github.com/skyflowapi/skyflow-python/releases) or [PyPI](https://pypi.org/project/skyflow/#history) for more details on each released version.

README.md

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Skyflow Python SDK
22

3+
> **This is the current, recommended version of the Skyflow SDK.** V2.1.0 brings flexible auth, multi-vault support, native data types, and rich error diagnostics.
4+
>
5+
> Migrating from v1? See the **[Migration Guide](https://github.com/skyflowapi/skyflow-python/blob/main/docs/migrate_to_v2.md)** for step-by-step instructions. V1 is in maintenance mode and will reach End of Life on October 31, 2026.
6+
37
The Skyflow Python SDK is designed to help with integrating Skyflow into a Python backend.
48

59
## Table of Contents
@@ -235,8 +239,8 @@ from skyflow.utils.enums import RedactionType
235239

236240
detokenize_request = DetokenizeRequest(
237241
data=[
238-
{'token': 'token1', 'redaction': RedactionType.PLAIN_TEXT},
239-
{'token': 'token2', 'redaction': RedactionType.PLAIN_TEXT}
242+
{'token': 'token1', 'redaction_type': RedactionType.PLAIN_TEXT},
243+
{'token': 'token2', 'redaction_type': RedactionType.PLAIN_TEXT}
240244
],
241245
continue_on_error=True
242246
)
@@ -406,21 +410,36 @@ Refer to [Query your data](https://docs.skyflow.com/query-data/) and [Execute Qu
406410

407411
### Upload File
408412

409-
Upload files to a Skyflow vault using the `upload_file` method. Create a file upload request with the `FileUploadRequest` class, which accepts parameters such as the table name, column name, and Skyflow ID.
413+
Upload files to a Skyflow vault using the `upload_file` method. Create a file upload request with the `FileUploadRequest` class.
414+
415+
**Upload a file to an existing record:**
410416

411417
```python
412418
from skyflow.vault.data import FileUploadRequest
413419

414420
# Open the file in binary read mode
415421
with open('path/to/file.pdf', 'rb') as file_obj:
416422
upload_request = FileUploadRequest(
417-
table='documents', # Table name
418-
column_name='attachment', # Column name to store file
419-
skyflow_id='<SKYFLOW_ID>', # Skyflow ID of the record
420-
file_object=file_obj # Pass file object
423+
table='<TABLE_NAME>',
424+
column_name='<COLUMN_NAME>',
425+
skyflow_id='<SKYFLOW_ID>',
426+
file_object=file_obj
421427
)
422-
423-
# Perform File Upload
428+
429+
response = skyflow_client.vault('<VAULT_ID>').upload_file(upload_request)
430+
print('File upload:', response)
431+
```
432+
433+
**Upload a file and create a new record (omit `skyflow_id`):**
434+
435+
```python
436+
with open('path/to/file.pdf', 'rb') as file_obj:
437+
upload_request = FileUploadRequest(
438+
table='documents',
439+
column_name='attachment',
440+
file_object=file_obj
441+
)
442+
424443
response = skyflow_client.vault('<VAULT_ID>').upload_file(upload_request)
425444
print('File upload:', response)
426445
```

ruff.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ exclude = [
88
"venv",
99
"build",
1010
"dist",
11-
"tests"
11+
"tests",
12+
"samples"
1213
]
1314

1415
line-length = 120
1516

1617
[lint]
17-
select = ["N"]
18+
select = ["N", "PLR2004"]
1819

1920
[lint.pep8-naming]

0 commit comments

Comments
 (0)