SocialBarometer is a powerful social media sentiment analysis tool that collects data from various social media platforms, analyzes the sentiment of posts, and provides real-time alerts for significant sentiment shifts.
- Multi-platform data collection (Twitter, Reddit)
- Real-time sentiment analysis
- Configurable alerting system
- Scalable architecture using asyncio
- Comprehensive logging and error handling
- Python 3.9+
- PostgreSQL database
-
Clone the repository:
git clone https://github.com/yourusername/socialbarometer.git cd socialbarometer
-
Install Poetry (if not already installed):
curl -sSL https://install.python-poetry.org | python3 -
-
Install dependencies:
poetry install
-
Set up your
.env
file with necessary credentials and configuration (see Configuration section).
Create a .env
file in the root directory with the following contents:
DATABASE_URL=postgresql://username:password@localhost:5432/socialbarometer
TWITTER_API_KEY=your_twitter_api_key
TWITTER_API_SECRET=your_twitter_api_secret
REDDIT_CLIENT_ID=your_reddit_client_id
REDDIT_CLIENT_SECRET=your_reddit_client_secret
ALERT_THRESHOLD=0.7
COLLECTION_INTERVAL=300
SEARCH_KEYWORDS=SocialBarometer,sentiment analysis
LOG_LEVEL=INFO
Replace the placeholder values with your actual credentials and desired configuration.
To run SocialBarometer:
poetry run python -m socialbarometer.main
This will start the data collection and analysis process based on your configuration.
To run the test suite:
poetry run pytest
We use Black and isort for code formatting. To format your code:
poetry run black .
poetry run isort .
To run linters:
poetry run flake8 .
poetry run mypy .
socialbarometer/
├── socialbarometer/
│ ├── __init__.py
│ ├── main.py
│ ├── collectors/
│ ├── analyzers/
│ ├── alerts/
│ ├── database/
│ └── utils/
├── tests/
├── pyproject.toml
├── README.md
└── .env
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Kuldeep Pal - [email protected]