semvec/pypi-packages huggingface dataset:
gae-impersonate-credentials 0.1.5
Get an GCP Credentials instance
Requires Python: >=3.7

# gae-impersonate-credentials

Get an GCP Credentials instance

App runs in GCP, return None for use Application Default Credentials(ADC).
When runs in local, impersonate requested service account by ADC.
(In local environment, ADC is developer's own google account that signed in with `gcloud auth application-default login` in normal usage.)

If use this function on Cloud Functions Python 3.9 Runtime, this function cannot detect actual run environment, because not supplied to `GOOGLE_CLOUD_PROJECT` or `GCP_PROJECT` environment variables.
You need to supply these value in deploy Cloud Functions deployment parameter or set `is_run_on_gcp` parameter in this function.

## Example usage

```
from gae_credentials import get_credentials
from google.cloud import ndb


credentials = get_credentials(
    service_account='example@appspot.gserviceaccount.com',
    scopes=[
      'https://www.googleapis.com/auth/datastore'
    ]
)

client = ndb.Client(credentials=credentials)
```
configgery-client-python 1.0.0
Python client for devices interacting with configgery.com
Requires Python: >=3.6

# Configgery Python client

## Install

```console
$ pip install configgery-client
```

## Getting Started

This library allows you to fetch the latest set of configurations for your device. 

First, create a device at [configgery.com](configgery.com) 
and store the generated private key and certificate in a safe place. 
Then, once you've added configurations to your device's group, 
you can fetch those same configurations.

### Fetching configurations
```python
from configgery.client import Client

client = Client('/path/to/configurations_dir', '/path/to/device.cert.pem', '/path/to/device.private.key')
client.download_configurations()
```

### Checking if up-to-date

```python
from configgery.client import Client

client = Client('/path/to/configurations_dir', '/path/to/device.cert.pem', '/path/to/device.private.key')
client.check_latest()
print(client.is_download_needed())
```

### Using a configuration

```python
from configgery.client import Client

client = Client('/path/to/configurations_dir', '/path/to/device.cert.pem', '/path/to/device.private.key')
success, data = client.get_configuration('myconfiguration.json')

if success:
    print(data)
else:
    print('Could not find configuration')
```

### Updating state
```python
from configgery.client import Client, DeviceState

client = Client('/path/to/configurations_dir', '/path/to/device.cert.pem', '/path/to/device.private.key')
client.download_configurations()
client.update_state(DeviceState.ConfigurationsApplied)

if device_happy():  # your own check
    client.update_state(DeviceState.Upvote)
else:
    client.update_state(DeviceState.Downvote)
```