Skip to content

Commit dbe1b7e

Browse files
authored
docs: update readme according to template (#34)
1 parent 80fb3f3 commit dbe1b7e

1 file changed

Lines changed: 38 additions & 129 deletions

File tree

README.md

Lines changed: 38 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,14 @@
1+
![Build status](https://github.com/SAP/cloud-sdk-python/workflows/Build/badge.svg) [![REUSE status](https://api.reuse.software/badge/github.com/SAP/cloud-sdk-python)](https://api.reuse.software/info/github.com/SAP/cloud-sdk-python)
2+
13
# SAP Cloud SDK for Python
24

5+
## About this project
6+
37
This SDK provides consistent interfaces for interacting with foundational services such as object storage, destination management, audit logging, telemetry, and secure credential handling.
48

59
The Python SDK offers a clean, type-safe API following Python best practices while maintaining compatibility with the SAP Application Foundation ecosystem.
610

7-
---
8-
9-
## Available Modules
10-
11-
- [AuditLog User Guide](src/sap_cloud_sdk/core/auditlog/user-guide.md) - Compliance audit logging for SAP Audit Log Service
12-
- [Destination User Guide](src/sap_cloud_sdk/destination/user-guide.md) - SAP BTP Destination Service integration with proxy support
13-
- [ObjectStore User Guide](src/sap_cloud_sdk/objectstore/user-guide.md) - S3-compatible object storage
14-
- [Secret Resolver User Guide](src/sap_cloud_sdk/core/secret_resolver/user-guide.md) - Secure credential management from mounted volumes and environment variables
15-
- [Telemetry User Guide](src/sap_cloud_sdk/core/telemetry/user-guide.md) - OpenTelemetry tracing and GenAI auto-instrumentation
16-
17-
---
18-
19-
## Installation
20-
21-
TODO: To be defined
22-
23-
---
24-
25-
## Quick Start
26-
27-
```python
28-
from sap_cloud_sdk.objectstore import create_client
29-
30-
# Create an ObjectStore client (auto-detects local vs cloud)
31-
client = create_client("my-instance")
32-
33-
# Upload a file
34-
client.put_object_from_bytes(
35-
name="example.txt",
36-
data=b"Hello, World!",
37-
content_type="text/plain"
38-
)
39-
```
40-
41-
---
42-
43-
## Key Features
11+
### Key Features
4412

4513
- 🤖 **AI Core Integration**
4614
- 📋 **Audit Log Service**
@@ -49,123 +17,64 @@ client.put_object_from_bytes(
4917
- 🔐 **Secret Resolver**
5018
- 📊 **Telemetry & Observability**
5119

52-
---
53-
54-
## Requirements
20+
## Requirements and Setup
5521

5622
- **Python**: 3.11 or higher
5723

58-
## Environment Configuration
24+
### Installation
5925

60-
The SDK automatically resolves configuration from multiple sources with the following priority:
26+
```python
27+
# uv
28+
uv add sap-cloud-sdk
6129

62-
1. **Kubernetes-mounted secrets**: `/etc/secrets/<module>/<instance>/<field>`
63-
2. **Environment variables**: `<MODULE>_<INSTANCE>_<FIELD>`
64-
- For instance names, hyphens (`"-"`) are replaced with underscores (`"_"`) for compatibility with system environment variables.
30+
# Poetry
31+
poetry add sap-cloud-sdk
6532

66-
### ObjectStore Configuration Example
33+
# Pip
34+
pip install sap-cloud-sdk
35+
````
6736

68-
```bash
69-
# Environment variables for ObjectStore with instance name "credentials"
70-
export OBJECTSTORE_CREDENTIALS_ACCESS_KEY_ID="your-access-key"
71-
export OBJECTSTORE_CREDENTIALS_SECRET_ACCESS_KEY="your-secret-key"
72-
export OBJECTSTORE_CREDENTIALS_BUCKET="your-bucket-name"
73-
export OBJECTSTORE_CREDENTIALS_HOST="s3.amazonaws.com"
74-
```
37+
### Environment Configuration
7538

76-
### Kubernetes Mounted Secrets Example
39+
The SDK automatically resolves configuration from multiple sources with the following priority:
7740

78-
```
79-
/etc/secrets/objectstore/credentials/
80-
├── access_key_id
81-
├── secret_access_key
82-
├── bucket
83-
└── host
84-
```
41+
1. **Kubernetes-mounted secrets**: `/etc/secrets/appfnd/<module>/<instance>/<field>`
42+
2. **Environment variables**: `CLOUD_SDK_CFG_<MODULE>_<INSTANCE>_<FIELD>`
43+
- For instance names, hyphens (`"-"`) are replaced with underscores (`"_"`) for compatibility with system environment variables.
44+
- You can see examples in our [env_integration_tests.example](.env_integration_tests.example)
8545

8646
### Telemetry Configuration
8747

8848
For production environments (SAP BTP Managed Runtime), no configuration is needed as `OTEL_EXPORTER_OTLP_ENDPOINT` is automatically injected.
8949

9050
For local development:
51+
9152
```bash
9253
export OTEL_EXPORTER_OTLP_ENDPOINT="https://otel-collector.example.com"
9354
```
9455

95-
---
56+
### Usage Guides
9657

97-
## Usage Examples
58+
Each module has comprehensive usage guides:
9859

99-
### Audit Logging
60+
- [AuditLog](src/sap_cloud_sdk/core/auditlog/user-guide.md)
61+
- [Destination](src/sap_cloud_sdk/destination/user-guide.md)
62+
- [ObjectStore](src/sap_cloud_sdk/objectstore/user-guide.md)
63+
- [Secret Resolver](src/sap_cloud_sdk/core/secret_resolver/user-guide.md)
64+
- [Telemetry](src/sap_cloud_sdk/core/telemetry/user-guide.md)
10065

101-
```python
102-
from sap_cloud_sdk.core.auditlog import (create_client, SecurityEvent)
103-
104-
# Create audit log client
105-
client = create_client()
106-
107-
# Security event - authentication attempt
108-
security_event = SecurityEvent(
109-
data="User login attempt",
110-
user="john.doe",
111-
tenant=Tenant.PROVIDER,
112-
identity_provider="SAP ID",
113-
ip="192.168.1.100",
114-
attributes=[
115-
SecurityEventAttribute("login_method", "password"),
116-
SecurityEventAttribute("session_id", "abc123")
117-
]
118-
)
119-
client.log(security_event)
120-
```
66+
## Support, Feedback, Contributing
12167

122-
### Secret Resolver
68+
This project is open to feature requests/suggestions, bug reports etc. via [GitHub issues](https://github.com/SAP/cloud-sdk-python/issues). Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our [Contribution Guidelines](CONTRIBUTING.md).
12369

124-
Securely load configuration and credentials from Kubernetes mounted volumes or environment variables:
70+
## Security / Disclosure
12571

126-
```python
127-
from dataclasses import dataclass, field
128-
from sap_cloud_sdk.core.secret_resolver import read_from_mount_and_fallback_to_env_var
129-
130-
# Load configuration
131-
config = DatabaseConfig()
132-
read_from_mount_and_fallback_to_env_var(
133-
base_volume_mount="/etc/secrets",
134-
base_var_name="MYAPP",
135-
module="database",
136-
instance="primary",
137-
target=config
138-
)
139-
```
72+
If you find any bug that may be a security problem, please follow our instructions at [in our security policy](https://github.com/SAP/cloud-sdk-python/security/policy) on how to report it. Please do not create GitHub issues for security-related doubts or problems.
14073

141-
### Telemetry with GenAI Auto-instrumentation
74+
## Code of Conduct
14275

143-
Comprehensive telemetry and observability for AI applications with automatic instrumentation:
76+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone. By participating in this project, you agree to abide by its [Code of Conduct](https://github.com/SAP/.github/blob/main/CODE_OF_CONDUCT.md) at all times.
14477

145-
```python
146-
from sap_cloud_sdk.core.telemetry import (
147-
auto_instrument, context_overlay, GenAIOperation,
148-
chat_span, execute_tool_span, invoke_agent_span,
149-
record_metrics, set_tenant_id, add_span_attribute
150-
)
151-
152-
# Enable auto-instrumentation before importing AI libraries
153-
auto_instrument()
154-
155-
from litellm import completion
156-
import openai
157-
158-
# Set tenant for multi-tenant applications
159-
set_tenant_id("tenant-123")
160-
161-
# Basic GenAI operation tracking
162-
with context_overlay(GenAIOperation.CHAT, attributes={"user.id": "123"}):
163-
response = completion(model="gpt-4", messages=[{"role": "user", "content": "Hello"}])
164-
165-
# Manual metrics and spans
166-
@record_metrics(module="myapp", operation="data_processing")
167-
def process_data(data):
168-
add_span_attribute("data.size", len(data))
169-
# Processing logic
170-
return processed_data
171-
```
78+
## Licensing
79+
80+
Copyright 2026 SAP SE or an SAP affiliate company and Cloud SDK Python contributors. Please see our [LICENSE](LICENSE) for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available [via the REUSE tool](https://api.reuse.software/info/github.com/SAP/cloud-sdk-python)

0 commit comments

Comments
 (0)