propfilter-cli-ts v1.0.3
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.
- Click "Code" -> "Codespaces" -> "Open in Codespaces" on GitHub.
- Wait for the setup to complete.
- Open the terminal and run:
propfilter --help
- 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
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:
- commander - CLI argument parsing
- chalk - Colored terminal output
- cli-table3 - Table formatting
- csv-parse - CSV parsing
- typescript - Type safety
š¤ 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! š