semvec/pypi-packages huggingface dataset:
restorify 1.0.4
Type-safe and eazy json-to-object-and-back conversions.
Requires Python: >=3.9

# Restorify
Convert json objects and files into python objects of type that you need.

## Quick guide

### Simple conversions
The code below will convert json list into `list`, `tuple` and `set` respectively.
```python
from restorify import restore

j1 = """
[
	1, 2, 3, 1
]
"""
print( restore(j1, list[float]) )
print( restore(j1, tuple[float]) )
print( restore(j1, set[float]) )
```
Output:
```
[1.0, 2.0, 3.0, 1.0]
(1.0, 2.0, 3.0, 1.0)
{1.0, 2.0, 3.0}
```
### Collections conversions
You can easily convert collections outside of simple built-ins. Note how nested `tuple` and `set` are accounted for.
```python

from restorify import restore
from collections import OrderedDict

j2 = """
{
	"key1" : [1, 2, 3]
}
"""
print( restore(j2, OrderedDict[str, tuple]) )
print( restore(j2, OrderedDict[str, set]) )
```
 Output:
 ```
OrderedDict({'key1': (1, 2, 3)})
OrderedDict({'key1': {1, 2, 3}})
```
 ### Dataclasses
`Dataclass`es (and everything type-annotated really) can be converted too.
```python
from restorify import restore
from dataclasses import dataclass

@dataclass
class TestClass1:
	id: str
	data: list[int]

j3 = """
{
	"id" : "MyId",
	"data": [ 1, 42, 69 ]
}
"""

@dataclass
class TestClassNested:
	test1_list: list[TestClass1]

j4 = """
{
	"test1_list": [
		{
			"id" : "MyId1",
			"data": [ 1, 42, 69 ]
		},
		{
			"id" : "MyId2",
			"data": [ 321, 421, 3011 ]
		}
	]
}
"""
print( restore(j4, TestClassNested) )
print( restore(j3, TestClass1) )
```
Output:
```
TestClass1(id='MyId', data=[1, 42, 69])
TestClassNested(test1_list=[TestClass1(id='MyId1', data=[1, 42, 69]), TestClass1(id='MyId2', data=[321, 421, 3011])])
```
### Implicit file path conversions 
Why loading jsons manually if you can just get and object from a file path? Note the use of `@restorable` decorator and `RestorableClass.json_name` class member. In the end, the new file is `dump`ed into new directory (but with the same name).
```python
from restorify import restore
from dataclasses import dataclass
from pathlib import Path

@dataclass
@restorable
class RestorableClass:
	field: int
	another_filed: list[list]

p1 = Path(RestorableClass.json_name)
obj = restore(p1)
print(obj)

p2 = Path('another_dir')
p2.mkdir()
obj.dump(p2)
```
Output:
```
RestorableClass(field=5, another_filed=[[1, 1.0, 'str'], [[4, 5, 6], 'hello!']])
```
The `restorable_class.json` file contents is the following:
```json
{
    "field": 5,
    "another_filed": [
        [
            1,
            1.0,
            "str"
        ],
        [
            [
                4,
                5,
                6
            ],
            "hello!"
        ]
    ]
}
```

## Failed conversion
Upon failed conversion `TypeError` is raised.
hc671123-secure-secrets 2.3.1
Module which enables storing encrypted, password protected secrets in a single file. Also allows for easy encryption and decryption of data
Requires Python: >=3.13
Keywords: secrets, secure, encryption

# secure_module Python
Security module which stores important and confidental information. Information is stored encrypted and password protected. The module also provides the WebEncr and WebDecr functions which encrypts and decrypts any object with AES-GCM 256-bit encryption. Have a look at SECURITY.md on GitHub and read the information below for security informations.

# PyPI published
This module is published on PyPI https://pypi.org/project/hc671123-secure-secrets/. You can install it with following pip command: pip install hc671123-secure-secrets .

# How to use the module
Have a look at the example.py file on GitHub. Try to always update to the latest version. New Versions will be named with semantic versioning https://semver.org/.
You need to have pycryptodomex installed (if you install the module with pip, this is automatically done).<br>
<b>Keep aware always adding secrets without making a commit with the secret in plaintext!</b>

## General information about AES-GCM
AES-GCM provides data integrity and confidentiality (it belongs to the class of authenticated encryption with associated data - AEAD algorithms).
For further information about GCM I recommend you to have a look at <i>http://csrc.nist.gov/publications/nistpubs/800-38D/SP-800-38D.pdf</i>. You can also have a look at <i>https://en.wikipedia.org/wiki/Galois/Counter_Mode</i>.

## Security
- For any given key, GCM is <b>limited to encrypting 2^39 - 256 bits of plain data (64GiB)</b>!
- It's security depends on a <b>unique nonce for every encryption performed with the same key</b>. Have a look at <i>http://csrc.nist.gov/publications/nistpubs/800-38D/SP-800-38D.pdf</i>.
- The authentication strength depends on the length of it's tag. The longer the tag (128 bit / 16 byte maximum) the better. 
- For information about Key Establishment have a look at section 8.1 in <i>http://csrc.nist.gov/publications/nistpubs/800-38D/SP-800-38D.pdf</i>.

## Information about my implementation

### nonce
I use a pseudo random nonce with 64 bytes length. If high security is needed or something like file encryption is wanted, I would recommend using a deterministic nonce, like described in section 8.2.1 in <i>http://csrc.nist.gov/publications/nistpubs/800-38D/SP-800-38D.pdf</i>. As the pycryptodomex implementation supports 16 byte nonces, I would use a 16 byte nonce. If you change the length of the nonce, the decrypt function must be adapted to the new length.
### authentication tag
I use the longest possible tag length, which ensures the highest possible authentication strength. Smaller tag lengths are highly discouraged.
### Key Generation
Generates a random key. For information about Key Establishment have a look at section 8.1 in <i>http://csrc.nist.gov/publications/nistpubs/800-38D/SP-800-38D.pdf</i>.
flagboxsdk 0.0.1
FlagBox SDK for Python
Requires Python: >=3.7
Keywords: FlagBox, SDK

# FlagBox Python SDK

A lightweight Python SDK for managing feature flags with FlagBox. This SDK provides both synchronous and asynchronous methods for evaluating feature flags, with support for global and per-flag contexts.

## Installation

```bash
pip install flagboxsdk
```

## Quick Start

```python
from flagboxsdk import Client

# Initialize the client
client = FlagBoxClient(
    api_url="https://api.flagbox.io",
    api_key="your-api-key"
)

# Get a feature flag value
is_new_feature_enabled = client.get_flag("new-feature", False)

if is_new_feature_enabled:
    # Feature is enabled
    pass
else:
    # Feature is disabled
    pass
```

## Using Context

The SDK supports both global context (set during client initialization) and per-flag context:

```python
# Initialize client with global context
client = FlagBoxClient(
    api_url="https://api.flagbox.io",
    api_key="your-api-key",
    global_context={
        "userId": "user123",
        "plan": "premium"
    }
)

# Get flag with additional per-flag context
result = client.get_flag(
    flag_key="new-feature",
    default_value=False,
    context={
        "country": "Spain"
    }
)
```

## Async Support

For asynchronous applications, use the async version of the client:

```python
import asyncio
from flagbox import FlagBoxClient

async def main():
    client = FlagBoxClient(
        api_url="https://api.flagbox.io",
        api_key="your-api-key"
    )

    # Get a feature flag value asynchronously
    is_new_feature_enabled = await client.get_flag_async(
        "new-feature",
        False
    )

asyncio.run(main())
```

## Error Handling

The SDK handles errors gracefully by returning the default value in case of:

- Network errors
- Invalid API responses
- Unsupported flag types
- Missing flags
- Rate limit exceeded

## Requirements

- Python 3.7 or higher
- requests>=2.25.0
- aiohttp>=3.8.0

## License

MIT