# env_gen


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## Reading Settings

------------------------------------------------------------------------

### read_settings

``` python

def read_settings(
    path:str, # Path to settings.ini file
)->configparser.ConfigParser: # Configured ConfigParser object

```

*Read settings.ini file with percent-style interpolation.*

------------------------------------------------------------------------

### get_section

``` python

def get_section(
    cp:configparser.ConfigParser, # ConfigParser object
):

```

*Get configuration section from ConfigParser. nbdev puts keys at
top-level (DEFAULT). Falls back to first section if present.*

## Utility Functions

------------------------------------------------------------------------

### split_list

``` python

def split_list(
    val:str=None, # String value to split (can be None)
)->List[str]: # List of unique, non-empty strings preserving order

```

*Split space- and/or comma-separated lists while respecting quotes.*

------------------------------------------------------------------------

### normalize_python_spec

``` python

def normalize_python_spec(
    min_py:str=None, # Minimum Python version string
)->str: # Normalized Python specification string or None

```

*Normalize Python version specification for conda. Accepts “\>=3.10”,
“3.10”, “3.9.*”, etc. If bare like “3.10”, makes it “\>=3.10”.\*

## Configuration Collection

------------------------------------------------------------------------

### collect_values

``` python

def collect_values(
    cfg, # Configuration section dictionary - TODO: Add type hint
)->Tuple[str, List[str], List[str], List[str], List[str]]: # Tuple of (env_name, channels, conda_reqs, pip_reqs, dev_pip_reqs)

```

*Collect configuration values from settings.*

## YAML Generation

------------------------------------------------------------------------

### emit_yaml

``` python

def emit_yaml(
    name:str, # Environment name
    channels:List[str], # List of conda channels
    conda_deps:List[str], # List of conda dependencies
    pip_lines:List[str], # List of pip packages
)->str: # YAML formatted string

```

*Generate environment.yml content. Manual YAML emitter to avoid extra
dependencies.*

## CLI Interface

------------------------------------------------------------------------

### main

``` python

def main(
    
):

```

*Generate environment.yml from nbdev settings.ini.*

Reads: lib_name, min_python, conda_channels, conda_requirements,
requirements, dev_requirements (all optional). Writes: environment.yml
(or stdout). Adds an editable pip install (-e “.\[EXTRAS\]”) by default.

Examples: python gen_env_from_settings.py python
gen_env_from_settings.py –name myproj-dev –extras dev,docs –out env.yml
python gen_env_from_settings.py –no-editable –stdout python
gen_env_from_settings.py –no-include-pip-reqs
