semvec/pypi-packages huggingface dataset:
bojan 0.0.20
A simple logging library
License: MIT
Requires Python: >=3.6

# Bojan Library

BojanConsole is a Python library designed to enhance console logging with various message types and color-coded outputs.

## Installation

To install Bojan simply run

```bash
pip install bojan
```

## Syntax Highlight

A [VS Code extension](https://github.com/daniilgrydin/bojan-vscode-highlighter) is available to highlight the .bojan and .bjn log files.

## Usage

### BojanConsole Class

#### Initialization

```python
from bojan import BojanConsole

console = BojanConsole(printing=True)
```
> Note that `printing` decides whether the instance will print to terminal or just store logs for later use. 

#### Logging Messages

- **Info Message**:
    ```python
    console.print("This is an info message.", identifier="🗣️", depth=0)
    ```
    output:
    ```
    🗣️ This is an info message.
    ```

- **Debug Message**:
    ```python
    console.debug("This is a debug message.")
    ```
    output:
    ```
    💬 This is a debug message.
    ```

- **Error Message**:
    ```python
    console.error("This is an error message.")
    ```
    output:
    ```
    ❌ This is an error message.
    ```

- **Success Message**:
    ```python
    console.success("This is a success message.")
    ```
    output:
    ```
    ✅ This is a success message.
    ```

- **Warning Message**:
    ```python
    console.warning("This is a warning message.")
    ```
    output:
    ```
    ⚠️ This is a debug message.
    ```

#### Printing Dictionaries

```python
sample_dict = {"key1": "value1", "key2": {"subkey1": "subvalue1"}}
console.dictionary(sample_dict)
```
output:
```
🏰 key1
    🛖 value1
    🛖 subkey1
        🌲 subvalue 1
```
> The emojis use following hierarchy: 🏰 🛖 🌲 🐦 🐛 🧬

#### Depth

The depth parameter of all logging functions determines how nested the message is by inserting a corresponding amount of tabs.

```python
console.print("Message!", depth=0)
console.print("Nested message!", depth=1)
console.error("Nested error message!", depth=1)
```

output:

```
🕸️ Message!
    🕸️ Nested message!
    ❌ Nested error message!
```

#### Saving Logs

```python
console.save("logfile.bojan")
```

## License

This project is licensed under the MIT License.

## Contributing

Contributions are welcome! Please open an issue or submit a pull request.
indus-cloudauth 0.1.1
indus-cloudauth is a secure, unified solution for generating and validating authentication tokens across multiple cloud platforms.
License: MIT
Requires Python: >=3.9

# indus-cloudauth
``indus-cloudauth`` is a secure, unified solution for generating and validating authentication tokens across multiple cloud platforms.

## Features

* Standardizes authentication with a consistent interface for token management and authentication.
* Simplifies secret key retrieval from AWS Secrets Manager. Azure Key Vault, GCP Secret Manager and more coming soon.
* Enhances security by eliminating manual credential handling.
* Provided option to encrypt more information using `auth_id` and set token expiry using `expiry_seconds`.
* Reduces boilerplate code with easy-to-use methods for token generation and validation.

## Requirements

Python 3.9+

## Usage

You can use the `indus-cloudauth` package in your Python code to generate authentication token using cloud provider of your choice for accessing the secret.

### Example 1 - using secret key stored in aws secret manager

It uses your local aws credentials and configs from `~/.aws` see [Using Boto3](https://github.com/boto/boto3). Only key stored as plaintext will work.

```python
from indus_cloudauth import cloud_provider, auth

keyname = "keyname_in_your_aws_secret_manager"
_auth = auth.use_hmac256_token(keyname=keyname, cloud=cloud_provider.AWS) # initializes the auth module
token = _auth.generate_token() # generates your token
valid, auth_id, message = _auth.validate_token(token) # validates your token

```

### Example 2 - using secret key stored in environment variable

```python
from indus_cloudauth import cloud_provider, auth

keyname = "keyname_in_your_enviroment"
_auth = auth.use_hmac256_token(keyname=keyname, cloud=cloud_provider.LOCAL) # initializes the auth module
token = _auth.generate_token() # generates your token
valid, auth_id, message = _auth.validate_token(token) # validates your token

```

### Example 3 - using secret key directly

```python
from indus_cloudauth import cloud_provider, auth

secret_key = "anysecretkeyyoucanpass"
_auth = auth.use_hmac256_token(secretkey=secretkey) # initializes the auth module
token = _auth.generate_token() # generates your token
valid, auth_id, message = _auth.validate_token(token) # validates your token

```


### Example 4 - using token expiry_time and auth_id

By default the token expiry time set to 1 hour. You can encrypt any useful information using auth_id.

```python
from indus_cloudauth import cloud_provider, auth

keyname = "keyname_in_your_enviroment"
auth_id = "userid_etc"
expiry = 60 # 1 minute
_auth = auth.use_hmac256_token(keyname=keyname, cloud=cloud_provider.LOCAL) # initializes the auth module
token = _auth.generate_token(auth_id=authid, expiry_seconds=expiry) # generates your token
valid, auth_id, message = _auth.validate_token(token) # validates your token

```