semvec/pypi-packages huggingface dataset:
oci-bucket 1.0.3
Package for easy Oci Buckets management in python.
Requires Python: >=3.11

# OCI Bucket Framework 

For easier OCI blob manipulation, read, download, etc.

## Import
```python
from oci_bucket import OciBucket
```

## Load from Instance Principal
```python
storage_client = OciBucket.client().from_instance_principal()
oci_bucket = OciBucket(storage_client, bucket_name)
```

## Load from OCI Config File 
```python
storage_client = OciBucket.client().from_file() # Defaults to ~/.oci/config
oci_bucket = OciBucket(storage_client, bucket_name)
```

## Methods 
Note that `limit` is set to 1000 by default, this limitation comes from original `oci.object_storage.ObjectStorageClient.object_list`.
This lib can go further and handle the pagination for you, just use `limit` beyond 1000.

```python
files = oci_bucket.list_folder('multiples', limit=12) # retrives files from directory
files = oci_bucket.glob('multiples/1{1,2}0{3,4}.txt', limit=30) # Linux ls pattern can be used for blob filtering.
files = oci_bucket.glob('*audio*wav', limit=30) # Using wildcard '*'
file = oci_bucket.get_file('multiples/0005.txt') # Or just retrieve a specifi file directly
```

### Handling Files in Bucket
```python
oci_bucket.upload_file('acdc.csv', 'csvs') # Upload local file to bucket
oci_bucket.get_file('csvs/acdc.csv').download('local_dir') # Download buckt file to local
oci_bucket.get_file('csvs/acdc.csv').copy('new_csvs') # Copies a file in a bucket to another
oci_bucket.get_file('csvs/acdc.csv').move('new_csvs') # Moves a file in a bucket to another
oci_bucket.get_file('csvs/acdc.csv').delete() # Deletes a file in bucket
```

## Blob Usage
As you can retrieve both a list of files or just a specific one, the blob files have methods on their own.

### Load Pandas dataframe Direct From CSV file bytes.
```python
import pandas as pd
from io import BytesIO
file_bytes = oci_bucket.get_file('csvs/acdc.csv').get_bytes()
df = pd.read_csv(BytesIO(file_bytes))
```
co6co.sanic-ext 0.0.13
web 扩展

# 扩展 sanic

# (sanic Demo)[https://www.osgeo.cn/sanic/sanic/examples.html/]

(task)[https://python.hotexamples.com/zh/examples/sanic/Sanic/add_task/python-sanic-add_task-method-examples.html]

# 历史记录

```
0.0.1 初始版本
0.0.2.
0.0.3 优化 baseView 2024-07-26
0.0.4
    baseView: save_file
0.0.5
    优化 result 模块
0.0.6
    增加 sanics.App 类 及 ViewManage
0.0.7
    BaseView : Content-Disposition，zip，head
    get_file_partial 方法
0.0.8 2025-01-08
    修复json中文bug
0.0.9 2025-03-05
    依赖  co6co.web-session
0.0.10 2025-03-24-3-28
    1. 新增　choose
    2.　优化： startApp 方法
    3. 增加主进程与子进程通信
0.0.11 2025-04-07
    1. response_head
0.0.12 2025-04-17
    1. 新增： getconfig for win package
0.0.13 2025-05-28
    1. bug
```

webSocket 测试地址
http://www.blue-zero.com/WebSocket/
http://coolaf.com/tool/chattest

这两个遇到个问题，sanic 一执行 websocket 地址 python 就报异常框（需 c++调试）的框
后经过一个个模块删除后发现是：
在文件夹中有 multidict-6.0.2 模块，`pip list` 显示确是 6.0.4，直接移除 multidict 发现正常

# 类属性与对象属性

```
class A:
    def __init__(self) -> None:
       self.a="12"
       pass

class B(A):
    b:str="abc"
    @classmethod
    def geA(cls) -> str:
        print(cls.a)
        return cls.a

a=A()
print(a.a)

b=B()
b.a="456"
print(b.a,B.a,"b.geA:", b.geA(),"B.geA:",B.geA())

a=A()
print(a.a,A.a)
```