semvec/pypi-packages huggingface dataset:
sam-cpp-python 0.0.1
Python binding for sam.cpp
Requires Python: >=3.8

# Python Bindings for [sam.cpp](https://github.com/YavorGIvanov/sam.cpp)

## Installation

### From pypi

```sh
pip install sam_cpp_python
```

### From source

```sh
git clone https://github.com/neka-nat/sam-cpp-python.git
cd sam-cpp-python
pip install .
```

## Example

```py
import cv2
import numpy as np

import sam_cpp

image = cv2.imread("img.jpg")
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)

predictor = sam_cpp.create_sam_predictor()
predictor.set_image(image)
masks = predictor.predict(np.array([10, 10], dtype=np.float32))

print(masks)
```

## Result

![image](examples/img.jpg)
![masked_image](examples/masked_image.jpg)
python-memcached 1.62
Pure python memcached client

## Overview

This software is a 100% Python interface to the memcached memory cache
daemon.  It is the client side software which allows storing values
in one or more, possibly remote, memcached servers.  Search google for
memcached for more information.

This library is stable and largely in maintenance mode.  Another library that
is getting more active enhancements is
[pymemcache](https://pypi.org/project/pymemcache/) and they have links and a
good set of comparisons between them on their page.

This package was originally written by Evan Martin of Danga.  Please do
not contact Evan about maintenance.  Sean Reifschneider of tummy.com,
ltd. has taken over maintenance of it.

Please report issues and submit code changes to the github repository at:

   https://github.com/linsomniac/python-memcached

For changes prior to 2013-03-26, see the old Launchpad repository at:

   Historic issues: https://launchpad.net/python-memcached

## Testing

Test patches locally and easily by running tox:

    pip install tox
    tox -e py312

Test for style by running tox:

    tox -e pep8
varman 0.1.4
A dict like variable manager, listen for variable changes.
Requires Python: >=3.6

# VarMan

一个辅助监听变量赋值变化的类，基本用法类似dict类型
 
 
# 应用场景示例

- webapp中开关量的前后台同步，前台需要显示开关状态并且可以控制开关，后台亦然。
- 需要监听变量改变并回调相应方法的情形


# 使用方法

```shell
pip install varman
```

```python
import varman
var = varman.VarMan()
```

## 获取改变值的变量名


```python
var.a = 1
print(var.POPMODIFY(tag = 'tag1'))
var.a = 1
print(var.POPMODIFY(tag = 'tag1'))
var.a = 2
print(var.POPMODIFY(tag = 'tag1'))
var.b = 3
print(var.POPMODIFY(tag = 'tag1'))
print(var.POPMODIFY())
```

    {'a'}
    set()
    {'a'}
    {'b'}
    {'a', 'b'}
    

## 设置回调函数


```python
# 对应变量“c”的回调函数
@var.ONMODIFY('c')
def fun(pre, nxt):
    print(f'pre c:{pre}, next c:{nxt}')  
```


```python
var.c = 1
```

    pre c:None, next c:1
    


```python
var['c'] = 4
```

    pre c:1, next c:4
    


```python
# var中任意变量改变时回调
@var.ONMODIFYANY
def func(varname, pre, nxt):
    print(f'var:{varname}; pre: {pre}, next:{nxt}')
```


```python
var.c = 1
```

    pre c:4, next c:1
    var:c; pre: 4, next:1
    


```python
var.a = 5
```

    var:a; pre: 2, next:5
    


```python
var.dd = []
```

    var:dd; pre: None, next:[]
    


```python
# 只能监听基本变量，或变量的id改变，无法监听list、dict等类型的内部更改
var.dd.append(1)
```

# 主动触发（2024年1月14日）
var.CALLONMODIFY('c') # 强制调用变量c的回调函数

```python
# 移除监听器
var.REMOVELISTENER('c')
var.c = 8
```

    var:c; pre: 1, next:8
    


```python
# 移除对任意变量的监听器
var.REMOVEANYLISTENER()
var.c = 10
```

## 作为iter类型使用(类似dict)


```python
for key in var:
    print(f'{key}:{var[key]}')
```

    a:5
    b:3
    c:10
    dd:[1]
    


```python
# 带前缀“_”的变量将隐式调用，不会自动监听赋值状态，也不会被迭代
# 不允许“__”前缀
var._d = 5
for key in var:
    print(f'{key}:{var[key]}')
```

    a:5
    b:3
    c:10
    dd:[1]
    


```python
print(var._d)
```

    5
    


```python
def fun2(**params):
    print(params)
fun2(**var)
```

    {'a': 5, 'b': 3, 'c': 10, 'dd': [1]}
    


```python
# 实例化的同时添加变量
var2 = varman.VarMan(d = 8, e=10)
print(var2)
```

    {'d': 8, 'e': 10}
    


```python
var2
```




    VarMan({'d': 8, 'e': 10})




# todo?

- 删除变量
paikwiki-hello-cli 0.0.1
This is a Python CLI app designed to facilitate learning how to configure Python CLI applications.
Requires Python: >=3.12,<4.0

# Hello CLI

This is a Python CLI app designed to facilitate learning how to configure Python CLI applications.

## 세팅하기

먼저 Poetry로 프로젝트를 시작한다.

```sh
poetry add paikwiki-hello-cli
```

`paikwiki_hello_cli/main.py` 파일을 생성하고, 아래처럼 입력한다.

```py
# main.py
def run():
    print("Hello, World!")

if __name__ == "__main__":
    run()
```

`pyproject.toml`에 아래의 설정을 추가한다.

```toml
[tool.poetry.scripts]
hello = "paikwiki_hello_cli.main:run"
```

터미널에서 가상환경을 시작한다.

```sh
$ poetry shell
Spawning shell within /Users/{USER_NAME}/Library/Caches/pypoetry/virtualenvs/paikwiki-hello-cli-{HASH}-py3.123.12
$ emulate bash -c '. /Users/{USER_NAME}/Library/Caches/pypoetry/virtualenvs/paikwiki-hello-cli-{HASH}-py3.12
3.12/bin/activate'
(hello-cli-py3.12) $
```

아래 명령어로 `paikwiki-hello-cli`를 설치한다.

```sh
poetry install
```

실행이 잘 되는지 테스트한다.

```sh
(paikwiki-hello-cli-py3.12) $ hello
Hello, World!
```

## Deploy

PyPi API 토큰을 설정한다.

```sh
poetry config pypi-token.pypi {API_TOKEN}
```

패키지를 빌드한다.

```sh
$ poetry build
Building paikwiki-hello-cli (0.0.1)
  - Building sdist
  - Built paikwiki_hello_cli-0.0.1.tar.gz
  - Building wheel
  - Built paikwiki_hello_cli-0.0.1-py3-none-any.whl
```

패키지를 배포한다.

```sh
$ poetry publish
```
atomgrad 0.3.0
An autocgrad engine that is between micrograd and tinygrad with a PyTorch-like neural network API:)
Requires Python: >=3.6

# atomgrad

![pic](pic.jpeg)

Atomgrad is a simple autograd engine that aims to be between [micrograd](https://github.com/karpathy/micrograd/) and [tinygrad](https://github.com/tinygrad/tinygrad) that performs autodiff on vector-valued and scalar-valued tensors (atoms) coupled with a neural network api library.

## Features

- Supports Pytorch-like vector-valued and scalar-valued tensors.
- Supports basic unary ops, binary ops, reduce ops and movement ops i.e (activn funcs, `sum`, `exp`, `reshape`, `randint`, `uniform`, etc).
- Supports activation functions such as `relu`, `sigmoid`, `tanh`, etc.
- Supports `binary_cross_entropy` & `binary_accuracy`.
- Supports Graph Visualizations.

## Installation

You can install atomgrad using pip:

```bash
pip install atomgrad==0.3.0
```

## Usage

Here is a simple example of using atomgrad to compute the gradient of a function:

```python
from atomgrad.atom import Atom
from atomgrad.graph import draw_dot


# create two tensors with gradients enabled
x = Atom(2.0, requires_grad=True)
y = Atom(3.0, requires_grad=True)

# define a function
z = x * y + x ** 2

# compute the backward pass
z.backward()

# print the gradients
print(x.grad) # 7.0
print(y.grad) # 2.0

draw_dot(z)
```
![pic](graph.png)

Here is a simple example of using atomgrad to train a one 16-node hidden layer neural network for binary classification.

```python
import numpy as np
from atomgrad.atom import Atom
from atomgrad.nn import AtomNet, Layer
from atomgrad.optim import SGD
from atomgrad.metrics import binary_cross_entropy, binary_accuracy

# create a model
model = AtomNet(
  Layer(2, 16),
  Layer(16, 16),
  Layer(16, 1)
)
# create an optimizer
optim = SGD(model.parameters(), lr=0.01)

# load some data
x = [[2.0, 3.0, -1.0],
  [3.0, -1.0, 0.5],
  [0.5, 1.0, 1.0],
  [1.0, 1.0, -1.0],
  [0.0, 4.0, 0.5],
  [3.0, -1.0, 0.5]]
y = [1, 1, 0, 1, 0, 1]

x = Atom(x)
y = Atom(y)

model.fit(x, y, optim, binary_cross_entropy, binary_accuracy, epochs=100)

#output
'''
...
epoch: 30 | loss: 0.14601783454418182  | accuracy: 100.0%
epoch: 35 | loss: 0.11600304394960403  | accuracy: 100.0%
epoch: 40 | loss: 0.09604986757040024  | accuracy: 100.0%
epoch: 45 | loss: 0.0816292017698288  | accuracy: 100.0%
'''
```

## Demos

An example of simple autodiff and four binary classifiers including `make_moons` dataset and MNIST digits dataset is in the `examples/demos.ipynb` notebook.

Note: Although `atom.nn` includes `softmax` activation and `cat_cross_entropy`, model results are quite dissapointing and are likely due to some bug (plz lmk if you find it!). As a result the `AtomNet` model is best suited for binary classification neural net tasks.
ccontrol 0.0.2
library that simplifies working with the console
Requires Python: >=3.6
Keywords: console speed python

п»ї# ccontrol
ccontrol is a library designed for creating text-based user interfaces in Python. It simplifies the rendering of text to the screen, user input processing, and interacting with terminal functionalities without directly exposing the underlying complexity.
## Features
- Easy to use functions for displaying text with various attributes such as color and style
- Functions to initialize custom terminal screen settings
- Helper functions for creating input boxes and handling key presses
## Installation
This library is designed to work as a part of a Python project. Perfect for applications that require direct terminal manipulations for text-based interfaces.

To use ccontrol, you will need to ensure that you have Python installed on your system. No additional packages or curses-specific modules are required to be mentioned as dependencies for the basic running of ccontrol.
## Quick Start
Here's a quick example on how you can utilize the ccontrol library:
```
import ccontrol

# Initialize the screen with default settings
stdscr = ccontrol.initialize_screen()

try:
    # Display text at a specific location with color and bold style
    ccontrol.text(stdscr, x=10, y=5, text="Hello, ccontrol!", color_pair=ccontrol.BLUE, style=ccontrol.BOLD)

    # Create an input box for user input
    user_input = ccontrol.input_box(stdscr, x=10, y=10, width=20, title="Input:")
    print("User input:", user_input)

    # Wait for a key press
    key = ccontrol.get_key(stdscr)
    print("Key pressed:", key)

finally:
    # Make sure to end the ccontrol application
    ccontrol.exit_programm()
```
Note that while the ccontrol library uses the curses module internally, its API abstracts away the curses-specific details, providing a straightforward interface for building text user interfaces.
## Documentation
Functions provided by ccontrol include, but are not limited to:

- initialize_screen:
  Accepts various boolean flags to customize terminal settings such as hiding the cursor or enabling the keypad for special keys.
- text:
  Outputs text at a given screen location with the provided colors and styling attributes.
- input_box:
  Renders a simple input box at the specified screen location and accepts user input.
- get_key:
  Waits for a user key press and returns the pressed key's keycode.
## Color and Style Constants
The ccontrol library comes with predefined constants for colors and text attributes:

- Colors:
  - WHITE
  - RED
  - YELLOW
  - GREEN
  - BLUE
  - CYAN
  - MAGENTA
- Styles:
  - NORMAL
  - BOLD
  - UNDERLINE
  - REVERSE
  - BLINK

These can be used to modify the text output's appearance on the terminal.
## Contributing
Contributions to the ccontrol library are welcome. If you have a suggestion that would make this library better, please fork the repo and create a pull request.
## License
Licensed under the MIT License. See the LICENSE file for more details.