-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from kcl-lang/collectionutil-module
feat: add collectionutil module v0.0.1
- Loading branch information
Showing
3 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
## Introduction | ||
|
||
`collectionutil` is a kcl module for list and config values | ||
|
||
## How to Use | ||
|
||
+ Add the dependency | ||
|
||
```shell | ||
kpm add collectionutil | ||
``` | ||
|
||
+ Write the kcl code | ||
|
||
```python | ||
import collectionutil | ||
|
||
items = collectionutil.to_str_set(["aa", "aa", "bb"]) # ["aa", "bb"] | ||
``` | ||
|
||
## Resource | ||
|
||
Code source and document is [here](https://github.com/kcl-lang/artifacthub/tree/main/collectionutil) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[package] | ||
name = "collectionutil" | ||
version = "0.0.1" | ||
description = "`collectionutil` is a kcl module for list and config values" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
to_str_set = lambda items: [str] { | ||
[item for item in {item = None for item in items}] | ||
} |