semvec/pypi-packages huggingface dataset:
finder-in-files 0.1.0
Search for a string in all possible files in the directory.
Requires Python: >3.6

# Finder-in-files
**This script searches for a specific string across all files in the directory you specified**
## Supported file formats for searching
- txt
- log
- html
- css
- cpp
- h
- js
- py
- c
### Special formats
- doc
- docx
- otd
- rtf  (May not work on Windows)
- pdf  (May not work on Windows)

## Documentation

### Installation

```
pip install colorama
```

### Import
To import a module into your code use:
```
import finder_in_files as finder
```
### Usage
To find a line in files in a directory, use:
```
finder.search(catalog_name, find_str, settings_files=DEFAULT_SETTINGS_FILES)
```
`catalog_name` - The name of the directory where the search should be performed.

`find_str` - Search string.

`settings_files` - Setting file extensions (enable / disable).

`DEFAULT_SETTINGS_FILES` -
 
 ```
DEFAULT_SETTINGS_FILES = {
        'txt': True,
        'log': True,
        'html': True,
        'css': True,
        'cpp': True,
        'h': True,
        'py': True,
        'c': True,
        'doc': True,
        'docx': True,
        'rtf': True,
        'odt': True,
        'pdf': True
}
```
The search is performed on the lines of the file. If `find_str` is more than 89% similar to a line in the file, the line is considered found.

The `search` function returns a tuple (name_file, numbers_str numbers_repeat).

`name_file` - The path to the file where `find_str` was found.

`numbers_str` - Returned as a list that consists of the lines where `find_str` was found.

`numbers_repeat` - The number of times to repeat `find_str` in the file. Returned in int format.

## Example
An example where all of this is used together.

```
try:
                results = finder_in_files.search(catalog_name, find_str, self.settings_files)
                if not results:  # If nothing was found, then
                    print('\nThe text was not found. ;(\n')
                else:
                    for name_file, numbers_str, numbers_repeat in results:  # We unpack the tuple using for.
                        print(f"\nPath to the file: {name_file}")
                        print(f'Content lines: {str(numbers_str).replace(",", " |")}')
                        print(f"String repetitions: {numbers_repeat}\n")
            except FileNotFoundError:  # print('\nError! You entered an invalid file path.')  
            # An exception if the path (catalog_name) was not specified correctly.
```

More examples on [GitHub](https://github.com/vander00/Finder-in-files).
outcome-read-toml 2.1.1
A small utility to read keys from TOML files.
Requires Python: >=3.8.5,<4.0.0

# read-toml-py
![Continuous Integration](https://github.com/outcome-co/read-toml-py/workflows/Continuous%20Integration/badge.svg) ![version-badge](https://img.shields.io/badge/version-2.1.1-brightgreen)

A small utility to read keys from TOML files.

## Usage

### Installation

```sh
poetry add outcome-read-toml
```

### Usage

The utility reads the value specified by the key from the provided TOML file, and prints it to stdout.

The path parameter should be a '.' separated sequences of keys that correspond to a path in the TOML structure.

Example TOML file:

```toml
title = "My TOML file"

[info]
version = "1.0.1"

[tools.poetry]
version = "1.1.2"
files = ['a.py', 'b.py']
```

Read standard keys:

```sh
read-toml --path my_file.toml --key title 
# "My TOML file"

read-toml --path my_file.toml --key info.version
# "1.0.1"
```

Read arrays:

```sh
read-toml --path my_file.toml --key tools.poetry.files
# "a.py b.py"

read-toml --path my_file.toml[0] --key tools.poetry.files
# "a.py"
```

You can't read non-leaf keys:

```sh
read_toml.py --path my_file.toml --key tools
# KeyError
```

You can check if a key exists:

```sh
read-toml --path my_file.toml --key title --check-only 
# 1

read-toml --path my_file.toml --key unknown_key --check-only
# 0
```

## Development

Remember to run `./pre-commit.sh` when you clone the repository.
pyenvconfig 0.1.0
Simple environment variable configuration for Python
Keywords: environment-variables env-var configuration

# envconfig

![](https://github.com/makramkd/envconfig/workflows/envconfig%20Python%20package/badge.svg)

`envconfig` is a simple but effective way to configure your Python application through environment variables.

Inspired by [kelseyhightower/envconfig](https://github.com/kelseyhightower/envconfig).

Features:
* Extremely simple setup,
* Zero third-party dependencies,
* Well tested,
* Well documented,
* Fun to use ;)

## Quickstart

```python
import envconfig

class Config:
  # Declare two config variables with type string.
  aws_access_key_id: str
  aws_secret_access_key: str

  # Provide a default - envconfig uses the type that the attribute is initialized with
  # so you don't need to repeat yourself.
  aws_region = 'us-east-1'

  # HTTP config
  num_retries = 15
  retry_strategy: str
  timeout: int = 15  # seconds

# Create an instance of your config object and let envconfig process it!
config = Config()
envconfig.process(config)

# Access class attributes
aws_client = Client(
  access_key_id=config.aws_access_key_id,
  secret_access_key=config.aws_secret_access_key,
  region=config.aws_region,
)
```

## Development

### Cloning and Building

`envconfig` is written in Python 3.6 and is tested on Python 3.6 and above.

Simply check out the repository, create a `virtualenv`, and go to town!

```bash
git clone https://github.com/makramkd/envconfig  # or git@github.com:makramkd/envconfig.git if you prefer
cd envconfig
pyenv local 3.6.3  # ensure python 3.6
python -m venv .venv  # create venv
source .venv/bin/activate
pip install -r test_requirements.txt  # for coverage, flake8
```

You can install `envconfig` in your virtual environment by running:

```bash
python setup.py install
```

### Running unit tests and linter

All unit tests are built using the `unittest` module from the standard library.

```bash
python -m unittest discover tests/
```

Or, if you want a coverage report:

```bash
coverage run -m unittest discover tests
coverage report  # show coverage report on stdout
coverage html && open htmlcov/index.html  # show interactive coverage report in the browser
```

To run the linter:

```bash
./run_linter.sh
```

### Contributions

Contributing is easy. Create a pull request, add tests, and get it approved!