1.0.3 • Published 6 months ago

propfilter-cli-ts v1.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

PropFilter CLI - Real Estate Filtering Tool šŸ”

PropFilter is a powerful and intuitive command-line tool for filtering real estate properties. It supports JSON and CSV files as input and allows precise filtering using a variety of operators.


šŸš€ Get Started

šŸ† Recommended: Use GitHub Codespaces

The easiest way to try PropFilter is through GitHub Codespaces, where everything is pre-configured.

  1. Click "Code" -> "Codespaces" -> "Open in Codespaces" on GitHub.
  2. Wait for the setup to complete.
  3. Open the terminal and run:
    propfilter --help
  4. Start filtering properties instantly!

šŸ› ļø Installation (For Local Usage)

1. Install via npm

PropFilter is available as an npm package. Install it globally using:

npm install -g propfilter-cli-ts

View on npm

2. Run the CLI

propfilter --help

This will display all available options and usage examples.


šŸ“š Example Usage (Using Provided Sample Files)

You can test PropFilter immediately using the example CSV file included in the repository.

propfilter .devcontainer/sample.csv "price > 400000"

šŸ“š Example Usage

Basic Filtering

propfilter sample.csv "price > 400000"

Filters properties where the price is greater than 400,000.

propfilter sample.csv "lighting == high" "rooms >= 3"

Filters properties with high lighting and at least 3 rooms.

Filtering by Location

propfilter sample.csv "location <= 37.7749,-122.4194,10"

Finds properties within a 10 km radius of (37.7749, -122.4194).

Filtering by Amenities

propfilter sample.csv "amenities == pool,garage"

Filters properties that include both a pool and a garage.

Using JSON Output

propfilter sample.csv "amenities == pool,garage" --json

Outputs results as JSON instead of a table.


āš™ļø Features

šŸ‘‰ Supports CSV & JSON files
šŸ‘‰ Powerful filtering using various operators
šŸ‘‰ Intuitive CLI interface with formatted table output
šŸ‘‰ JSON output mode for structured data processing
šŸ‘‰ Works with GitHub Codespaces for instant use
šŸ‘‰ Fully tested with automated GitHub Actions


šŸ“Š Test Coverage

PropFilter is rigorously tested with Jest, ensuring reliability and correctness.

To run tests locally:

npm test

GitHub Actions automatically run tests on every push to main.


šŸ‘‰ Supported Operators

  • ==, != → Equals, Not Equals
  • <, <=, >, >= → Numeric comparisons
  • ~= → Contains (for descriptions)
  • location <= lat,lng,radius → Find properties within a distance

šŸ’” Notes

  • CSV files should have a header row matching the expected property fields.
  • JSON files should be an array of property objects.

šŸ“š Input Formats

PropFilter supports both CSV and JSON formats for input data.

šŸ”¢ CSV Example:

squareFootage,lighting,price,rooms,bathrooms,location,description,amenities
4485,medium,470155,2,1,"(-7.25056, -56.540592)","House with renovated kitchen","{'garage': false, 'pool': false, 'garden': false, 'fireplace': false, 'basement': true}"

šŸ”¢ JSON Example:

[
  {
    "squareFootage": 4485,
    "lighting": "medium",
    "price": 470155,
    "rooms": 2,
    "bathrooms": 1,
    "location": [-7.25056, -56.540592],
    "description": "House with renovated kitchen",
    "amenities": {
        "garage": false,
        "pool": false,
        "garden": false,
        "fireplace": false,
        "basement": true
    }
  }
]

šŸ“¦ Dependencies

PropFilter relies on the following libraries:


šŸ¤ Contributing

Contributions are welcome! To contribute: 1. Fork the repository. 2. Clone it to your local machine. 3. Install dependencies using npm install. 4. Run tests using npm test. 5. Open a pull request with your changes.


šŸ“ License

This project is licensed under the MIT License.

Have fun filtering properties with PropFilter! šŸš€

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago