semvec/pypi-packages huggingface dataset:
file-system-py 0.0.11
All-in-one file manipulation
License: MIT
Requires Python: >=3.6

# What is this?

An work-in-progress library for file manipulation in python. <br>
(E.g. I was tired of copy-pasting my giant tool into each project)

# How do I use this?

`pip install file-system-py`


```python
import file_system_py as FS


*folders, name, extension = FS.path_pieces("/this/is/a/filepath.txt")
# folder[0] == '/' for absolute paths

FS.remove("./a folder")
FS.remove("./a file")
# 1. no error if they dont exist
# 2. doesnt care if file or folder

FS.extname("./thing/thing.stuff.blah.py")
# returns ".py"

# different ways to list
FS.list_paths_in("./thing/things")
FS.list_basenames_in("./thing/things")
FS.list_file_paths_in("./thing/things")
FS.list_folder_paths_in("./thing/things")
# returns [] when path doesnt exist or is a file

# much faster iterative versions
FS.iterate_paths_in(path)
FS.iterate_basenames_in(path)
FS.iterate_file_paths_in(path)
FS.iterate_folder_paths_in(path)


# 
# full api
# 
FS.walk_up_until(file_to_find, start_path=get_cwd())
FS.ensure_is_folder(path, force=True)
FS.ensure_is_file(path, force=True)
FS.make_relative_path(to=, coming_from=get_cwd())
FS.make_absolute_path(to, coming_from=get_cwd())
FS.move(item, to=, new_name=, force=True)
FS.copy(item, to=, new_name=, force=True)
FS.write(data, to=, force=True)
FS.is_folder(path)
FS.is_file(path)
FS.read(filepath)
FS.remove(path)
FS.exists(path)
FS.ls(path=".")
FS.list_paths_in(path)
FS.list_basenames_in(path)
FS.list_file_paths_in(path)
FS.list_folder_paths_in(path)
FS.iterate_paths_in(path)
FS.iterate_basenames_in(path)
FS.iterate_file_paths_in(path)
FS.iterate_folder_paths_in(path)
FS.glob(path)
FS.touch(path)
FS.touch_dir(path)
FS.parent_folder(path)
FS.basename(path)
FS.name(path)
FS.extname(path)
FS.path_pieces(path)
FS.join(*paths)
FS.is_absolute_path(path)
FS.is_relative_path(path)
FS.get_cwd()
FS.local_path(*paths)
```
methodflow 0.0.1a1
A lightweight library for building pipelines from methods
License: MIT

[![ReadTheDocs](https://readthedocs.org/projects/methodflow/badge/?version=latest)](https://methodflow.readthedocs.io/en/stable/)
[![PyPI-Server](https://img.shields.io/pypi/v/methodflow.svg)](https://pypi.org/project/methodflow/)

# methodflow

> A lightweight library for building pipelines from methods
badger-voter-sdk 0.1.3
Shared code for badger autovoters
License: MIT
Requires Python: >=3.7,<4
Keywords: badger-voter-sdk

# Badger SDK for autovoters

This is the library for shared code that is used in autovoters, such as cvx autovoter and aura autovoter

| Build  | Coverage | PYPI | 
| ------------- | ------------- | ------------- |
| [![Tests](https://github.com/Badger-Finance/badger-voter-sdk/actions/workflows/test.yml/badge.svg)](https://github.com/Badger-Finance/badger-voter-sdk/actions/workflows/test.yml) | [![codecov](https://codecov.io/gh/Badger-Finance/badger-voter-sdk/branch/main/graph/badge.svg?token=UYLO67O4Q9)](https://codecov.io/gh/Badger-Finance/badger-voter-sdk)  | [![PyPI version](https://badge.fury.io/py/badger-voter-sdk.svg)](https://badge.fury.io/py/badger-voter-sdk) |


## List of functional modules:

## Utilities

--- 

### Get web3 instance

```python
import os
from badger_voter_sdk.web3 import get_web3

web3 = get_web3(os.getenv("ETHNODEURL"))
```
Or web3 will be created from default secrets in `constants.py`


### AWS get secret
Getting secret from AWS by id and key

```python
from badger_voter_sdk.aws import get_secret

secret = get_secret(secret_id="SecretId", secret_key="SecretKey")
```


### Json logger
Preconfigured json logger to be shared across voting bots projects

```python
from badger_voter_sdk.json_logger import logger

logger.info()
```

## Snapshot and data collectors

### Get all voters for snapshot

```python
from badger_voter_sdk.collectors.snapshot_collectors import get_voters

voters = get_voters(snapshot_id="some_snapshot_id")
```

### Get vlTOKEN amounts per wallet voted for given snapshot round

```python
from badger_voter_sdk.collectors.api_collectors import get_scores

scores = get_scores(
    "aurafinance.eth", "1", "<SNAPSHOT_ID>",
    ["<ADDRESS1>"],
    [{'name': "erc20-votes", 'network': "1", 'params': {
        'symbol': "<vlTOKEN>", 'address': "<STRATEGY_ADDR>"}}]
)
```

### Get voting choices with voting power
You need to combine two previous functions outputs:

```python
from badger_voter_sdk.collectors.data_processors import extract_voting_power_per_pool

choices_with_votes = extract_voting_power_per_pool(voters={"<wallet>": {"1": 123}}, scores={"<wallet>": 123333.1})
```