semvec/pypi-packages huggingface dataset:
tonygrad 2.0.0
A tiny scalar-valued autograd engine with a small PyTorch-like neural network library on top.
Requires Python: >=3.6

# tonygrad

![yeahhhhh](https://github.com/ent0n29/tonygrad/raw/main/yeah.png)
 
 A tiny scalar-valued autograd engine with a small PyTorch-like neural network library on top.  Implements backpropagation (reverse-mode autodiff) over a dynamically built DAG.
 The DAG only operates over scalar values, so e.g. we chop up each neuron into all of its individual tiny adds and multiplies. However, this is enough to build up entire deep neural nets doing binary classification, as the demo notebook shows.

### Installation

```bash
pip install tonygrad
```

### Example usage

Below there is a simple example showing a number of possible supported operations:

```python
"""tanh() VERSION"""

# inputs x1,x2
x1 = Value(2.0, label='x1')
x2 = Value(0.0, label='x2')
# weights w1,w2
w1 = Value(-3.0, label='w1')
w2 = Value(1.0, label='w2')
# bias of the neuron
b = Value(6.8813735870195432, label='b')
# x1*w1 + x2*w2 + b
x1w1 = x1*w1; x1w1.label = 'x1w1'
x2w2 = x2*w2; x2w2.label = 'x2w2'
x1w1x2w2 = x1w1 + x2w2; x1w1x2w2.label = 'x1*w1 + x2*w2'
#output
n = x1w1x2w2 + b; n.label = 'n'
#apply tanh to the output 
o = n.tanh(); o.label = 'o'
#launch backprop on the built graph
o.backward()
```


### Tracing / visualization

For added convenience, the notebook `trace_graph.py` produces graphviz visualizations. Here we draw the neural network graph built in the example above. 

```python
from tonygrad.trace_graph import draw_dot, trace

draw_dot(o)
```

![2d neural net](https://github.com/ent0n29/tonygrad/raw/main/output.svg)

### Training a neural net

The notebook `demo.ipynb` provides a full demo of training an 2-layer neural network (*MLP*) binary classifier. This is achieved by initializing a neural net from `tonygrad.nn` module, implementing a simple svm "max-margin" binary classification loss and using *stochastic gradient descent* for optimization. As shown in the notebook, using a 2-layer neural net with two 16-node hidden layers we achieve the following decision boundary on the moon dataset:

![2d neural net](https://github.com/ent0n29/tonygrad/raw/main/decision_boundary.png)

### License

MIT
DirectAdminAPI-SGS-shohani 0.0.7
DirectAdmin API for Python
Requires Python: >=3.7

# DirectAdmin API for Python
This package help you manage DirectAdmin control panel via API.
## Installation
```
pip install DirectAdminAPI-SGS-shohani
```
## Sample usage
```    
    from DirectAdminAPI_SGS_shohani.api import PrettyAPI

    api = PrettyAPI(username=admin_da_user,password=admin_da_pwd,server=da_url,json=True)
    #Get list of users that has access to a protected folder in DirectAdmin
    da_users = api.get_protected_directory_users('/domains/test.com/public_html/manager')
  
    users = da_users['users']
    for key in users:
        print(users[key])
    
    #search recursively for test.txt in root path
    da_files = api.search_files( '/','test.txt' , recursive=True)
    for key in da_files:
        print(da_files[key])
```
stepping 0.0.3
Incremental View Maintenance for Python backends
Requires Python: >=3.11
Keywords: IVM,postgres,sqlite

# `stepping`

Based on the paper: [DBSP: Automatic Incremental View Maintenance for Rich Query Languages](https://github.com/vmware/database-stream-processor/blob/e6cdbb538bbce8adb90018ff75f8ae8251b3e206/doc/theory/main.pdf).

# [📚 Documentation 📚](https://stepping.site)

## Installation

```bash
pip install stepping
```

### Development installation

```bash
git clone git@github.com:leontrolski/stepping.git
python -m venv .env
source .env/bin/activate
pip install -e '.[dev]'
pytest
mypy src tests
```

## Nice-to-haves

- In `interleave_changes`, use indexed `ZSetPython` under the hood.
- Skip out the middle man with `Grouped` and just use an indexed `ZSet`? Does this lead to performance benefits in `st.group`?
- Instead of `create_tables=True` can we emit SQL and write it.
- Revisit `st.compile(...)`.
- Can `run.iteration` make nicer error messages?
- Python 3.12. Use built in `batched`. Can we use the new `Unpack` syntax for nicer action types?
- Look at 11.8 "Window aggregates"
- Replace `integrate_delay` with a nice transform. Similarly, transform shared delays.
- Decide whether to make `...SQL` classes protocols.
- Test arbitrary depth grouped nesting and joining in a grouped setting (Does this even make sense to do?).

# Uploading to Pypi

```bash
# bump version
python -m pip install build twine
python -m build
twine check dist/*
twine upload dist/*
```

# Deploy docs

```bash
flyctl launch
flyctl deploy
flyctl ips list -a stepping-docs
# set A record to @, IPv4
# set AAAA record to @, IPv6
flyctl certs create -a stepping-docs stepping.site

cd docs/doks
npm install
npm run start
npm run build
cd ..; flyctl deploy; cd -

cd docs
python ../scripts/md.py ../ $(find -L ../docs-md -name '**.md')
```
trojan-rabbit 0.0.1
Collection of python extras, like decorator @dynamicmethod
Requires Python: >=3.0

# The Trojan Rabbit #
A collection of python extras (and an hommage to Monty Python's Holy Grail)

## Decorator @dynamicmethod ##
This decorator provides the missing option for method definitions:

```
| decorator           | 1st parameter passed when called from |
|                     | instance / class                      |
|---------------------+---------------------------------------|
| - (instance method) | instance / None                       |
| @classmethod        | class    / class                      |
| @staticmethod       | -        / -                          |
| @dynamicmethod      | instance / class                      |
```

### Usage ###

```python
from trojan_rabbit.dynamicmethod import dynamicmethod


class Knight:
    description = "a knight of the Round Table"

    def __init__(self, name, attribute):
        self.name = name
        self.attribute = attribute

    @dynamicmethod
    def whoami(caller):
        if isinstance(caller, Knight):
            print(f"{caller.attribute.capitalize()} Sir {caller.name}", end=', ')
        print(caller.description)


robin = Knight("Robin", "brave")

Knight.whoami
# output: <bound method Knight.whoami of <class '__main__.Knight'>>

robin.whoami
# output: <bound method Knight.whoami of <__main__.Knight object at 0x7f377073fe50>>

Knight.whoami()
# output: a knight of the Round Table

robin.whoami()
# output: Brave Sir Robin, a knight of the Round Table
```
wooden-rabbit 0.0.1
Collection of python extras, like decorator @dynamicmethod
Requires Python: >=3.0

# The Wooden Rabbit #
A collection of python extras (and an hommage to Monty Python's Holy Grail)

## Decorator @dynamicmethod ##
This decorator provides the missing option for method definitions:

```
| decorator           | 1st parameter passed when called from |
|                     | instance / class                      |
|---------------------+---------------------------------------|
| - (instance method) | instance / None                       |
| @classmethod        | class    / class                      |
| @staticmethod       | -        / -                          |
| @dynamicmethod      | instance / class                      |
```

### Usage ###

```python
from wooden_rabbit.dynamicmethod import dynamicmethod


class Knight:
    description = "a knight of the Round Table"

    def __init__(self, name, attribute):
        self.name = name
        self.attribute = attribute

    @dynamicmethod
    def whoami(caller):
        if isinstance(caller, Knight):
            print(f"{caller.attribute.capitalize()} Sir {caller.name}", end=', ')
        print(caller.description)


robin = Knight("Robin", "brave")

Knight.whoami
# output: <bound method Knight.whoami of <class '__main__.Knight'>>

robin.whoami
# output: <bound method Knight.whoami of <__main__.Knight object at 0x7f377073fe50>>

Knight.whoami()
# output: a knight of the Round Table

robin.whoami()
# output: Brave Sir Robin, a knight of the Round Table
```
simplesocks 1.0.0
A simple wrapper written on top of standard python sockets
Requires Python: >=3.7

# Simplesocks

A simple socket wrapper for python built on top of the standard socket library with password based encryption for security.

## Instructions 

1. Install 

```bash
pip install simplesocks
```

2. Create server.py

```python
import socket
from simplesocks.server import SimpleServer
import json

class TestServer(SimpleServer):
    def accept_client_connection(self, client_socket: socket.socket, client_address: tuple, initialization_data: object) -> None:
        super().accept_client_connection(client_socket, client_address, initialization_data)

        initialization_data = json.loads(initialization_data)['id']
        print(f"Client {client_address[0]}:{client_address[1]} connected as {initialization_data}")

    def handle_incoming_data(self, client_id: str, client_socket: socket.socket, data: bytes) -> None:
        super().handle_incoming_data(client_id, client_socket, data)

        if data == b"TERMINATE":
            print(f"Server termination requested by {client_id}")
            self.terminate_server()
        
        self.broadcast_data(client_socket, json.dumps({'id': client_id, 'data': data.decode()}).encode('utf-8'))

    def close_client_connection(self, client_id: str, client_socket: socket.socket) -> None:
        super().close_client_connection(client_id, client_socket)
        print(f"Client {client_id} disconnected")

server = TestServer(server_key=b"msZ5ZR9zjtBXRzssQ3qD33FAVxTBir55rHa1dAJlV5g=")
server.listen()
```

3. Create client.py

```python
import json
import threading
import time
from simplesocks.client import SimpleClient, ClientReceiveDataTimeoutException

client = SimpleClient('192.168.1.200', 4444, server_key=b"msZ5ZR9zjtBXRzssQ3qD33FAVxTBir55rHa1dAJlV5g=")

def receive():
    while True:
        try:
            message = json.loads(client.receive_data().decode('utf-8'))
            print(f"{message['id']}: {message['data']}")
        except ClientReceiveDataTimeoutException as e:
            continue
def write():
    while True:
        client.send_data(input("").encode('utf-8'))

receive_thread = threading.Thread(target=receive)
receive_thread.start()

write_thread = threading.Thread(target=write)
write_thread.start()
```

4. Start the server

```
python server.py
```

5. Connect with client instances

```
python client.py
```
promptlink 0.1.5
Simplify user authentication and secure access from anywhere with customizable prompts and temporary links.
Requires Python: >=3.9,<4.0

# PromptLink

[![PyPI version](https://badge.fury.io/py/promptlink.svg)](https://badge.fury.io/py/promptlink)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

Simplify user authentication and secure access from anywhere with temporary links.

PromptLink is a Python package that allows you to streamline user authentication and enable secure access to your application from anywhere. It provides a seamless way to generate temporary links for user authentication, without relying on specific web frameworks. A Google Cloud Function is set up to ensure a secure temporary link for authentication.

## Key Features

- **Easy and secure**: Generate secure temporary links to enable easy secure access from anywhere.
- **Versatile Integration**: Works across various application types, not limited to web applications.

## Installation

You can install PromptLink using pip:
```shell
pip install promptlink
```
Alternatively, if you are using Poetry (recommended), you can install it as follows:
```shell
poetry add promptlink
```

## Usage

Here's a basic example of using PromptLink:

```python
from promptlink import Authenticator


with Authenticator(send_link_callback=lambda l: print(f"URL: {l}")) as authenticator:
    # The code in this block is executed after the link has been accessed 
    # in order to avoid authentication timeouts
    print("Setting up authentication...")
    authenticator.authenticate(lambda s: s == "12345678")
    # Below statements will be reached after '12345678' was input on the webpage prompt
    print("Finished")
```

## GCP permission requirements
The following permissions are needed for this library:
- Permissions to create Storage buckets and objects
- Permissions to set up a Pub/Sub topic and subscriptions
- Permissions to deploy a Cloud Function  

The library will attempt to use the default service account.
Any resources created will be named 'promptlink-' followed by a random UUID, so that collision with existing resources is extremely unlikely.

## License
This project is licensed under the MIT License. See the LICENSE file for details.
open-bobj 0.1.1
Open obj files in Blender from Terminal
Requires Python: >=3.8, <4
Keywords: blender,obj

# Open BOBJ

Simple Python Package to open `.obj` files in Blender
from the command line.
It clears the whole scene from any default objects and
you are left with the `.obj` files you specified.

## Install

You can simply install it using

```
pip install open-bobj
```

or if you have `pipx` use

```
pipx install open-bobj
```

## Usage

To open any number of `.obj` files in the terminal, run

```
open-bobj /path/to/file.obj
```

You can also open multiple at ones. This is going to open all
of the `.obj` objects in the same blender instance.

```
open-bobj /path/to/file.obj /another/file.obj /and/another/one.obj
```

There is also a short handle

```
bobj /path/to/file.obj
```
ezserialize 1.0
Easy to use python json serializer and deserializer tool using syntax similar to dataclasses
Requires Python: >=3.11

# ezserialize 1.0

### An easy to use python json serializer and deserializer for custom objects using similar syntax to dataclasses

## Install
On the terminal, type the following command:<br>
```pip install ezserialize```

## Usage

```py
# Import ezserialize
from ezserialize import serializable, serialize, deserialize, List, pretty_print
# Use your IDE to inspect the rest of the functions which are similar to the ones imported

# Tell ezserialize which objects you want to serialize. Each attribute must be serializable aswell

@serializable
class Pet:
    pet_type: str
    name: str
    age: int
    weight: float

@serializable
class Person:
    name: str
    age: int
    profession: str
    pets: List(Pet)
# When you use a default value, the type hint can be avoided, except for lists. Always use ezserialize.List and not 'list' for type hinting.

# Create your object. The __init__ method is automatically implemented, and use keyword arguments
person = Person(
    name = "John",
    age = 19,
    profession = "vet",
    pets = [
        Pet(
            pet_type = "cat",
            name = "luna",
            age = 6,
            weight = 2.5,
        ),
    ]
)

# Serialize your object to make it a JSON dict. You can then save it to a file using ezserialize.save() or manually dumping it using builtins.json
serialized_person = serialize(person)

# When you need your person back, use deserialize with the JSON object and the type you want back
deserialized_person = deserialize(serialized_person, Person)

# When you print the person (using pretty_print/(pretty_format for the string alone)) person and deserialized_person should look the same
print("Normal:")
pretty_print(person)
print("Deserialized:")
pretty_print(deserialized_person)
```