semvec/pypi-packages huggingface dataset:
starform 0.0.1
StarForm is a Python library to quickly develop clean modular models/pipelines.

# Star Formation

Star Formation is a Python library to quickly develop clean modular models/pipelines. Geared towards usage with sklearn and keras.

## Installation

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install foobar.

```bash
pip install starformation
```

## Usage

```python
import starformation as sf
#Create pipeline
bf = sf.Formation()
#star() return the input
s = sf.star()
#Add star
bf.add(s)
#returns [4]
bf.run(4)
```
## add(s:star)
Add first star in formation or chain stars to the last added star.

Example: (x+1) * 3
```python
import starformation as sf
from starformation.classic import CStar

bf = sf.Formation()
s = sf.star()
bf.add(CStar(lambda x: x+1))
bf.add(CStar(lambda x: x*3))
#returns [15]
bf.run(4)
```

## link(s:star)
Add first star in formation or chain stars to the last added star.

Example: (x+1) * 3
```python
import starformation as sf
from starformation.classic import CStar

bf = sf.Formation()
s = sf.star()
bf.add(CStar(lambda x: x+1))
bf.add(CStar(lambda x: x*3))
#returns [15]
bf.run(4)
```

## Run(input, cores = none)
Input is fed into the first star. Cores specify how many processes. 

Chain stars. Execution star.action() -> star2.action()
```python
import starformation as sf

bf = sf.Formation()
s = sf.star()
bf.add(s)
bf.link(sf.star())
bf.link(sf.star())
bf.link(sf.star())
bf.link(sf.star())
#return [4,4,4,4]
bf.run("example",2)
#also return [4,4,4,4] but not multicore
bf.run("example")
```

## CStar
Makes a custom function.
```python
import starformation as sf
from starformation.classic import CStar

def add(x):
    return x+1

bf = sf.Formation()
bf.add(CStar(add))

#returns [5]
bf.run(4)
```
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## License
[GPL](https://choosealicense.com/licenses/gpl-3.0)
WebLamp 0.3.0
A socket webserver made in python!
Requires Python: >=3.8

# Lamp

An asynchronous webserver made with sockets in python!

Examples of using Lamp:

```py
from Weblamp import Domain, Lamp, Connection

server = Lamp()
domain = Domain(('your.domain.com', '127.0.0.1:5000')) 

@domain.add_route(path = '/', method = ['GET'])
async def home(con: Connection) -> tuple:
  return (200, b'Hello World!')

server.add_domain(domain)
server.run(
  bind = ('127.0.0.1', 5000)
)
```

1 unique thing about this webserver is you can use a regex in your route and domain!

```py
import re

from Weblamp import Domain, Lamp, Connection

server = Lamp()
domain = Domain(('your.domain.com', '127.0.0.1:5000')) 

@domain.add_route(path = re.compile(r'^/u/(?P<userid>[0-9]*)$'), method = ['GET'])
async def home(con: Connection) -> tuple:
    userid = conn.args['userid'] # this came from the regex that was provided
    
    return (200, userid.encode())

server.add_domain(domain)
server.run(
  bind = ('127.0.0.1', 5000)
)
```