semvec/pypi-packages huggingface dataset:
pythonLock 1.0
Package to used for handling lock mechanism when running appplication with multiple replicas
Keywords: python, distributed, lock, rds, sql, redis, replicas, kubernetes


# python-distributed-lock module

This Python package provides a mechanism to acquire and release Redis and MYSQL locks with authentication. It is useful for ensuring that only one process can access a particular resource or execute a critical section of code at a time.

## Features
- Connects to Redis or MySQL with username and password for authentication.
- Acquires a lock, executes a function, and then releases the lock.
- Useful in distributed systems where resource locking is needed.

## Installation

To install the module, use `pip`:

```
pip install pythonLock
```
# Please check your database connection before passing it to module
## use with mysql lock
```

from pythonLock import start_cron_with_expression

mysql_user = "root"
mysql_pass = "root"
mysql_host = "localhost"
mysql_database = "mysql"

connection = mysql.connector.connect(
    host=mysql_host,
    user=mysql_user,
    password=mysql_pass,
    database=mysql_database,
    pool_name="mypool",
    pool_size=3
)

cron_expression = "* */5 * * *"  # Runs every 5 minute
start_cron_with_expression(connection, my_custom_function, cron_expression,"mysql")


def my_custom_function():
    # add whatever action you want in your custom function
    pass
```

## use with redis lock
```

from pythonLock import start_cron_with_expression

redis_host = "localhost"
redis_port = 6379
redis_username = "default"
redis_password = "root"

# Connect to Redis with username and password
connection = redis.StrictRedis(
    host=redis_host,
    port=redis_port,
    username=redis_username,
    password=redis_password,
    decode_responses=True
)

cron_expression = "* */5 * * *"  # Runs every 5 minute
start_cron_with_expression(connection, my_custom_function, cron_expression,"redis")


def my_custom_function():
    # add whatever action you want in your custom function
    pass

```
python-distributed-locking 1.0
Package to used for handling lock mechanism when running appplication with multiple replicas
Keywords: python, distributed, lock, rds, sql, redis, replicas, kubernetes


# python-distributed-lock module

This Python package provides a mechanism to acquire and release Redis and MYSQL locks with authentication. It is useful for ensuring that only one process can access a particular resource or execute a critical section of code at a time.

## Features
- Connects to Redis or MySQL with username and password for authentication.
- Acquires a lock, executes a function, and then releases the lock.
- Useful in distributed systems where resource locking is needed.

## Installation

To install the module, use `pip`:

```
pip install python_distributed_locking
```
# Please check your database connection before passing it to module
## use with mysql lock
```

from python_distributed_locking import start_cron_with_expression

mysql_user = "root"
mysql_pass = "root"
mysql_host = "localhost"
mysql_database = "mysql"

connection = mysql.connector.connect(
    host=mysql_host,
    user=mysql_user,
    password=mysql_pass,
    database=mysql_database,
    pool_name="mypool",
    pool_size=3
)

cron_expression = "* */5 * * *"  # Runs every 5 minute
distributedlock.start_cron_with_expression(connection, my_custom_function, cron_expression,"mysql")


def my_custom_function():
    # add whatever action you want in your custom function
    pass
```

## use with redis lock
```

from python_distributed_locking import start_cron_with_expression

redis_host = "localhost"
redis_port = 6379
redis_username = "default"
redis_password = "root"

# Connect to Redis with username and password
connection = redis.StrictRedis(
    host=redis_host,
    port=redis_port,
    username=redis_username,
    password=redis_password,
    decode_responses=True
)

cron_expression = "* */5 * * *"  # Runs every 5 minute
distributedlock.start_cron_with_expression(connection, my_custom_function, cron_expression,"redis")


def my_custom_function():
    # add whatever action you want in your custom function
    pass

```
openstack-config 1.0.2
Openstack client extension that add kubectl-like config and context management
Requires Python: >=3.8

# Openstack-Config

Allows editing the clouds.yaml easily via CLI and adds kubectl-like contexts.

## Usage

```shell
# using uv, you can simply run
uvx --from python-openstackclient --with openstack-config openstack config get-contexts
```

* *openstack config current-context* - Display the current context
* *openstack config delete-context* - Delete the specified context from the clouds.yaml
* *openstack config get-contexts* - Describe one or many contexts
* *openstack config get-projects* - List all projects that are currently accessible
* *openstack config rename-contexts* - Rename a context from the clouds.yaml file
* *openstack config set* - Set an individual value in a clouds.yaml file
* *openstack config unset* - Unset an individual value in a clouds.yaml file
* *openstack config use-context* - Set the current context for all operations (use none to reset)
* *openstack config use-project* - Override the project in the current context within the clouds.yaml
* *openstack config view* - Display merged clouds.yaml settings or a specified clouds.yaml file

## Installation

### PyPI

```shell
pip install openstack-config
```

### Local build

```shell
git clone $REPO && cd $REPO
pip install -e .

# optional
eval "$(openstack complete)"
```