semvec/pypi-packages huggingface dataset:
hofs 0.2.0
Higher-order functions for the filesystem
License: MIT

# hofs

Hofs (**H**igher-**o**rder **f**unctions for the **f**ile **s**ystem) provides a useful functional interface for filesystem interactions.

This library is usable, but the API is currently not stable, a lot of features are still missing etc.

In summary - try it out, but don't use it for anything in production.

## Code examples

Let's say you need to get the total number of lines of all txt files in the current directory excluding the `.git` directory.
The `hofs` library allows you to write a simple function chain that accomplishes this is one line:

```python
import hofs as fs

fs.Dir(".").files.filter_ext("txt").t().map_lc().sum()
```

The library is very flexible, allowing you to write both short and long forms for most properties:

```python
import hofs as fs

# Short form (for when you quickly need to prototype something)
fs.Dir(".").files.filter_ext("txt").t().map_lc().sum()

# Long form (for when you need to use the library in a codebase)
fs.Dir(".").files.filter_extension("txt").text_file_iterator().map_line_count().sum()
```

The `hofs` library is very general.
If you need to perform an operation that is currently not present, simply call the respective higher-order functions with your own callables.
For example here is how we could perform our task by explicitly calling the respective higher-order functions:

```python
import hofs as fs

# Long form (for when you need to use the library in a codebase)
fs.Dir(".").files.filter(lambda f: f.extension == "txt").map(lambda f: f.text_file().line_count).sum()
```

## Requirements

You need Python >= 3.9 for this library.

## Installation

You can install hofs using the pip package manager:

```shell
pip install hofs
```

## Documentation

See the [documentation](uhasker.github.io/hofs) for further information.
snakedict 1.0.0
Keep your dict keys PEP 8 compliant.
License: MIT
Keywords: python,pep 8,dicts

# Snake Dict

## Keep your dictionary keys PEP 8 compliant

### Quick Example

```py
from snakedict import convert

my_dict = {
    "helloWorld": "test",
    "thisIsCamelCase": "hello",
    "this_is_snake_case": "world",
}

my_dict = convert(a)
print(my_dict["hello_world"])  # test
```

### Installation

#### Linux/macOS

```
python3 -m pip install -U pointers.py
```

#### Windows

```
py -3 -m pip install -U pointers.py
```

### Usage

There are 2 main functions, `convert` and `auto`.

`convert` does what was shown above, it takes in a dictionary and converts keys that are in camelCase to snake_case:

```py
from snakedict import convert

my_dict = {
    "something": "test",
    (1, 2, 3): "hello"  # you can use any key you want, snakedict won't touch it unless its in camelcase
}

print(convert(my_dict))  # no camelcase found, nothing happens
```

On the other hand, `auto` is a decorator that converts the response to snake case:

```py
from snakedict import auto

@auto()
def fetch_something():
    return {  # lets pretend this is a call to some api
        "accountName": "someone1234",
        "joinDate": "7/19/22",
    }

print(fetch_something()["account_name"])

```

`auto` has a parameter called `execute_maybe` that won't call `convert` if the response wasn't a `dict`:

If you want an error to be raised if the function returns `None`, set it to `False`:

```py
@auto(execute_maybe = False)
def fetch_something():
    return None

fetch_something()  # TypeError!
```
lightspin-api-client 0.0.7
Lightspin API Client
License: MIT
Requires Python: >=3.6
Keywords: api,client,lightspin

# The Lightspin Python library

![PyPI - Version](https://img.shields.io/pypi/v/lightspin-api-client)
![PyPI - License](https://img.shields.io/pypi/l/lightspin-api-client)

This Python library contains helpers and samples for Lightspin APIs.
Upon installation, the library helpers can be used to consume the API with built-in JWT authentication, paging and dynamic API parameters usage.

## Installation:

```bash
pip3 install lightspin-api-client
```

## Usage - SIEM API example
```bash
from lightspin_api_client.config import Config
from lightspin_api_client.logger import Logger
from lightspin_api_client.siem.siem_api import SiemApi

config = Config()
logger = Logger("siem_example").logger
siem_api = SiemApi(
    config.lightspin_url,
    config.lightspin_username,
    config.lightspin_password,
    config.lightspin_params_dict,
)
siem_results = siem_api.get_siem_results()
```

## Configuration JSON sample
```bash
{
  "log_level": "DEBUG",
  "elastic_user": "elastic",
  "elastic_password": "elastic",
  "elastic_hosts": [
    "1.2.3.4:8000"
  ],
  "lightspin_url": "https://id-123.lightspin.cloud",
  "lightspin_username": "light",
  "lightspin_password": "password1",
  "lightspin_params_dict": {
	"account_id": ["123"]
  },
  "index_name_prefix": "siem"
}
```

## Q&A
**Q: How does it speed up my work with the lightspin API?**
A: this library is taking care of authentication and paging for you so you don't have to.
It will also make sure you use the right API endpoints and body parameters.
So eventually you only to develop your own logics, and we'll take care of Lightspin's side for you. 

### Contact Us
This library is developed by the Lightspin engineering group.
For more information, contact us at support@lightspin.io.

### License
This repository is available under the [MIT License](https://github.com/lightspin-tech/lightspin-api-client/blob/main/LICENSE).