semvec/pypi-packages huggingface dataset:
codecraft 0.0.1
AI code assistant to help you write code faster, cover it with tests and more
License: MIT
Requires Python: >=3.10,<4.0

# CodeCraft

AI code assistant to help you write code faster, cover it with tests and more

## Getting started

```shell
cd path/to/your/project
pip install codecraft
export OPENAI_API_KEY=your-key-goes-here
```

## Usage

Once installed, codecraft can be run through its command-line interface.

### Command-line Interface

Run a codecraft session using the following command:

```python
codecraft
```

Optional Arguments:
- -q or --query: Run with a specific query.
- -c or --coverage: Run with coverage analysis.

```shell
codecraft --query "Your query here"
codecraft --coverage
```

## Requirements

 - python: 3.10+

## First run

On the first run `codecraft` create folder `.codecraft/prompts` with main prompts so you can tune prompts for your project

Also `codecraft` will add `.codecraft` to `.gitignore` file - not to use prompts in GIT

## Envs

### CODECRAFT_MODEL_NAME

Model name in OpenAI API to use

### OPENAI_API_KEY

API key for OpenAI API

### CODECRAFT_COV_FOLDER

Folder to use in coverage report (default: `.`)

## Contributing

Contributions to `codecraft` are welcome! Please read our contributing guidelines for details on how to submit pull requests

### Clone repository

```shell
git clone ...
```

### Install dependencies

```shell
poetry install
```

### Use with your project

```shell
cd path/to/your/project
pip install -e path/to/cloned/codecraft
codecraft
```

## License

`codecraft` is licensed under MIT License

## Contact

For any queries or suggestions, feel free to contact us at [hello@welltory.com]
py-mcws 2.0.2
Minecraft Bedrock WebSocket
License: MIT

# py-mcws

![PyPI - Version](https://img.shields.io/pypi/v/py-mcws)
[![Downloads](https://static.pepy.tech/badge/py-mcws)](https://pepy.tech/project/py-mcws)
![PyPI - License](https://img.shields.io/pypi/l/py-mcws)
[![Upload Python Package](https://github.com/HRTK92/py-mcws/actions/workflows/python-publish.yml/badge.svg)](https://github.com/HRTK92/py-mcws/actions/workflows/python-publish.yml)

> MinecraftとPythonを繋げるためのシンプルなライブラリ

---

## インストール

```sh
pip install py-mcws
```

## 使い方

```python
import py_mcws

server = py_mcws.WebsocketServer()


@server.event
async def on_ready(host, port):
    print("サーバーを起動しました。")
    print(f"'/connect {host}:{port}' で接続できます")


@server.event
async def on_connect():
    print("接続しました")
    await server.command("say Hello World!") # メッセージを送信


@server.event
async def on_PlayerMessage(event):
    print(event)

server.start(host="0.0.0.0", port=19132)
```

## 接続の仕方

> [!WARNING]
> ワールドの設定でチートを有効にする必要があります。

Minecraft内のチャットで以下のコマンドを実行してください。

```cmd
/connect host:port
```

## イベントを受け取る

> [!NOTE]
> Minecraftで受け取れるイベントは以下から確認してください。  
> [MCPE & W10 Event Names](https://gist.github.com/jocopa3/5f718f4198f1ea91a37e3a9da468675c#file-mcpe-w10-event-names) by jocopa3

`PlayerMessage`イベントを受け取る例

```python
@server.event
async def on_PlayerMessage(event):
    print(event)
```

## コマンドを実行する

Minecraft と接続している状態でコマンドを実行してください。

```python
cmd = await server.command("say Hello World!")
print(cmd)
```

## 記事

以下の記事は、[inunosinsi](https://github.com/inunosinsi)さんによる記事です。  
thanks!

- [クロームブックのマインクラフト統合版でプログラミングをしてみる](https://saitodev.co/microbit/chromebook/article/57)
- [py-mcwsの仕組みを見てみよう](https://saitodev.co/microbit/chromebook/article/58)
- [py-mcwsでプレイヤーの頭上でニワトリを召喚してみる](https://saitodev.co/microbit/chromebook/article/61)
- [py-mcwsでプレイヤーの前に任意のブロックを置いてみる](https://saitodev.co/microbit/chromebook/article/62)