semvec/pypi-packages huggingface dataset:
tile-operator 0.0.6
Tile Operation tool
Requires Python: >=3.8,<4.0

# tile-operator

## usage

### CLI

#### tile download

```bash
$ python to.py -v download https://tile.openstreetmap.jp/{z}/{x}/{y}.png tests/data/test.geojson 18

Tile Download

 Options:
  tile_url=https://tile.openstreetmap.jp/{z}/{x}/{y}.png
  file_path=tests/data/test.geojson
  zoom_level=18


100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 30/30 [00:05<00:00,  5.11it/s]
```

#### help

```bash
$ python to.py --help        
Usage: to.py [OPTIONS] COMMAND [ARGS]...

  Tile operator v0.0.4

Options:
  --version                 Show the version and exit.
  -v, --verbose             verbose mode
  --help                    Show this message and exit.

Commands:
  operate  Tile Operation
```

### python

- install

```bash
$ pip install tile-operator
```

```python
from tile_operator.operate import TileOperate

to = TileOperate(
    zoom_level=18,
)

tile_url = "https://tile.openstreetmap.jp/{z}/{x}/{y}.png"
to.set_tile_list()
to.download_all_tiles(tile_url)
```

## test

```bash
$ pytest -qs tests
```

## development

### setup

```bash
$ poetry config virtualenvs.in-project true
$ pyenv global 3.9 # Version 3.8 or higher will work, but 3.9 is recommended.
$ python -m venv .venv
$ source .venv/bin/activate
$ python -m pip install --upgrade pip
$ poetry install
$ poetry shell
```

### publish

```bash
$ poetry build
$ poetry publish
```
toml-env-conf 0.1.3
Environment specific application configuration with TOML
Requires Python: >=3.8,<4.0

# toml-env-conf

`pip install toml-env-conf`

A minimal library for environment-specific (dev/prod) application configuration using TOML

Useful if you want different values in some environments (local/test/prod). e.g. all environments use 
the values base_conf.toml, but you only want some values to be different when
`env == "prod"`

As easy as 
```python
import toml_env_conf

toml_env_conf.load_as_dict(path)
# or
toml_env_conf.load_as_dataclass(
    path=path,
    data_class=MyConfigType,
    env="prod"
)
```

Where the path has the following toml files
```
├── base_conf.toml
└── env_prod.toml
```

## Convention
- There ***must*** be a file named `base_conf.toml`
- For environment overrides, the file must be called `env_[name].toml`
e.g. for an environment called `prod`, the file is called `env_prod.toml`.
For an environment called `dev`, the file is called `env_dev.toml`.


## Example

### Step 1: Create some configs

`base_conf.toml`
```toml
name = "Regular name"
hobby_name = "laundry"
is_fun = false
scores = [-10, -20]
```

`env_prod.toml`
```toml
hobby_name = "music"
is_fun = true
```

### Step 2: Load em up

`main.py`
```python
from dataclasses import dataclass
from pathlib import Path
from typing import List

import toml_env_conf


@dataclass(frozen=True)  # freeze for immutability
class MyConfigType:
    name: str
    hobby_name: str
    is_fun: bool
    scores: List[int]
   
if __name__ == "__main__":
    conf_dir_path = Path(__file__).parent.joinpath("/path/to/config")
    
    config: MyConfigType = toml_env_conf.load_as_dataclass(
        conf_dir_path, MyConfigType, env="prod"
    )
    
    print(config)
```