semvec/pypi-packages huggingface dataset:
mySweetCache 1.1.0
Package to fast and easy cache
Requires Python: >=3.7

# my Sweet Cache
This project let make fast and simply cache 

## autors
Bartłomiej Chwiłkowski (github: chwilko)


# Structure
mySweetCache:
    mySweetCache.py:
        main functions
    utils.py:
        other function usefull to 


## Functions 
### cache
```python3
def cache(
    MSC_name: Optional[str] = None,
    *,
    header: Optional[str] = None,
    sep_in_data: str = "",
) -> Callable:
```
Wrapper add possibility caching function result to wrapped function

If file MSC_name exist in _CACHE_FILES
  wraped function return cache from right cache.
else
  make new cache
Wrapper add optional argument 'use_cache'.
If use_cache == False
  cache will overwrite.


Args:
  MSC_name (Optional[str], optional): cache key. Defaults to None.
  header (Optional[str], optional): data description. Defaults to None.
  sep_in_data (str, optional): Separator between array items
      for text output. If "" (empty), a binary file is written,
      equivalent to file.write(a.tobytes()). Defaults to "".

Returns:
    callable: Function with cache functionality.

### read_cache
```python3
def read_cache(MSC_name: str) -> Any:
``` 
Function to fast read MSC.

Args:
    MSC_name (str): cache key to read.

Raises:
    NameError: If this cache don't exist.

Returns:
    np.array: Previously saved data.

### save_cache
```python3
save_cache(
    MSC_name: str,
    data: ndarray,
    *,
    header: Optional[str] = None,
    sep_in_data: str = "",
)
```
Function to fast save MSC.

Args:
    MSC_name (str): cache key to save.
    data (ndarray): data to save
    sep_in_data (Optional[str], optional): Separator between array items
        for text output. If "" (empty), a binary file is written,
        equivalent to file.write(a.tobytes()).

### use_par
Decorator set self argument as first function argument.
```python3
def use_par(par):
```


### use_pars
Decorator set self arguments as first function arguments.
```python3
def use_pars(*pars):
```

# How to use
```python3
example use:
  @cache("key")
  def long_working_function() -> np.ndarray:
      # long code to work
      return ...

example use 2:
  @cache("key")
  @use_parms(11, 21)
  def long_working_function(arg1, arg2) -> np.ndarray:
      # long code to work
      return ...
```

After first call this function result is saved in .MScache_files/key
In next call instead recount value will be read from cache.
To recount call `long_counting_function(use_cache=False)` then cache will be overwrited
or delete .MScache_files/try file.

WARNING!
If you define two function with the same key, there two functions will share the same cache file.



# Licence
MIT
event-delegate 1.0.0
An event class for python.
Requires Python: >=3.7

# event-delegate

 An event class for python.

## Usage

```python
from event_delegate import Event

my_event = Event()

my_event += print

my_event("hello, world!")
# output: hello, world!
```

## Documentation

### Handler signature:

```python
(*args, **kwargs) -> Any
```

> ![WARNING]
> A handler may return a value to be buffered.

### Event

#### The Event class takes no arguments.

```python
my_event = Event()
```

#### Adding a handler to an event. (can't add the same twice)

```python
my_event.add_handler(handler)
# or 
my_event += handler
```

#### Removing a handler from an event

```python
my_event.remove_handler(handler)
# or
my_event -= handler
```

#### Checking if a handler is added to the event

```python
my_event.has_handler(handler) # True or False
```

#### Invoking events

```python
my_event.invoke(arg1, arg2, kwarg1=1)
# or
my_event(arg1, arg2, kwarg1=1)
```

#### Checking buffered return values

```python
# after invoking my_event with [0,1,2,3]
my_event & any # true
my_event.get_return(sum) # 6
my_event & (any, all) # {<built-in function any>: True, <built-in function all>: False}
my_event.get_returns((all, sum)) # {<built-in function all>: False, <built-in function sum>: 6}
my_event.returns # {<built-in function any>: True, <built-in function all>: False, <built-in function sum>: 6}
```
tidy-dir 0.0.2
A package to tidy up directories using a configuration file

# tidy-dir

tidy-dir is a simple tool designed to help you clean up your directories. It provides an easy and efficient way to manage and organize your files.

## Installation

You can install tidy-dir using pip. Run the following command in your terminal:

```bash
pip install tidy-dir
```

## Usage

Using tidy-dir is straightforward. After installation, you can run the command followed by the directory you want to tidy up:

```bash
tidy-dir /path/to/your/directory/
```

For example, if you want to tidy up a directory located at /mydirectory/smt/, you would use:

```bash
tidy-dir /mydirectory/smt/
```
or current directory:
```bash
tidy-dir .
```

## Configuration

tidy-dir requires a .tidy-dir-config.json file in the directory you want to tidy up. This configuration file should follow the schema:

```json
{
  "new_dir": [".fileextension"]
}
```
In this schema, replace ".fileextension" with the file extension of the files you want to move to the new directory.
For example:
```json
{
  "docs": [".txt", ".pdf", ".docx", ".doc", ".pptx", ".ppt", ".xlsx", ".xls"],
  "images": [".png", ".jpg", ".jpeg", ".gif", ".svg"],
  "videos": [".mp4", ".mov", ".avi", ".mkv", ".wmv"],
  "music": [".mp3", ".wav", ".ogg", ".flac", ".m4a"],
  "archives": [".zip", ".rar", ".tar", ".gz", ".7z", ".iso", ".xz", ".bz2"],
}
```



## Contributing

Contributions to tidy-dir are always welcome. If you have any ideas or suggestions, feel free to open an issue or submit a pull request.

## License

tidy-dir is licensed under the (MIT license)[./LICENSE]. For more information, see the LICENSE file in our repository.