semvec/pypi-packages huggingface dataset:
data2cloud 0.0.5
upload data from oss to maxcompute and import to matrix lib table
Requires Python: >=3.7

# upload oss data to maxcompute

## initialize maxcompute account

- Install Aliyun CLI: [Install guide](https://help.aliyun.com/zh/cli/installation-guide)
- run the aliyun configure command to setup account

``` configure
$ aliyun configure
Configuring profile 'default' ...
Aliyun Access Key ID [None]: <Your AccessKey ID>
Aliyun Access Key Secret [None]: <Your AccessKey Secret>
Default Region Id [None]: cn-zhangjiakou
Default output format [json]: json
Default Language [zh]: zh
```

## define data source

define data source:

```json
{
    "$schema": "./json_schemas/data-config-schema.json",
    "vender": "csmar",
    "meta_table": "metadata_csmar",
    "data_type": {
        "type": "oss",
        "location": "oss://oss-cn-zhangjiakou-internal.aliyuncs.com/dteam2022-data/source_data/csmar"
    },
    "data_versions": [
        {
            "source": "cg_ybasic",
            "versions": [
                "20240506"
            ]
        }
    ],
    "data": [
       {
            "source": "cg_ybasic",
            "target_table": "ods_csmar_cg_ybasic",
            "source_name": "治理综合信息文件",
            "meta": [
                {
                    "col_order": 1,
                    "col_name": "Stkcd",
                    "col_type": "Nvarchar",
                    "col_name_desc": "证券代码",
                },
                {
                    "col_order": 2,
                    "col_name": "Reptdt",
                    "col_type": "Datetime",
                    "col_name_desc": "统计截止日期",

                },
                {
                    "col_order": 4,
                    "col_name": "Y0301b",
                    "col_type": "decimal",
                    "col_name_desc": "股本结构是否变化",
                    "col_desc": "1=未变化，2=有变化。"
                },
                {
                    "col_order": 16,
                    "col_name": "ManagerHoldsharesRatio",
                    "col_type": "decimal",
                    "col_name_desc": "总经理持股比例",
                    "col_unit": "%"
                },
                ...
            ]
        }, 
    ],
    "matrix": [{
            "source": "cg_ybasic",
            "target_code_prefix": "cg_ybasic",
            "source_col_prefix": "Y",
            "eff_date_col": "Reptdt",
            "firm_col": "stkcd"
        }
    ]
}
```

## upload data and import matrix

```python
from pathlib import Path
from data2cloud.data_uploader import DataUploader, MatrixImporter, DataConfigParser

config_file = f"{Path(__file__).resolve().parent}/datasource/csmar.json"
uploader = DataUploader(config_file)
uploader.upload("cg_ybasic") # uploader.upload_all()
# import matrix
m_importer = MatrixImporter(config_file)
m_importer.import_matrix("cg_ybasic")
```
pyserver-Mag1cByt3s 0.0.1
PyServer is a simple, multithreaded Python HTTP GET & POST server that logs requests and provides a fancy, modern, and dark-themed directory listing
Requires Python: >=3.8

# PyServer

PyServer is a simple, multithreaded Python HTTP GET & POST server that logs requests and provides a fancy, modern, and dark-themed directory listing. This server is perfect for quickly sharing files and directories over a network with minimal setup.

<br>

## Features

- HTTP GET and POST requests
- Serves files and directories with a modern dark-themed listing.
- Multithreaded for improved performance.
- Logs HTTP requests with colored output for better readability.
- Easy to set up and run.

<br>

## Requirements

- Python 3.x
- `colorlog` library for colored logging output.

<br>

## Installation

1. Clone the repository or download the `pyserver.py` file.
2. Install the required `colorlog` library if you haven't already:

```bash
pip install colorlog
```

or install the requirement from requirements.txt:

```bash
pip install -r requirements.txt
```

<br>

## Usage

Run the server with the following command:
```bash
python3 ./pyserver.py [port]
```
If no port is specified, the server will default to port 8080.

Example:
```bash
python3 ./pyserver.py 8000
```

<br>

## Screenshots

directory listing:
<br>
<img src="screenshots/directory_listing.png" width="600" height="300">

request logging:
![](screenshots/request_logging.png)

<br>

## License

This project is licensed under the MIT License - see the LICENSE file for details.
Contributing

Contributions are welcome! Please feel free to submit a Pull Request.
Acknowledgments

Inspired by the need for a simple, yet modern and stylish, Python HTTP server for quick file sharing and directory listing.

<br>

## Credits

This project was inspired by the work of Miel Donkers
See: <a href="https://gist.github.com/mdonkers/63e115cc0c79b4f6b8b3a6b797e485c7">https://gist.github.com/mdonkers/63e115cc0c79b4f6b8b3a6b797e485c7</a>
FAImageGen 0.1.0
Python SDK for ImageGen
Requires Python: >=3.6

# InstantLight-sdk

## Installation

Install the SDK using pip:

```bash
pip install FAImageGen
```

## Usage

Hereâ€™s an example of how to use the InstantLight SDK to make an API call and handle the response:

```bash
# InstantLight-sdk

## Installation

Install the SDK using pip:

```bash
pip install FAImageGen
```

## Usage

Hereâ€™s an example of how to use the InstantLight SDK to make an API call and handle the response:

```bash
from ImageGen import ImageGen
from PIL import Image
import base64
from io import BytesIO

# Initialize the SDK
sdk = ImageGen(
    base_url='https://api.fotographer.ai/Image-gen',
    api_key='your_api_key',
    email='your_email@example.com'
)

# Convert images to base64
def image_to_base64(image_path):
    with Image.open(image_path) as img:
        buffered = BytesIO()
        img.save(buffered, format="PNG")
        return base64.b64encode(buffered.getvalue()).decode('utf-8')

# Prepare the image data
image_path = 'path_to_image.png'
prompt = 'your_prompt_here'

# Make the API call
response = sdk.image_generation.get_image_gen(image_path, prompt)

# Print the response keys for debugging
print("Response Keys:", response.keys())

# Print the keys at all levels of the response for debugging
for key, value in response.items():
    if isinstance(value, dict):
        print(f"Response[{key}] Keys: {value.keys()}")

# Save the image and mask image if they exist in the response
if 'image' in response:
    image_data = response['image']
    image_bytes = base64.b64decode(image_data)
    image = Image.open(BytesIO(image_bytes))
    image.save("output_image.png")
    print("Image retrieved and saved as output_image.png.")
else:
    print("Response does not contain 'image'")

```

Make sure to update `your_api_key` and `your_email@example.com` with the actual values in the example usage section.