Skip to main content

Find the closest square numbers to a given input number from the command line.

Project description

squares

squares is a Python-based command-line application that finds the two closest square numbers to a given input number.

Installation

To install squares, use pip:

pip install squares-cli

This will install the squares command, allowing you to find the closest square numbers directly from the command line.

Usage

The squares command can find the two closest square numbers (one above and one below) to a given input number. You can use it in various ways, specifying options to control the output.

Basic Command

squares [OPTIONS] <number>

If no options are specified, squares will output both the closest square number below and the closest square number above the given input, separated by a comma.

Options

  • --below - Outputs only the closest square below the input number.
  • --above - Outputs only the closest square above the input number.
  • --both - Outputs both the closest squares (this is the default behavior if no option is specified).
  • -h or --help - Displays the help message.

Examples

Here are some example commands and their expected outputs:

Default (Both Closest Squares)

squares 12

Output:

9, 16

In this example, squares 12 finds the closest squares around 12, returning both the closest square below (9) and the closest square above (16).

Closest Square Below

squares --below 12

Output:

9

This example uses --below to return only the closest square below 12, which is 9.

Closest Square Above

squares --above 12

Output:

16

Here, --above is used to return only the closest square above 12, which is 16.

Explicitly Returning Both (Same as Default)

squares --both 12

Output:

9, 16

Using --both explicitly returns both closest squares around 12. This produces the same result as the default behavior.

Man Page

A man page is also included in the installation. You can access it by typing:

man squares

This will display comprehensive information about the command, options, and examples, similar to what is provided in this README.

Additional Notes

  • Operating System Compatibility: squares is compatible with UNIX-like systems (Linux and macOS) and Windows, though the man page installation may vary depending on the OS.
  • Python Version: This package requires Python 3.6 or higher.[

License

This project is licensed under the MIT License.


This README.md provides a clear description of what the package does, how to install and use it, and includes examples and notes for further clarification. Let me know if there’s anything else you’d like added or modified!]

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

squares_cli-0.1.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

squares_cli-0.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file squares_cli-0.1.tar.gz.

File metadata

  • Download URL: squares_cli-0.1.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for squares_cli-0.1.tar.gz
Algorithm Hash digest
SHA256 ca71748745223c91a767abd741cffa1a9e3f68f148433786b097bc8a095ef5ad
MD5 4028702a8961dc596e3bfb3b9aa19318
BLAKE2b-256 1daa0c6a53a0a126bc79399379db0c7c8ff5baa6facd57e9c6863f743947f38d

See more details on using hashes here.

File details

Details for the file squares_cli-0.1-py3-none-any.whl.

File metadata

  • Download URL: squares_cli-0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for squares_cli-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4a487305a8488895190f9dda8fb8431dd4ed6e1e671f74cdd64a4f96e6e546ab
MD5 542fadb0bc6c31d8e07226bb42594b7b
BLAKE2b-256 8c787644006a5ca12f76902b1fa1fbdb278dec54f0d503c42ece69835942ee08

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page