This repository contains the complete source for wordcount (single-file Python CLI), an open-source command-line tool built with Full-stack app. Build wordcount.py, a single plain-Python file that takes one file path and prints the number of whitespace-separated words in it, using stdlib argparse so -h/--help works, usage errors exit 2, and missing/directory/u…. Everything wordcount (single-file Python CLI) needs to run is here — code, seed data, install scripts. Apache-2.0-licensed — use wordcount (single-file Python CLI) commercially, self-host it, or remix wordcount (single-file Python CLI) on cenius.ai to make it yours.
▶ Open & edit in cenius.ai — one click to an editable workspace: describe changes in plain English, get an instant preview, one-click deploy and host. Modifications made on the platform come with full rebrand & relicense rights.
Local clone? See Quick start below. cenius.ai is the zero-setup path.
▶ See it in action — full demo on the project page · MP4
- Count words in a single file
- Command-line surface: synopsis, help and argument validation
- File-access errors with a fixed exit-code contract
- Streamed reading and non-UTF-8 tolerance
- Stdlib regression script
./install.sh # installs dependencies + seeds demo dataSee INSTALL.md for full setup and usage instructions.
wordcount takes one FILE path and prints exactly one stdout line:
<path as you typed it>: <count> words
python3 wordcount.py examples/notes.txt
## examples/notes.txt: 42 wordsThe path is echoed exactly as typed — not normalised or abbreviated — so a path
with spaces, ./ prefixes or .. segments comes back the way you wrote it:
python3 wordcount.py "my notes.txt"
## my notes.txt: 4 wordsAny maximal run of non-whitespace characters. Spaces, tabs, CRLF line endings and blank lines all separate words and consecutive ones count once:
printf 'alpha beta\n\ngamma' > /tmp/spaced.txt
python3 wordcount.py /tmp/spaced.txt
## /tmp/spaced.txt: 3 wordsAccented and non-Latin words are counted whole, because the file is decoded as UTF-8 first:
python3 wordcount.py examples/phrases.txt
## examples/phrases.txt: 28 wordsAn existing but empty file is a valid, exact answer:
python3 wordcount.py examples/empty.txt
## examples/empty.txt: 0 wordspython3 wordcount.py -hprints the synopsis, a one-line description of the tool, what FILE is, and a
worked example, then exits 0.
| Status | Meaning | Example |
|---|---|---|
0 |
counted, one line on stdout | python3 wordcount.py notes.txt |
1 |
filesystem or decoding failure, one line on stderr | python3 wordcount.py missing.txt |
2 |
usage error (bad or missing argument) | python3 wordcount.py |
Full guide: USAGE.md
Open the repo and you'll find a complete Full-stack app application (23 files). Top-level layout: assets/, examples/, tests/. One command (./install.sh) covers dependency setup and demo-data seeding. See INSTALL.md for complete setup instructions.
Clone this repository and run ./install.sh, then start the app as described in INSTALL.md. wordcount (single-file Python CLI) is fully self-hostable — no external services are required to try it.
Yes — Apache-2.0-licensed, so commercial use, modification, and distribution are all permitted. Read the full terms in LICENSE.
wordcount (single-file Python CLI) runs on Full-stack app. This repo holds the full production source: you can inspect every part of it before deploying. Highlights include count words in a single file.
The easiest route: visit the project on cenius.ai, tell the platform what to change, and collect the updated build. No source-editing needed.
Yes. The MIT license lets you remove the original branding and ship under your own name. For a guided approach, remix it on cenius.ai: you get a fresh build with full rebrand and relicense rights.
Released under the Apache License 2.0 (© 2026 Cenius AI) — free for personal and commercial use. The Cenius name/logo are trademarks (see NOTICE).
Need a customized version? Remix this app on cenius.ai — modifications made on the platform come with full rebrand & relicense rights over your derivative.
This entire application — code, design, seeded demo data — was generated on cenius.ai from a plain-English description.
- 🚀 Build your own app on cenius.ai
- 🎛️ Remix wordcount (single-file Python CLI) on the marketplace — open it in a workspace, prompt for changes, and ship your own version.
More open-source apps: the Cenius-ai catalog · showcase index
