semvec/pypi-packages huggingface dataset:
easyfunc 0.2.5.1
Easy and simple functional programming style helper for python
Keywords: fp,python,functional

# Simple functional programming style for python

_Tested on python version *2.6*, *2.7*, *3.x*

This package provides an incomplete simulation of [LINQ](https://en.wikipedia.org/wiki/Language_Integrated_Query)/[Stream](https://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html) style stream processing for python.

This package aims to provides but some convenient methods, not a complete fp toolset to replace traditional pythonic coding.

[TOC]

## Installation

### pip
> pip install easyfunc

## manually
Copy easyfunc.py to your project and use it.

## Usage

```python
from easyfunc import Stream
```

### Stream creating

Create from iterable
```python
Stream(range(10))
Stream([1,2,3,4,5])
```
Create Stream literally
```python
Stream.of(1,2,3,4)
```
Infinite number Stream
```python
Stream.number() # 0,1,2,3,...
Stream.number(start=100, step=5) # 100,105,110,...
```
Empty Stream
```python
Stream.empty()
```

### Stream combining

Concat with other Stream/Iterable
```python
Stream.concat(Stream.of(1,2,3), Stream.of(4,5,6)) # 1,2,3,4,5,6
Stream.concat(Stream.of(1,2,3), range(3)) # 1,2,3,0,1,2
```

Extend current Stream with Stream/Iterable
```python
Stream.of(1,2,3).extend(Stream.of(4,5,6)) # 1,2,3,4,5,6
Stream.of(1,2,3).extend(range(3)) # 1,2,3,0,1,2
```

Zip two Stream/Iterable
```python
Stream.zip(range(3), Stream.number()) # (0,0),(1,1),(2,2) # stop at the shorter one
Stream.number().zip_with(Stream.of(99, 100)) # (0,99),(0,100)
```

Append element(s) to current Stream
```python
Stream.of(1,2,3).append(4,5) # 1,2,3,4,5
```

Prepend element(s) to current Stream
```python
Stream.of(4,5).prepend(1,2,3) # 1,2,3,4,5
```

Flat inside iterable to one-dimension
```python
Stream.of([1,2,3], Stream.of(4,5,6)).flat() # 1,2,3,4,5,6
```

### Stream operating

Take from first
```python
Stream.number().take(4) # 0,1,2,3
Stream.number().take(4).take(5) # 0,1,2,3
```

Take while True, stop when False
```python
Stream.number().takeWhile(lambda x: x != 4) # 0,1,2,3
```

Filter by condition
```python
Stream.number().filter(lambda x: x % 2 == 0) # 0,2,4,6,...
```

### Element Accessing

Get next item
```python
Stream.number().next_item().get() # 0
Stream.empty().next_item().or_else(-1) # -1
```

Find first which satisfies
```python
Stream.number(start=1).find_first(lambda x: x % 6 == 0).or_else(100) # 6
```

### check elements

If any matchs
```python
Stream.number().take(8).any(lambda x: x % 7 == 0) # True
```

If all match
```python
Stream.of(2,4,6,8).all(lambda x: x % 2 == 0) # True
```

### map and foreach

Map each elements
```python
Stream.number().map(lambda x: str(x)) # '0','1','2',...
```

Foreach
```python
def printItem(x):
    print(x)
Stream.number().take(4).foreach(lambda x: printItem(x))
```

### aggregate operations

Sum for numbers
```python
Stream.number().take(10).sum() # 45
```

Join for strings
```python
Stream.number().map(lambda x: str(x)).take(4).join(".") # '0.1.2.3'
```

Fold(reduce)
```python
Stream.number().take(10).fold(lambda x, y: x+y, 0) # 45
```
payload-automation 1.1.0
A set of libraries to help be a bridge between Sleep and Python, helping to automate payload development, testing, opsec checking, beacon tasking, and deployment for Cobalt Strike
Requires Python: >=3.6

What is Payload Automation?
=================

Now available as a PyPi package: https://pypi.org/project/payload-automation/

Payload Automation is a collection of Python classes to serve as a bridge between Sleep and Python which can be used to help automate payload development, testing, opsec checking, and deployment with Cobalt Strike or anything else you can come up with.

Please check out the examples folder for pre-made scripts taking advantage of the functionality provided.

Included Libraries:
 - Striker: A set of functions to interact with Cobalt Strike and execute functionality typically only accessible via Sleep/GUI.
 - Compyler: A set of functions to compile various payloads from platform or cross-platform.
 - Artifactor: A set of functions to inspect and review artifacts and collect and track IoCs.
 - Sleepy: A set of functions to help facilitate a bridge between Sleep objects and Python objects.
 - Detemplate: An incomplete idea of mine to automate the population of template files based on YAML configurations. Meant to be used with more complex payloads with multiple replacements and/or embedding.

Other associated work and credits:
 - Original idea for Striker and some code snipets came from the functionality of Verizon's redshell tool (https://github.com/Verizon/redshell)
 - A similar tool called pycobalt (https://github.com/dcsync/pycobalt) which is worth checking out to see if it better fits your use cases
 - Joe Vest leveraged our libraries to facilicate logging, payload automation, and reporting. Check out his blog post here (https://blog.cobaltstrike.com/2021/10/13/cobalt-strike-sleep-python-bridge/)

TODO:
 - Add additional error checking, specifically for application dependencies
 - Expand compyler to include remote builds and mingw
 - Add email functionality to Striker
 - Add extraction of profile for OPSEC checks