semvec/pypi-packages huggingface dataset:
finatic-client-python 0.1.0
Python SDK for Finatic Backend
License: MIT
Requires Python: <3.13,>=3.8

# Finatic Python SDK

This is the official Python SDK for the Finatic Backend API.

## Installation

```bash
pip install finatic-client-python
```

## Usage

```python
from finatic_python import Finatic

# Initialize the client
finatic = Finatic.init("your-api-key", "your-api-secret")

# Get your holdings
holdings = await finatic.get_holdings()

# Place an order
order = {
    "symbol": "AAPL",
    "quantity": 1,
    "side": "buy",
    "type_": "market",
    "time_in_force": "day"
}
await finatic.place_order(order)
```

## Development

To set up the development environment:

```bash
# Install development dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Format code
black .
isort .
```

## Requirements

- Python 3.8 or higher
- Rust toolchain (for development)
long-utils 0.7.2
A utility library for everyday use.
License: MIT
Requires Python: >=3.7


安装:
```bash
pip install long-utils
```

## 图像

### 图中找图
```python
from long_utils.image.search import ImgFindImg

img = ImgFindImg(img_source='static/big.png', img_search='static/small.png')
img.find_coord(is_debug=True)

# 或者只拿取小图在原图中的坐标rectangle, 小图在原图中的大小result，confidence表示准确率
res = img.find_coord()
# [{'result': (539.0, 21.5), 'rectangle': ((524, 10), (524, 33), (554, 10), (554, 33)), 'confidence': 1.0}]
print(res)
```

## 其他

### 日志输出

```python
from long_utils import Log

logger = Log(show_line=True, show_file_name=True, show_time=True)

logger.error(message="xxxx")
logger.success(message="xxxx")
logger.warning(message="xxxx")
logger.info(message="xxxx")
logger.debug(message="xxxx")

logger.success_bg('xxxx')
logger.error_bg('xxxx')
logger.warning_bg('xxxx')
logger.debug_bg('xxxx')
logger.info_bg('xxxx')
logger.color('xxxx', fg='blue', bg='black')
```

## 对象存储OSS

### 配置

```python
from long_utils.storage.config import SSconfig
from long_utils.storage.aliyun.oss import AliyumOss

access_key = 'xxx'
access_key_secret = 'xxx'
endpoint = 'https://oss-cn-shanghai.aliyuncs.com'
bucket_name = 'xxx'
ss_config = SSconfig(
    access_key_id=access_key,
    access_key_secret=access_key_secret,
    bucket_url=endpoint,
    bucket_name=bucket_name
)
aliyun_client = AliyumOss(
    config=ss_config
)
```

### 分片下载文件到本地

```python
aliyun_client.multipart_upload_file(key='xxx.pth', local_file='xxx.pth')
```

如果需要知道下载进度,可以:

```python
def progress_callback(block_size, total_size):
    print(f"正在下载: {block_size / total_size * 100:.2f}%")

aliyun_client.multipart_upload_file(key='xxx.pth', local_file='xxx.pth', progress_callback=progress_callback)
```

### 分片上传本地文件

```python
aliyun_client.multipart_upload_file(key='xxx.pth', file='xxxx.pth')
```

如果需要知道上传进度,可以:

```python
def progress_callback(block_size, total_size):
    print(f"正在上传: {block_size / total_size * 100:.2f}%")

aliyun_client.multipart_upload_file(key='xxx.pth', file='xxx.pth', progress_callback=progress_callback)
```