semvec/pypi-packages huggingface dataset:
asset-tracking-pepsico 1.0.3
An asset tracking package where the device logs can be read and the location information can be extracted from the log file provided in the parameters.
Requires Python: >=3.7
Keywords: asset,tracking,pepsico,location,latitude,longitude,store,events

# audit_logging_pepsico

Under Construction.
A DTO for transforming the data coming from different sources into a single object or schema.
This will be used to write the data to postgres. 

Developed by Jatin Talati

## Examples of How To Use

```python
from asset_tracking_pepsico.asset_tracking_ingest import AssetTrackingIngest
from asset_tracking_pepsico import utilities

blob_conn_str = "<BLOB_CONNECTION_STRING>"
container_name = "<NAME_OF_THE_CONTAINER>"
blob_name = "<NAME_OF_THE_BLOB>"

ast = AssetTrackingIngest()
data = utilities.read_data_from_blob(blob_conn_str, container_name, blob_name)
# Other Code
```

For accessing the schema and parameters use the following code

```python
from asset_tracking_pepsico.dto.PostgresSchema import PostgresSchemaDto

schema = PostgresSchemaDto()
print(schema.__str__())
```

This will print out the values for all the parameters in the class.
For dict you can use
```python
print(schema.__dict__())
```
Explore the package to use other functions and parameters.
fastapi-dynamic-routers 0.1.1
A dynamic routes includer for FastAPI

fastapi_dynamic_routers is a Python library that simplifies the management of routes in FastAPI applications. It provides a clean and efficient way to register routes dynamically, enabling you to keep your codebase organized and maintainable, even as your application grows.

Key Features:
- Simplicity: The library comes with a straightforward implementation that seamlessly integrates with your FastAPI application.
- Ease of Use: With just a few lines of code, you can include or exclude routes from your application, providing the flexibility you need during development.
- Organized Codebase: By dynamically registering routes, you can maintain a clean and well-structured codebase, even in large-scale projects.

Usage Example:

```python
# main.py
from fastapi import FastAPI
from fastapi_dynamic_routers import Routers

app = FastAPI()

# List of router modules to include dynamically
URLS = [
    'path.to.APIRouter.instantiate',
    '...'
]

# Initialize the dynamic routers
routers = Routers(app, URLS)()
```

In this example, simply modify the `URLS` list to add or remove routes from your FastAPI application. The dynamic routes includer will handle the registration, keeping your main file clean and focused.
loghelper 1.0.9
日志助手，支持多进程，支持json格式，支持flask
Requires Python: >=3.8,<4.0

# 日志助手

## 特性
1. 几乎无需配置，就可生成日志文件
2. 可选，输出到文件的同时打印到屏幕
3. 可选（安装python-json-logger即可），生成纯文本日志的同时生成一份json格式的日志，方便采集
4. 可选（安装flask即可），捕获flask的remote_addr和url信息
5. 可选（安装concurrent-log），支持多进程并发记录日志

## 创建logger
```python
# 简易用法
from loghelper import LogHelper

log_helper = LogHelper(log_dir='my_project', log_path='/tmp/')

logger = log_helper.create_logger()

logger.info('Hello World')
```

```python
# 完整用法
import logging
from loghelper import LogHelper, ConcurrentTimedRotatingFileHandler

log_helper = LogHelper(
    log_dir='my_project', log_path = '/var/log/',
    backup_count=7, when='midnight',
    timed_rotating_file_handler=ConcurrentTimedRotatingFileHandler
)

logger = log_helper.create_logger(
    name='my_module',
    filename='my_module',
    add_stream_handler = True,
    json_ensure_ascii = False,
    reserved_attrs = [
        'msg',
        'args',
        'levelno',
        'relativeCreated',
    ],
    level=logging.INFO
)

logger.info('Hello World')
```

### 生成日志样例
> 纯文本格式  /tmp/my_project/raw_loghelper.loghelper.Runtime.log
```text
<2021-12-15 14:40:38,844> INFO (<stdin> <module> 1) {13064 4474015232 MainThread} [- 127.0.0.1] Hello World
```
> json格式 /tmp/my_project/json_loghelper.loghelper.Runtime.log
```json
{"message": "Hello World", "name": "loghelper.loghelper", "levelname": "INFO", "pathname": "<stdin>", "filename": "<stdin>", "module": "<stdin>", "exc_info": null, "exc_text": null, "stack_info": null, "lineno": 1, "funcName": "<module>", "created": 1639550438.844173, "msecs": 844.1729545593262, "thread": 4474015232, "threadName": "MainThread", "processName": "MainProcess", "process": 13064, "url": "-", "remote_addr": "127.0.0.1", "asctime": "2021-12-15 14:40:38,844", "timestamp": "2021-12-15T06:40:38.844173+00:00"}
```

## 仅日志记录敏感信息（如堆栈，异常）
```python
from loghelper import SensitiveLogger


logger = SensitiveLogger(logger)
msg = logger.error(msg='发生错误', sensitive_msg=f'{ex}')
```

### 生成msg样例
```text
发生错误 (详见日志:['/tmp/my_project/raw_loghelper.loghelper.Runtime.log', '/tmp/my_project/json_loghelper.loghelper.Runtime.log'])
```

### 生成日志样例
```text
发生错误 (错误详情:ex的具体内容)
```
kistipy 0.0.6
kistipy
Requires Python: >=3.9.12

# kistipy

![basic-test](https://github.com/prosopher/kistipy/workflows/basic-test/badge.svg)

# Installation

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

# Examples

* [Squad](https://huggingface.co/datasets/squad)

    - Data 생성
    ```python
    from kistipy import Data
    data = Data(name='squad', split='train')
    ```

    - 데이터 변환
    ```python
    print(data[0]['title']) # University_of_Notre_Dame
    data.map(lambda x: {'uppercased_title': x['title'].upper()})
    print(data[0]['uppercased_title']) # UNIVERSITY_OF_NOTRE_DAME
    ```

* [CoNLL-2003](https://huggingface.co/datasets/tomaarsen/conll2003)

    - Data 생성
    ```python
    from kistipy import Data
    data = Data(name='tomaarsen/conll2003', split='train')
    ```

    - 데이터 변환
    ```python
    print(data[0]['tokens']) # ['EU', 'rejects', 'German', 'call', 'to', 'boycott', 'British', 'lamb', '.']
    print(data[0]['ner_tags']) # [3, 0, 7, 0, 0, 0, 7, 0, 0]
    def pos_tagger(x):
        token_with_ner_tag = []
        for token, ner_tag in zip(x['tokens'], x['ner_tags']):
            if ner_tag == 0:
                token_with_ner_tag.append(token)
            else:
                token_with_ner_tag.append(f'[{token}]({ner_tag})')
        return {'token_with_ner_tags': token_with_ner_tag}
    data.map(pos_tagger)
    print(data[0]['token_with_ner_tags']) # ['[EU](3)', 'rejects', '[German](7)', 'call', 'to', 'boycott', '[British](7)', 'lamb', '.']
    ```

* [국내 논문 문장 의미 태깅 데이터셋](https://aida.kisti.re.kr/data/b08af26b-7294-4358-bfd0-f86d0f2e1f1b)

    - 데이터 전처리
    ```console
    data_path="data/국내 논문 문장 의미 태깅 데이터셋/가정간호학회지/2013/JAKO201307153506710.json"
    python3 kistipy/bin/cleanse.py --data_name 국내논문태깅 --input_path $data_path --output_path $data_path
    ```

    - Data 생성
    ```python
    from kistipy import Data
    data = Data(name='국내논문태깅', split='train')
    ```

* [국내 논문 QA 데이터셋](https://aida.kisti.re.kr/data/21b21974-6efd-4581-b9df-699f91f5bc98)

    - Data 생성
    ```python
    from kistipy import Data
    data = Data(name='국내논문QA', split='train')
    ```

* [문서요약 텍스트](https://aihub.or.kr/aihubdata/data/view.do?currMenu=115&topMenu=100&aihubDataSe=realm&dataSetSn=97)

    - Data 생성
    ```python
    from kistipy import Data
    data = Data(name='문서요약텍스트', split='train')
    ```

* [논문 연구분야 분류 데이터](https://aida.kisti.re.kr/data/abb84673-04d2-45c5-83b5-0067bd4c37f2)

    - Data 생성
    ```python
    from kistipy import Data
    data = Data(name='연구분야분류', split='train')
    ```

* [특허 분야 자동분류 데이터](https://www.aihub.or.kr/aihubdata/data/view.do?currMenu=115&topMenu=100&aihubDataSe=realm&dataSetSn=547)

    - Data 생성
    ```python
    from kistipy import Data
    data = Data(name='특허자동분류', split='train')
    ```