diff options
author | CoprDistGit <infra@openeuler.org> | 2023-05-05 10:40:08 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-05-05 10:40:08 +0000 |
commit | 1040e21de39b0523defc9fbc01cb052455a7a4e4 (patch) | |
tree | 0c9d6b05d8d0f9381836708ac7598d313c7dc004 | |
parent | f32821d343edef458e4030d84141891148026f19 (diff) |
automatic import of python-case-converteropeneuler20.03
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-case-converter.spec | 543 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 545 insertions, 0 deletions
@@ -0,0 +1 @@ +/case-converter-1.1.0.tar.gz diff --git a/python-case-converter.spec b/python-case-converter.spec new file mode 100644 index 0000000..b098def --- /dev/null +++ b/python-case-converter.spec @@ -0,0 +1,543 @@ +%global _empty_manifest_terminate_build 0 +Name: python-case-converter +Version: 1.1.0 +Release: 1 +Summary: A string case conversion package. +License: MIT License +URL: https://github.com/chrisdoherty4/python-case-converter +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/76/d9/48a4f2bb0dbea1086836a25b64ba77f5ab23652a12f45d9bbd2fe3f13d35/case-converter-1.1.0.tar.gz +BuildArch: noarch + + +%description +# Case Converter + +[](https://gitlab.com/chrisdoherty4/python-case-converter/-/pipelines) [](https://pypi.org/project/case-converter/)   + +A robust python package for transforming string cases such as `Hello, world!` into + `helloWorld` (camelcase). + +## General usage + +```python +from caseconverter import camelcase + +camelcase("Hello, world!") # output: helloWorld +``` + +### Delimeter behavior + +If multiple delimeter characters are identified next to eachother they will be considered as a single delimeter. For example, `-_` contains 2 different delimeter characters and is considered a single delimeter. + +## Available conversions + +### `camelcase` + +```python +from caseconverter import camelcase + +camelcase("Hello, world!") +``` + +```text +helloWorld +``` + +### `cobolcase` + +```python +from caseconverter import cobolcase + +cobolcase("Hello, world!") +``` + +```text +HELLO-WORLD +``` + +### `flatcase` + +```python +from caseconverter import flatcase + +flatcase("Hello, world!") +``` + +```text +helloworld +``` + +### `kebabcase` + +```python + +from caseconverter import kebabcase + +kebabcase("Hello, world!") +``` + +```text +hello-world +``` + +### `macrocase` + +```python +from caseconverter import macrocase + +macrocase("Hello, world!") +``` + +```text +HELLO_WORLD +``` + +#### Additional options + +`delims_only : bool` - Only consider delimiters as boundaries (default: `False`). + +### `pascalcase` + +```python +from caseconverter import pascalcase + +pascalcase("Hello, world!") +``` + +```text +HelloWorld +``` + +### `snakecase` + +```python +from caseconverter import snakecase + +snakecase("Hello, world!") +``` + +```text +hello_world +``` + +## Options for all conversions + +### Stripping punctuation + +Punctuation is stripped when doing a case conversion. However, should you +wish to keep the punctuation you can do so by passing `strip_punctuation=False`. + +```python +camelcase("Hello, world!", strip_punctuation=False) # output: hello,World! +``` + +### Delimeter customization + +Default delimiters used to denote a token boundary. + +```python +DELIMITERS = " -_" +``` + +You can pass `delims` to each case conversion function to specify a custom +set of delimiters. + +```python +# Use a pipe `|` as the only delimiter. +camelcase("Hello,|world!", delims="|") # output: helloWorld +``` + + +## Boundaries definitions + +|Name|Description| +|---|---| +|OnDelimeterUppercaseNext|On a delimieter, upper case the following character| +|OnDelimeterLowercaseNext|On a delimeter, lower case the following character| +|OnUpperPrecededByLowerAppendUpper|On an upper case character followed by a lower case character, append the upper case character| +|OnUpperPrecededByLowerAppendLower|On an upper case character preceeded by a lower case character append the lower case character| +|OnUpperPrecededByUpperAppendJoin|On an upper case caharacter preceeded by an upper append the join character. Join characters are context dependent. Example: macro cast join character is `_`| +|OnUpperPrecededByUpperAppendCurrent|On an upper case character preceeded by an upper case character append the upper case character| + +## Contributing + +1. Write clean code. +2. Write new tests for new use-cases. +3. Test your code before raising a PR. +4. Use [black](https://pypi.org/project/black/) to format your code. + + + + +%package -n python3-case-converter +Summary: A string case conversion package. +Provides: python-case-converter +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-case-converter +# Case Converter + +[](https://gitlab.com/chrisdoherty4/python-case-converter/-/pipelines) [](https://pypi.org/project/case-converter/)   + +A robust python package for transforming string cases such as `Hello, world!` into + `helloWorld` (camelcase). + +## General usage + +```python +from caseconverter import camelcase + +camelcase("Hello, world!") # output: helloWorld +``` + +### Delimeter behavior + +If multiple delimeter characters are identified next to eachother they will be considered as a single delimeter. For example, `-_` contains 2 different delimeter characters and is considered a single delimeter. + +## Available conversions + +### `camelcase` + +```python +from caseconverter import camelcase + +camelcase("Hello, world!") +``` + +```text +helloWorld +``` + +### `cobolcase` + +```python +from caseconverter import cobolcase + +cobolcase("Hello, world!") +``` + +```text +HELLO-WORLD +``` + +### `flatcase` + +```python +from caseconverter import flatcase + +flatcase("Hello, world!") +``` + +```text +helloworld +``` + +### `kebabcase` + +```python + +from caseconverter import kebabcase + +kebabcase("Hello, world!") +``` + +```text +hello-world +``` + +### `macrocase` + +```python +from caseconverter import macrocase + +macrocase("Hello, world!") +``` + +```text +HELLO_WORLD +``` + +#### Additional options + +`delims_only : bool` - Only consider delimiters as boundaries (default: `False`). + +### `pascalcase` + +```python +from caseconverter import pascalcase + +pascalcase("Hello, world!") +``` + +```text +HelloWorld +``` + +### `snakecase` + +```python +from caseconverter import snakecase + +snakecase("Hello, world!") +``` + +```text +hello_world +``` + +## Options for all conversions + +### Stripping punctuation + +Punctuation is stripped when doing a case conversion. However, should you +wish to keep the punctuation you can do so by passing `strip_punctuation=False`. + +```python +camelcase("Hello, world!", strip_punctuation=False) # output: hello,World! +``` + +### Delimeter customization + +Default delimiters used to denote a token boundary. + +```python +DELIMITERS = " -_" +``` + +You can pass `delims` to each case conversion function to specify a custom +set of delimiters. + +```python +# Use a pipe `|` as the only delimiter. +camelcase("Hello,|world!", delims="|") # output: helloWorld +``` + + +## Boundaries definitions + +|Name|Description| +|---|---| +|OnDelimeterUppercaseNext|On a delimieter, upper case the following character| +|OnDelimeterLowercaseNext|On a delimeter, lower case the following character| +|OnUpperPrecededByLowerAppendUpper|On an upper case character followed by a lower case character, append the upper case character| +|OnUpperPrecededByLowerAppendLower|On an upper case character preceeded by a lower case character append the lower case character| +|OnUpperPrecededByUpperAppendJoin|On an upper case caharacter preceeded by an upper append the join character. Join characters are context dependent. Example: macro cast join character is `_`| +|OnUpperPrecededByUpperAppendCurrent|On an upper case character preceeded by an upper case character append the upper case character| + +## Contributing + +1. Write clean code. +2. Write new tests for new use-cases. +3. Test your code before raising a PR. +4. Use [black](https://pypi.org/project/black/) to format your code. + + + + +%package help +Summary: Development documents and examples for case-converter +Provides: python3-case-converter-doc +%description help +# Case Converter + +[](https://gitlab.com/chrisdoherty4/python-case-converter/-/pipelines) [](https://pypi.org/project/case-converter/)   + +A robust python package for transforming string cases such as `Hello, world!` into + `helloWorld` (camelcase). + +## General usage + +```python +from caseconverter import camelcase + +camelcase("Hello, world!") # output: helloWorld +``` + +### Delimeter behavior + +If multiple delimeter characters are identified next to eachother they will be considered as a single delimeter. For example, `-_` contains 2 different delimeter characters and is considered a single delimeter. + +## Available conversions + +### `camelcase` + +```python +from caseconverter import camelcase + +camelcase("Hello, world!") +``` + +```text +helloWorld +``` + +### `cobolcase` + +```python +from caseconverter import cobolcase + +cobolcase("Hello, world!") +``` + +```text +HELLO-WORLD +``` + +### `flatcase` + +```python +from caseconverter import flatcase + +flatcase("Hello, world!") +``` + +```text +helloworld +``` + +### `kebabcase` + +```python + +from caseconverter import kebabcase + +kebabcase("Hello, world!") +``` + +```text +hello-world +``` + +### `macrocase` + +```python +from caseconverter import macrocase + +macrocase("Hello, world!") +``` + +```text +HELLO_WORLD +``` + +#### Additional options + +`delims_only : bool` - Only consider delimiters as boundaries (default: `False`). + +### `pascalcase` + +```python +from caseconverter import pascalcase + +pascalcase("Hello, world!") +``` + +```text +HelloWorld +``` + +### `snakecase` + +```python +from caseconverter import snakecase + +snakecase("Hello, world!") +``` + +```text +hello_world +``` + +## Options for all conversions + +### Stripping punctuation + +Punctuation is stripped when doing a case conversion. However, should you +wish to keep the punctuation you can do so by passing `strip_punctuation=False`. + +```python +camelcase("Hello, world!", strip_punctuation=False) # output: hello,World! +``` + +### Delimeter customization + +Default delimiters used to denote a token boundary. + +```python +DELIMITERS = " -_" +``` + +You can pass `delims` to each case conversion function to specify a custom +set of delimiters. + +```python +# Use a pipe `|` as the only delimiter. +camelcase("Hello,|world!", delims="|") # output: helloWorld +``` + + +## Boundaries definitions + +|Name|Description| +|---|---| +|OnDelimeterUppercaseNext|On a delimieter, upper case the following character| +|OnDelimeterLowercaseNext|On a delimeter, lower case the following character| +|OnUpperPrecededByLowerAppendUpper|On an upper case character followed by a lower case character, append the upper case character| +|OnUpperPrecededByLowerAppendLower|On an upper case character preceeded by a lower case character append the lower case character| +|OnUpperPrecededByUpperAppendJoin|On an upper case caharacter preceeded by an upper append the join character. Join characters are context dependent. Example: macro cast join character is `_`| +|OnUpperPrecededByUpperAppendCurrent|On an upper case character preceeded by an upper case character append the upper case character| + +## Contributing + +1. Write clean code. +2. Write new tests for new use-cases. +3. Test your code before raising a PR. +4. Use [black](https://pypi.org/project/black/) to format your code. + + + + +%prep +%autosetup -n case-converter-1.1.0 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-case-converter -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Fri May 05 2023 Python_Bot <Python_Bot@openeuler.org> - 1.1.0-1 +- Package Spec generated @@ -0,0 +1 @@ +bf3c3631c3d1db44a46ee589a52ad2d7 case-converter-1.1.0.tar.gz |