An open-source Python library for CLI and NLP tasks
Project description
nlpfileio
An open-source Python CLI tool for NLP tasks
nlpfileio is a command-line interface library that simplifies natural language processing (NLP) tasks such as removing stopwords, normalizing text, stemming, and sentiment analysis.
It is built with Click and provides an interactive, colorful CLI with configuration support.
โจ Features
- ๐ Stopword Removal โ Remove stopwords using spaCy or TextBlob.
- ๐ Text Normalization โ Clean and normalize sentences.
- ๐ฑ Stemming โ Perform stemming on sentences.
- ๐ Sentiment Analysis โ Get polarity & subjectivity for each sentence.
- โ๏ธ Configurable โ Supports
config.inifor default settings. - ๐จ Interactive CLI โ Colorful, user-friendly prompts.
๐ฆ Installation
Install from PyPI (after publishing):
pip install nlpfileio
Then, download the required NLP resources (must be done once before first use):
nlpfileio-download
Or install from source:
git clone https://github.com/Ahmadzadeh920/nlpcli-pakage-library.git
cd nlpcli-pakage-library
pip install .
โก Usage
The CLI tool is available as nlpfileio once installed.
Note: Before using nlpfileio for the first time, you must download the necessary NLP models and resources. Run:
nlpfileio-download
Run it with an input file (.csv or .txt):
nlpfileio input.txt
๐ Commands
1. Remove Stopwords
nlpfileio input.txt remove_stop_words
Removes stopwords and shows an example. Optionally save results.
2. Normalize Sentences
nlpfileio input.txt normalize
Normalizes text and saves to normalized_sentences.txt if desired.
3. Stem Sentences
nlpfileio input.txt stem
Applies stemming. Example and optional file export included.
4. Sentiment Analysis
nlpfileio input.txt sentiment
Computes sentiment for each sentence:
Sentence: I love open-source projects.
Polarity: 0.500, Subjectivity: 0.600
Exports results to sentiments_sentences.txt if selected.
๐ Project Structure
nlpfileio/
โโโ src/nlpclinlpfileio/
โ โโโ cli.py # CLI entry point
โ โโโ services.py # Core NLP functions
โ โโโ config.ini # Default configuration
โ โโโ __init__.py
โโโ tests/ # Unit tests
โโโ README.md # Documentation
โโโ pyproject.toml # Project metadata
โโโ poetry.lock
โ๏ธ Configuration
Default options can be stored in config.ini, automatically loaded by the CLI.
Example:
[settings]
language = en
output_format = txt
๐งช Development
Clone and install dependencies:
poetry install
Run tests:
poetry run pytest
๐ Roadmap
Planned features and improvements:
- Lemmatization โ Add support for lemmatizing words.
- Language Detection โ Automatically detect the language of input text.
- Additional Input Formats โ Support JSON, Excel, and other file types.
- Enhanced Visualization โ Use
richfor better CLI output formatting.
๐ License
This project is licensed under the MIT License
๐ฉโ๐ป Author
Fatemeh Ahmadzadeh
- ๐ง Email: ahmadzade920@gmail.com
- ๐ GitHub: @Ahmadzadeh920
- ๐ผ LinkedIn: Fatemeh Ahmadzadeh
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nlpfileio-0.1.1.tar.gz.
File metadata
- Download URL: nlpfileio-0.1.1.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.10.12 Linux/6.8.0-79-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d1f20728b5cb08d57e53dff5dd971efd5e9e020f0e2f770047d34934cd40279
|
|
| MD5 |
08c21b14742ade9ca881090b414ca730
|
|
| BLAKE2b-256 |
9da2cdb376226bb010df5d362a8a17da00343f3e54adde9a0fa64a0156a47165
|
File details
Details for the file nlpfileio-0.1.1-py3-none-any.whl.
File metadata
- Download URL: nlpfileio-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.10.12 Linux/6.8.0-79-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5feece1225034bef9345fe0edd2d6e0ac97a1ffb19af41924e1f7f3c42c8d9bb
|
|
| MD5 |
c0064d25456935067cf3ee629708182e
|
|
| BLAKE2b-256 |
9c2426a090395498820d9423b33ae30438d636ca9f4e877f6cd85e4daf6a907d
|