semvec/pypi-packages huggingface dataset:
htsg 1.0.0
Another SSG
License: MIT

# htsg - another SSG
"htsg" is a minimal SSG (Static Site Generator).  
This helps creating PURE HTML sites.

## Requirements
- Python3 (3.6+)

## Install

```
pip install htsg
```

## Usage
Here is a brief explanation. Also read the source.

### Example
visit [example](example)

### Generate site
Run in shell:

```
htsg
```

Run `htsg -h` to show more options.

Or, you can use in Python script:

```
import htsg

astdir = "./assets"
tpldir = "./templates"
distdir = "./dist"
cfgfile = "./config.toml"

htsg.generate(astdir, tpldir, distdir, cfgfile)
```

### Run development server
For developping, htsg has HTTP server. It watches files and regenerates site when sources changed.  
Run in shell:

```
htsg -s
```

Run `htsg -h` to show more options.

Or, in Python script:

```
import htsg

host = "0.0.0.0"
port = 8000
astdir = "./assets"
tpldir = "./templates"
distdir = "./dist"
cfgfile = "./config.toml"

htsg.serve(host, port, astdir, tpldir, distdir, cfgfile)
```

## Release note
### [v1.0.0](https://github.com/laddge/htsg/releases/tag/v1.0.0) (2022/05/13)
Initial release

## License
This project is under the MIT-License.  
See also [LICENSE](LICENSE).

## Author
Laddge
log-indented 0.4.5
log-indented gives you human-friendly logs.
License: MIT
Requires Python: >=3.9


[![Support Ukraine Badge](https://bit.ly/support-ukraine-now)](https://github.com/support-ukraine/support-ukraine#support-financially)

# log-indented

[![Python Package](https://github.com/markmark206/log-indented/actions/workflows/python-publish.yml/badge.svg)](https://github.com/markmark206/log-indented/actions/workflows/python-publish.yml)


This package helps you and your code produce indented, human-friendly, easy to understand logs.


Executing `count_barnyard_animals()` in this code example:

```python
from log_indented import logged, log_info

@logged(logger)
def count_chicken() -> int:
    return 3


@logged(logger)
def count_ducks() -> int:
    return 7


@logged(logger)
def count_birds() -> int:
    return count_chicken() + count_ducks()


@logged(logger)
def count_goats() -> int:
    return 7


@logged(logger)
def count_sheep() -> int:
    return 0


@logged(logger)
def count_barnyard_animals() -> int:
    total_animal_count: int = count_birds() + count_goats() + count_sheep()
    log_info(f"total barnyard animals: {total_animal_count}")
    return total_animal_count
```

will produce output similar to this:

```
    + count_barnyard_animals: enter
        + count_birds: enter
            + count_chicken: enter
            - count_chicken: exit. took 0.00 ms.
            + count_ducks: enter
            - count_ducks: exit. took 0.00 ms.
        - count_birds: exit. took 0.07 ms.
        + count_goats: enter
        - count_goats: exit. took 0.00 ms.
        + count_sheep: enter
        - count_sheep: exit. took 0.00 ms.
      count_barnyard_animals: total barnyard animals: 17
    - count_barnyard_animals: exit. took 0.18 ms.
```
wcpan.drive.cli 2.1.0
command line tool for wcpan.drive
License: MIT
Requires Python: >=3.9

# wcpan.drive.cli

Command line tool for `wcpan.drive`.

This package needs a driver to actually work with a cloud drive.

## Config

You will need a `core.yaml` file in **config path**.
By default it is `$HOME/.config/wcpan.drive`, but you can change it by
`--config-prefix` flag.

```sh
python3 -m wcpan.drive.cli --config-prefix=/path/to/config ...
```

Here is an example of `core.yaml`:

```yaml
version: 1
database: nodes.sqlite
driver: wcpan.drive.google.driver.GoogleDriver
middleware: []
```

## Command Line Usage

Get the latest help:

```sh
python3 -m wcpan.drive.cli -h
```

You need to authorize an user first.

```sh
python3 -m wcpan.drive.cli auth
```

Then you should build local cache.
Many commands reliy on this cache to avoid making too many API requests.

Note that this is the **ONLY** command that will update the cache.
Which means after `upload`, `mkdir`, `remove`, `rename`, you need to run this
command to make the cache up-to-date.

```sh
python3 -m wcpan.drive.cli sync
```

The `remove` command only put files to trash can, it does **NOT** permanently
remove **ANY** files.
Removing a folder will also remove all its descendants.

```
python3 -m wcpan.drive.cli remove file1 file2 ...
```
wcpan.drive.core 3.1.0
asynchronous generic cloud drive library
License: MIT
Requires Python: >=3.9

# wcpan.drive

Asynchronous generic cloud drive library.

This package needs a driver to actually work with a cloud drive.

## Example Usage

```python
from wcpan.drive.core.drive import (
    DriveFactory, download_to_local, upload_from_local,
)


async def simple_demo():
    # Load config and data from default locations.
    factory = DriveFactory()
    factory.load_config()

    async with factory() as drive:
        # Check for authorization.
        if not await drive.is_authorized():
            # Start OAuth 2.0 process
            url = await drive.get_oauth_url()
            # ... The user visits the url ...
            # Get tokens from the user.
            token = ...
            # Finish OAuth 2.0 process.
            await drive.set_oauth_token(token)

        # It is important to keep cache in sync.
        async for change in drive.sync():
            print(change)

        # Get the root node.
        root_node = await drive.get_root_node()

        # Get a node.
        node = await drive.get_node_by_path('/path/to/drive/file')

        # List children.
        children = await drive.get_children(root_node)

        # Make a folder.
        new_folder = await drive.create_folder(root_node, 'folder_name')

        # Download file.
        await download_to_local(drive, node, '/tmp')

        # Upload file.
        new_file = await upload_from_local(drive, root_node, '/path/to/local/file')

        # Traverse drive.
        async for root, folders, files in drive.walk(root_node):
            print(root, folders, files)


async def config_demo():
    factory = DriveFactory()

    # Read config files from here.
    # The default is $HOME/.config/wcpan.drive.
    # These files are what you want to keep and backup.
    factory.config_path = '/tmp/config'

    # Put generated files here.
    # The default is $HOME/.local/share/wcpan.drive.
    # These files should be safely deleted.
    factory.data_path = '/tmp/data'

    # Setup cache database, will write to data folder.
    factory.database = 'nodes.sqlite'

    # Setup driver class.
    factory.driver = 'some.random.driver.RandomDriver'

    # load config file from config folder
    # this will not overwrite the above given values
    factory.load_config()
```