https://github.com/extratone/squares
Python-based command-line application that finds the two closest square numbers to a given input number.
https://github.com/extratone/squares
cli pypi pypi-package python python-script squareroot
Last synced: 5 months ago
JSON representation
Python-based command-line application that finds the two closest square numbers to a given input number.
- Host: GitHub
- URL: https://github.com/extratone/squares
- Owner: extratone
- Created: 2024-11-06T05:11:06.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-06T05:26:23.000Z (about 1 year ago)
- Last Synced: 2025-04-15T16:29:47.555Z (8 months ago)
- Topics: cli, pypi, pypi-package, python, python-script, squareroot
- Language: Python
- Homepage: https://pypi.org/project/squares-cli
- Size: 15.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

# `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`:
```bash
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
```bash
squares [OPTIONS]
```
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)
```bash
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
```bash
squares --below 12
```
**Output:**
```
9
```
This example uses `--below` to return only the closest square below 12, which is 9.
#### Closest Square Above
```bash
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)
```bash
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:
```bash
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!]