semvec/pypi-packages huggingface dataset:
easycpp 1.0.1
Using embedded C++ code in .py
License: MIT
Requires Python: >=3.7

## Description

To use C/C++ conveniently in Python

## Functional Features

- **Support for embedding C++ functions in .py files**: It is convenient to use embedded C++ functions instead of Python functions to accelerate code execution.
- **Calling dynamic libraries**: Similar to ctypes.CDLL

## Dependencies

- Python >= 3.7
- pip

## Installation

```bash
$ pip install easycpp
```

## Usage Examples

Use the easycpp module to insert C++ code in a .py file. test.py:

```python
import sys, os
from easycpp import easycpp


cpp = easycpp('''
#include <vector>
using namespace std;

extern "C" int sieve(int n);

int sieve(int n) {
    vector<bool> prime(n + 1, true);
    prime[0] = prime[1] = false;

    for (int i = 2; i * i <= n; ++i) {
        if (prime[i]) {
            for (int j = i * i; j <= n; j += i) {
                prime[j] = false;
            }
        }
    }

    int rn = 0;
    int rmax = 0;
    for (int i = 2; i <= n; ++i) {
        if (prime[i]) rn++,rmax=i;
    }
    return rn;
}


''')


n = 10**6
rn = cpp.sieve(n)
print(f'count:{rn}')
```

2. Run like normal Python code:

```bash
$ python3 test.py
```

## Performance
Achieving a 20x speedup in prime number calculation.

output for test/testeasycpp.py:

```
python:sieve(1000000)
count:78498
cpp: sieve(1000000)
count:78498
python:sieve(1000000)
1. : 41969.04803393409  microseconds
2. : 40655.971970409155  microseconds
3. : 40405.491017736495  microseconds
4. : 40510.52400609478  microseconds
5. : 40443.39497340843  microseconds
cpp: sieve(1000000)
1. : 1861.8699978105724  microseconds
2. : 1843.6360405758023  microseconds
3. : 1847.2519586794078  microseconds
4. : 1861.9759939610958  microseconds
5. : 1847.1599905751646  microseconds
```

## Attention

Must specify parameter `func_signatures` on Windows.
secretauth 1.0.0
secretauth is a secure, unified solution for generating and validating tokens using secret from multiple cloud platforms.
License: MIT
Requires Python: >=3.9

# secretauth
``secretauth`` is a secure, unified solution for generating and validating authentication tokens using secret from 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+

## Installallation

```console
$ pip install secretauth
```

## Usage

You can use the `secretauth` 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 secretauth import SecretProvider, Auth

secret_name = "secret_name_in_your_aws_secret_manager"
_auth = Auth.use_hmac256_token(secret_name=secret_name, secret_provider=SecretProvider.AWS) # initializes the auth module
token = _auth.generate_token() # generates your token
valid, auth_id, msg = _auth.validate_token(token) # validates your token

```

### Example 2 - using secret key stored in environment variable

```python
from secretauth import SecretProvider, Auth

secret_name = "secret_name_in_your_enviroment"
_auth = Auth.use_hmac256_token(secret_name=secret_name, secret_provider=SecretProvider.LOCAL) # initializes the auth module
token = _auth.generate_token() # generates your token
valid, auth_id, msg = _auth.validate_token(token) # validates your token

```

### Example 3 - using secret key directly

```python
from secretauth import SecretProvider, Auth

secret_key = "any_secret_key_can_be_used"
_auth = Auth.use_hmac256_token(secret_key=secret_key) # initializes the auth module
token = _auth.generate_token() # generates your token
valid, auth_id, msg = _auth.validate_token(token) # validates your token

```


### Example 4 - using token expiry_seconds and auth_id

By default the token expiry time set to 1 hour. You can encrypt any useful information using auth_id.

```python
from secretauth import SecretProvider, Auth

secret_name = "secret_name_in_your_enviroment"
authid = "userid_etc"
expiry = 60 # 1 minute
_auth = Auth.use_hmac256_token(secret_name=secret_name, secret_provider=SecretProvider.LOCAL) # initializes the auth module
token = _auth.generate_token(auth_id=authid, expiry_seconds=expiry) # generates your token
valid, auth_id, msg = _auth.validate_token(token) # validates your token

```