Skip to content

Repository files navigation

wordcount (single-file Python CLI) — complete Full-stack app command-line tool example app

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.

License: Apache 2.0 Stack Built with cenius.ai

Open in cenius.ai

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.

Demo

wordcount (single-file Python CLI) demo — command-line tool built with Full-stack app

See it in action — full demo on the project page · MP4

Features

  • 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

Quick start

./install.sh   # installs dependencies + seeds demo data

See INSTALL.md for full setup and usage instructions.

Usage guide

wordcount takes one FILE path and prints exactly one stdout line:

<path as you typed it>: <count> words

Count a file

python3 wordcount.py examples/notes.txt
## examples/notes.txt: 42 words

The 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 words

What counts as a word

Any 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 words

Accented 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 words

An existing but empty file is a valid, exact answer:

python3 wordcount.py examples/empty.txt
## examples/empty.txt: 0 words

Read the built-in help

python3 wordcount.py -h

prints the synopsis, a one-line description of the tool, what FILE is, and a worked example, then exits 0.

Exit statuses — for scripts

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

Architecture

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.

FAQ

Can I deploy wordcount (single-file Python CLI) on my own infrastructure?

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.

Is wordcount (single-file Python CLI) free for commercial use?

Yes — Apache-2.0-licensed, so commercial use, modification, and distribution are all permitted. Read the full terms in LICENSE.

Which framework or language does wordcount (single-file Python CLI) use?

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.

Is wordcount (single-file Python CLI) editable without a developer?

The easiest route: visit the project on cenius.ai, tell the platform what to change, and collect the updated build. No source-editing needed.

Is it possible to white-label wordcount (single-file Python CLI) for a client?

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.

License & rebranding

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.

Built with cenius.ai

This entire application — code, design, seeded demo data — was generated on cenius.ai from a plain-English description.

More open-source apps: the Cenius-ai catalog · showcase index

Releases

Packages

Contributors

Languages