semvec/pypi-packages huggingface dataset:
kraft-cli 0.2.1
Python service scaffolding with zero learning curve
License: MIT
Requires Python: >=3.10

# kraft

Python service scaffolding with zero learning curve.

## Installation

### Using uvx (recommended - no installation needed)
```bash
uvx kraft
```

### Using uv tool (persistent installation)
```bash
uv tool install kraft-cli
kraft create my-api
```

### Using pipx (if you have it)
```bash
pipx install kraft-cli
kraft create my-api
```

### Using pip (traditional installation)

If you get "externally managed environment" error, try:

```bash
# Option 1: Install to user directory
pip3 install --user kraft-cli
kraft create my-api

# Option 2: Use pipx (install it first if needed)
pip3 install --user pipx
pipx install kraft-cli
kraft create my-api

# Option 3: Use a virtual environment
python3 -m venv ~/kraft-env
source ~/kraft-env/bin/activate
pip3 install kraft-cli
kraft create my-api
```

**Note:** If you get "externally managed environment" error with pip, use `uvx` or `uv tool install` instead.

## Usage

### Create a REST service

```bash
# Using uvx (no install needed)
uvx kraft-cli create my-api

# Or if you installed with uv tool/pipx
kraft create my-api
```

Then run it:
```bash
cd my-api
docker-compose up --build
```

Your API is now running at http://localhost:8000/books

### Add PostgreSQL database

```bash
kraft add postgres
# or: uvx kraft-cli add postgres
```

### Create with add-ons in one command

```bash
kraft create my-api --with postgres
```

### List available templates and add-ons

```bash
kraft list      # Show templates
kraft addons    # Show add-ons
```

## Shell Completion (Optional)

```bash
kraft --install-completion zsh
```

Restart your shell to enable Tab completion for commands and options.

## Development

### Setup

**Using uv (recommended):**
```bash
uv sync --extra dev
```

**Using pip:**
```bash
pip install -e ".[dev]"
```

### Running Tests

```bash
# With uv
uv run pytest

# With pip (after activating venv)
pytest
```

### Linting

```bash
# With uv
uv run ruff check src/

# With pip (after activating venv)
ruff check src/
```

### Type Checking

```bash
# With uv
uv run mypy src/

# With pip (after activating venv)
mypy src/
```

## License

MIT
python-cnb 0.9.0
CNB OpenAPI的Python SDK,方便与CNB平台进行交互
License: MIT
Requires Python: >=3.8

# Python CNB OpenAPI SDK

[![PyPI](https://img.shields.io/pypi/v/python-cnb.svg)](https://pypi.org/project/python-cnb/)
[![Python Version](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
<a href="https://yuanbao.tencent.com"><img src="https://img.shields.io/badge/AI-Code%20Assist-EB9FDA"></a>

CNB OpenAPI的Python SDK，方便与CNB平台进行交互。
> 该 sdk 由 [cnb-sdk-generator](https://cnb.cool/cnb/sdk/cnb-sdk-generator) 生成

## 功能特性

- 完整的API覆盖（用户、仓库、Issue等）
- 基于Pydantic的强类型模型
- 完善的错误处理机制
- 自动重试和超时控制

## 安装

```bash
pip install -e .
```

或通过PyPI安装（已发布）：

```bash
pip install python-cnb
```

## 快速开始

```python
#!/usr/bin/env python

import os
from dotenv import load_dotenv
from cnb import CNBClient
from cnb.exceptions import CNBAPIError
from cnb.models import api

# 加载环境变量
load_dotenv()

def get_user_info():
    # 初始化客户端
    client = CNBClient(
        base_url="https://api.cnb.cool",
        api_key=os.getenv("CNB_TOKEN"),  # 从环境变量获取API Key
        max_retries=3,  # 最大重试次数
        timeout=30,     # 请求超时时间(秒)
    )

    try:
        user_info = client.cnb.users.get_user_info()
        print(f"user_info: {user_info}")

    except CNBAPIError as e:
        print(f"API调用失败: {e}")

def create_issue():
    # 初始化客户端
    client = CNBClient(
        base_url="https://api.cnb.cool",
        api_key=os.getenv("CNB_TOKEN"),  # 从环境变量获取API Key
        max_retries=3,  # 最大重试次数
        timeout=30,     # 请求超时时间(秒)
    )

    try:
        issue = client.cnb.issues.create_issue(
            repo="looc/test-ci", 
            body_params=api.PostIssueForm(
                title="测试 Issue",
                priority="111"
            )
        )
        print(f"issue: {issue}")

    except CNBAPIError as e:
        print(f"API调用失败: {e.errcode}")       

if __name__ == "__main__":
    get_user_info()
    list_issues()

```

## 许可证

MIT License - 详见[LICENSE](LICENSE)文件
hijri-calendar 0.3.0
A package for converting Hijriah Calendar Day
License: MIT
Requires Python: >=3.10

## Hijriah Date Converter

[![PyPI Downloads](https://static.pepy.tech/personalized-badge/hijri-calendar?period=total&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=BLUE&left_text=downloads)](https://pepy.tech/projects/hijri-calendar) [![codecov](https://codecov.io/gh/sodrooome/hijriah-converter/graph/badge.svg?token=6SHZWUEMRS)](https://codecov.io/gh/sodrooome/hijriah-converter)

A package to convert between Hijri and Gregorian calendar date using the Umm al-Qura calendar.

#### Installation

`pip install hijri-calendar`

#### Features

- Supported ISO and another extendable date format
- Representation to string with formatted name of the month based on hijriah calendar
- Offset and limit range for both calendar

#### Usage

The usage itself is quite straightforward, just inputted the gregorian or hijri version of the calendar with something like:

```python
from hijri.core import Hijriah

# convert gregorian calendary day into hijriah
>>> gregorian = Hijriah(day=21, month=12, year=2025)
>>> print(gregorian.to_hijri())
'1/7/1460'

# getting hijri month based on the gregorian calendar
>>> gregorian = Hijriah(day=21, month=12, year=2025)
>>> get_month = gregorian.get_hijri_month()
>>> print(get_month)
'Dzul Hijjah'

# converting into common ISO format
>>> get_iso = Hijriah.to_representation(day=21, month=12, year=2024, date_format="ISO")
>>> print(get_iso)
'21/12/21'

# converting into more standard version of ISO
>>> get_iso = Hijriah.to_representation(day=21, month=12, year=2024, date_format="ISO-8601")
>>> print(get_iso)
'2024-12-21'
```

For further usage, please refer the `example.py` file

#### Acknowledgment

For the calculation formula itself i adopted from several resources and packages, especially with these two, [Python Islamic Library](https://github.com/abougouffa/pyIslam) and [Hijri.js](https://github.com/xsoh/Hijri.js)

#### Caveats

For accuracy itself, to be honest i don't really know how accurate it is for calendar conversion. For example, if we inputted the current date (from 2021), the conversion result to the hijri year is 1455 which is actually wrong. After some research, there is a leap day in the Hijri calendar which will increase every 2 or 3 years and there are also 11 leap years in a 30-year cycle. Their distribution varies slightly from one country or Muslim community to another.

In addition to the leap days that inserted in solar calendars like the Gregorian calendar or Julien Calendar, the Hijriah leap day is not designed to align the calendar with the solar year, which on average lasts just over 365 days.

Furthermore, this makes the calculation of the months in Hijriah calendar is difficult to predict / compute. For example, bad weather conditions may delay the beginning of a new month by one day at short notice.
ss-pylib 0.27.3
SWEET-SOOP Python Library
License: MIT
Requires Python: >=3.12

# SWEET-SOOP Python Library

## Decorator
### Singleton
**How to use**
```python
from sslib.decorator.singleton import singleton

@singleton
class MyClass:
  pass
```

## Helper
### Config
**.env**
```c
[common] //group
NAME = sweetsoop  //key = value
```
**How to use**
```python
from sslib.helper.config import Config

config = Config(os.path.dirname(__file__) + '/.env')
print(config.get('common.NAME'))
```