Pre-release
This release is a pre-release and may not be stable for production use.
ds-protocol-http-py-lib
A Python package from the ds-common library collection.
Installation
Install the package using pip:
pip install ds-protocol-http-py-lib
Or using uv (recommended):
uv pip install ds-protocol-http-py-lib
Quick Start
from ds_protocol_http_py_lib import __version__
print(f"ds-protocol-http-py-lib version: {__version__}")
Usage
Read from a static URL
import uuid
from ds_protocol_http_py_lib.dataset.http import HttpDataset, HttpDatasetSettings
from ds_protocol_http_py_lib.enums import AuthType, HttpMethod
from ds_protocol_http_py_lib.linked_service import OAuth2AuthSettings
from ds_protocol_http_py_lib.linked_service.http import HttpLinkedService, HttpLinkedServiceSettings
linked_service = HttpLinkedService(
id=uuid.uuid4(),
name="my-linked-service",
version="1.0.0",
settings=HttpLinkedServiceSettings(
host="https://api.example.com",
auth_type=AuthType.OAUTH2,
oauth2=OAuth2AuthSettings(
token_endpoint="https://api.example.com/oauth/token",
client_id="my-client",
client_secret="******",
),
),
)
dataset = HttpDataset(
id=uuid.uuid4(),
name="my-dataset",
version="1.0.0",
linked_service=linked_service,
settings=HttpDatasetSettings(
method=HttpMethod.GET,
url="https://api.example.com/data",
),
)
linked_service.connect()
dataset.read()
df = dataset.output
Read from a URL with path parameters
Use {param} placeholders in the URL and supply their values via path_params:
import uuid
from ds_protocol_http_py_lib.dataset.http import HttpDataset, HttpDatasetSettings
from ds_protocol_http_py_lib.enums import AuthType, HttpMethod
from ds_protocol_http_py_lib.linked_service import OAuth2AuthSettings
from ds_protocol_http_py_lib.linked_service.http import HttpLinkedService, HttpLinkedServiceSettings
linked_service = HttpLinkedService(
id=uuid.uuid4(),
name="my-linked-service",
version="1.0.0",
settings=HttpLinkedServiceSettings(
host="https://api.example.com",
auth_type=AuthType.OAUTH2,
oauth2=OAuth2AuthSettings(
token_endpoint="https://api.example.com/oauth/token",
client_id="my-client",
client_secret="******",
),
),
)
dataset = HttpDataset(
id=uuid.uuid4(),
name="my-dataset",
version="1.0.0",
linked_service=linked_service,
settings=HttpDatasetSettings(
method=HttpMethod.GET,
url="https://api.example.com/documents/{document_guid}/original",
path_params={"document_guid": "abc123"},
),
)
linked_service.connect()
dataset.read()
df = dataset.output
# Request is sent to: https://api.example.com/documents/abc123/original
Requirements
- Python 3.11 or higher
Documentation
Full documentation is available at:
Development
To contribute or set up a development environment:
# Clone the repository
git clone https://github.com/grasp-labs/ds-protocol-http-py-lib.git
cd ds-protocol-http-py-lib
# Install development dependencies
uv sync --all-extras --dev
# Run tests
make test
See the README for more information.
License
This package is licensed under the Apache License 2.0. See the LICENSE-APACHE file for details.
Support
- Issues: GitHub Issues
- Releases: GitHub Releases
Metadata
Release files for ds-protocol-http-py-lib 0.1.0rc2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ds_protocol_http_py_lib-0.1.0rc2.tar.gz | 23.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ds_protocol_http_py_lib-0.1.0rc2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 48.4 kB
Release files / ds_protocol_http_py_lib-0.1.0rc2.tar.gz
| Download URL | ds_protocol_http_py_lib-0.1.0rc2.tar.gz |
|---|---|
| Size | 23.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
92c668c541acc54479a4609f3362627218ea1e177a21c4a5a845152ed1f13500
|
|
BLAKE2b-256 checksum How to use checksums |
aff7a1e3a5828390936052e61fe68ea75ea12b86b84903dc6899e02982fb930d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / ds_protocol_http_py_lib-0.1.0rc2-py3-none-any.whl
| Download URL | ds_protocol_http_py_lib-0.1.0rc2-py3-none-any.whl |
|---|---|
| Size | 25.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
112fb5621dcf7d855c029da1ca1164274153f4f83a3f3f827614bdf9d516dfe1
|
|
BLAKE2b-256 checksum How to use checksums |
0e12b3637714a31101b6407320777b9f52b8097df4c143857f0e1cefbae2cdad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|