countword9897 0.1.0__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.
@@ -0,0 +1,3 @@
1
+ # Default ignored files
2
+ /shelf/
3
+ /workspace.xml
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="PYTHON_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$">
5
+ <excludeFolder url="file://$MODULE_DIR$/.venv" />
6
+ </content>
7
+ <orderEntry type="inheritedJdk" />
8
+ <orderEntry type="sourceFolder" forTests="false" />
9
+ </component>
10
+ </module>
@@ -0,0 +1,6 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <settings>
3
+ <option name="USE_PROJECT_PROFILE" value="false" />
4
+ <version value="1.0" />
5
+ </settings>
6
+ </component>
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="Black">
4
+ <option name="sdkName" value="Python 3.12 (CountWord)" />
5
+ </component>
6
+ <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.12 (CountWord)" project-jdk-type="Python SDK" />
7
+ </project>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/CountWord.iml" filepath="$PROJECT_DIR$/.idea/CountWord.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings" defaultProject="true" />
4
+ </project>
@@ -0,0 +1,51 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="AutoImportSettings">
4
+ <option name="autoReloadType" value="SELECTIVE" />
5
+ </component>
6
+ <component name="ChangeListManager">
7
+ <list default="true" id="4c42a4fc-7f9a-472c-83d2-7d46f357d79f" name="Changes" comment="" />
8
+ <option name="SHOW_DIALOG" value="false" />
9
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
10
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
11
+ <option name="LAST_RESOLUTION" value="IGNORE" />
12
+ </component>
13
+ <component name="FileTemplateManagerImpl">
14
+ <option name="RECENT_TEMPLATES">
15
+ <list>
16
+ <option value="Python Script" />
17
+ </list>
18
+ </option>
19
+ </component>
20
+ <component name="ProjectColorInfo"><![CDATA[{
21
+ "associatedIndex": 3
22
+ }]]></component>
23
+ <component name="ProjectId" id="3JKmOp2l7n4ZCqsVOkCtqWvVPmp" />
24
+ <component name="ProjectViewState">
25
+ <option name="hideEmptyMiddlePackages" value="true" />
26
+ <option name="showLibraryContents" value="true" />
27
+ </component>
28
+ <component name="PropertiesComponent"><![CDATA[{
29
+ "keyToString": {
30
+ "RunOnceActivity.ShowReadmeOnStart": "true"
31
+ }
32
+ }]]></component>
33
+ <component name="SharedIndexes">
34
+ <attachedChunks>
35
+ <set>
36
+ <option value="bundled-python-sdk-0e3be3396995-c546a90a8094-com.jetbrains.pycharm.community.sharedIndexes.bundled-PC-242.23339.19" />
37
+ </set>
38
+ </attachedChunks>
39
+ </component>
40
+ <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
41
+ <component name="TaskManager">
42
+ <task active="true" id="Default" summary="Default task">
43
+ <changelist id="4c42a4fc-7f9a-472c-83d2-7d46f357d79f" name="Changes" comment="" />
44
+ <created>1789418104483</created>
45
+ <option name="number" value="Default" />
46
+ <option name="presentableId" value="Default" />
47
+ <updated>1789418104483</updated>
48
+ </task>
49
+ <servers />
50
+ </component>
51
+ </project>
@@ -0,0 +1,12 @@
1
+ Metadata-Version: 2.5
2
+ Name: countword9897
3
+ Version: 0.1.0
4
+ Summary: Proga for counting words in files67
5
+ Requires-Python: >=3.12
6
+ Description-Content-Type: text/markdown
7
+
8
+ # CountWord
9
+ CLI tool for counting w, c and l in files
10
+
11
+ ## Usage
12
+ countword filename.txt
@@ -0,0 +1,5 @@
1
+ # CountWord
2
+ CLI tool for counting w, c and l in files
3
+
4
+ ## Usage
5
+ countword filename.txt
@@ -0,0 +1,3 @@
1
+ Hello Andrew
2
+ This is my CLI
3
+ I hope you like my work
@@ -0,0 +1,16 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "countword9897"
7
+ version = "0.1.0"
8
+ description = "Proga for counting words in files67"
9
+ readme = "README.md"
10
+ requires-python = ">=3.12"
11
+
12
+ [project.scripts]
13
+ countword = "countword.cli:main"
14
+
15
+ [tool.hatch.build.targets.wheel]
16
+ packages = ["src/countword"]
File without changes
@@ -0,0 +1,28 @@
1
+ from pathlib import Path
2
+ import argparse
3
+
4
+ def counter6(file_path: str) -> dict:
5
+ path = Path(file_path)
6
+ text = path.read_text(encoding = "utf-8")
7
+
8
+ return {"words": len(text.split()), "char": len(text), "lines": len(text.splitlines()),
9
+ }
10
+
11
+ def main():
12
+ parser = argparse.ArgumentParser(
13
+ description = "Count w, c and l in file"
14
+ )
15
+
16
+ parser.add_argument("file",
17
+ help = "Path to file"
18
+ )
19
+
20
+ args = parser.parse_args()
21
+ ans = counter6(args.file)
22
+ print(f"File: {args.file}")
23
+ print(f"Words: {ans['words']}")
24
+ print(f"Characters: {ans['char']}")
25
+ print(f"Lines: {ans['lines']}")
26
+
27
+ if __name__ == "__main__":
28
+ main()