quickkit-tools 0.1.0__tar.gz → 0.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quickkit-tools
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: A small collection of text utilities with a command-line interface
5
5
  Author: Package Author
6
6
  License-Expression: MIT
@@ -66,3 +66,5 @@ python -m twine upload dist/*
66
66
  ```
67
67
 
68
68
  The name `quickkit-tools` is an example and may already be taken on PyPI.
69
+
70
+ Get the library version with `quickkit version` or `quickkit_tools.version_library()`.
@@ -52,3 +52,5 @@ python -m twine upload dist/*
52
52
  ```
53
53
 
54
54
  The name `quickkit-tools` is an example and may already be taken on PyPI.
55
+
56
+ Get the library version with `quickkit version` or `quickkit_tools.version_library()`.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "quickkit-tools"
7
- version = "0.1.0"
7
+ version = "0.1.2"
8
8
  description = "A small collection of text utilities with a command-line interface"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -0,0 +1,5 @@
1
+ """Simple text utilities."""
2
+ from .text import slugify, word_count, reverse_text, version_library
3
+
4
+ __all__ = ["slugify", "word_count", "reverse_text", "version_library"]
5
+ __version__ = "0.1.1"
@@ -1,14 +1,16 @@
1
1
  """Command-line entry point."""
2
2
  import argparse
3
- from .text import slugify, word_count, reverse_text
3
+ from .text import slugify, word_count, reverse_text,version_library
4
4
 
5
5
 
6
6
  def main() -> None:
7
7
  parser = argparse.ArgumentParser(prog="quickkit", description="Simple text utilities")
8
- parser.add_argument("action", choices=["slugify", "count", "reverse"])
9
- parser.add_argument("text", help="Text to process")
8
+ parser.add_argument("action", choices=["slugify", "count", "reverse", "version"])
9
+ parser.add_argument("text", nargs="?", help="Text to process (not needed for version)")
10
10
  args = parser.parse_args()
11
- result = {"slugify": slugify, "count": word_count, "reverse": reverse_text}[args.action](args.text)
11
+ if args.action != "version" and args.text is None:
12
+ parser.error("text is required for this action")
13
+ result = {"slugify": slugify, "count": word_count, "reverse": reverse_text, "version": version_library}[args.action](args.text or "")
12
14
  print(result)
13
15
 
14
16
 
@@ -17,3 +17,8 @@ def word_count(value: str) -> int:
17
17
  def reverse_text(value: str) -> str:
18
18
  """Reverse a string."""
19
19
  return value[::-1]
20
+
21
+ def version_library(value: str = "") -> str:
22
+ """Return the installed quickkit-tools package version."""
23
+ from . import __version__
24
+ return __version__
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quickkit-tools
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: A small collection of text utilities with a command-line interface
5
5
  Author: Package Author
6
6
  License-Expression: MIT
@@ -66,3 +66,5 @@ python -m twine upload dist/*
66
66
  ```
67
67
 
68
68
  The name `quickkit-tools` is an example and may already be taken on PyPI.
69
+
70
+ Get the library version with `quickkit version` or `quickkit_tools.version_library()`.
@@ -12,3 +12,8 @@ def test_word_count():
12
12
 
13
13
  def test_reverse():
14
14
  assert reverse_text("abc") == "cba"
15
+
16
+
17
+ def test_version_library():
18
+ from quickkit_tools import version_library, __version__
19
+ assert version_library() == __version__
@@ -1,5 +0,0 @@
1
- """Simple text utilities."""
2
- from .text import slugify, word_count, reverse_text
3
-
4
- __all__ = ["slugify", "word_count", "reverse_text"]
5
- __version__ = "0.1.0"
File without changes
File without changes