semvec/pypi-packages huggingface dataset:
sap-cf-destination 0.1.2
SAP Destination SDK for Cloud Foundry
Requires Python: >=3.9

# SAP Cloud Foundry Destination

sap-cf-destination is as open-source destination client built on top of HTTPX to connect to HTTP remote-services using destination when deploying your python application on BTP.

Install sap-cf-destination using 

```bash
$ pip install sap-cf-destination
```

## Pre-requisites:
- Access to BTP subaccount with permission to create destinations.
- Cloud Foundry space with instances of Destination service and connectivity service (only for on-premise destinations).

*Note: On-Premise destinations requires cloud-connector to be set-up in the BTP subaccount.*

---

Now, lets get started:

```python
from sap_cf_destination import Destination

dest = Destination("<Destination Name>")

client = dest.get_client() # HTTPX client with preconfigured base-url and headers from destination configuration

response = client.get("/").json()

```

The library also supports async clients

```python
client = dest.get_aclient()

response = await client.get("/").json()
```

Only the following Authentication type are supported:
1. NoAuthentication
2. BasicAuthentication
3. OAuth2ClientCredentials
4. PrincipalPropagation

and the following Proxy types are supported:
1. Internet
2. OnPremise

## Environment Variables

The library supports service binding and retrieves the instance credentials from `VCAP_SERVICES`. It also supports providing destinations as a list of dictionary in the environment varibales, this is useful when testing the application locally. The following parameters are supported:

|     | Description |
| --- | ----------- |
| name | Destination Name |
| url | URL to remote service |
| proxy_type | Internet or OnPremise |
| authentication | Authentication used by remote service currently only the following authentication types are supported: NoAuthentication, BasicAuthentication |
| username | username for Basic authentication |
| password | password for Basic authentication |
| forwardAuthToken | true or false |
| proxyHost | proxy host for on-premise services |
| proxyPort | proxy port for on-premise services |
| timeout | request timeout |
dumbwebsearch 0.2.0
dumb web interface to search/browse indexed text files
Requires Python: >=3
Keywords: search, server, web

# dumb web search

- index a directory of text files in sqlite database
- web browse this directory
- web search this directory with indexed text

## how to run

### locally

```
./index.py --docroot /path/to/markdown/dir --database /path/to/database.sqlite index

HTTP_SERVER_BASEURL=/reverse/proxy/subpath HTTP_SERVER_PORT=1234 INDEX_DIR=/path/to/markdown/dir INDEX_DATABASE=/path/to/database.sqlite ./browse.wsgi
```

### in a docker/podman container:

```
docker run -d -v /path/to/your/markdown/files:/text -v dumbwebsearch-db:/database -e HTTP_SERVER_BASEURL=/reverse/proxy/subpath -p 8000:8000 registry.gitlab.com/hydrargyrum/dumbwebsearch:latest
```

## requirements

- python3
- sqlite to index/search text
- wsgi to expose said app
- jinja2 + bottle as web framework
- pandoc

## security

- no authentication: put a reverse proxy in front of it with some login
- no optimization for performance: put a reverse proxy to prevent hammering
- pandoc is run to render markdown files, which may have its own problems

## what could be better done

- don't make markdown so much ingrained in this app