This project allows generating reports from data obtained from Slack.
Make sure you have the following components installed:
- Python 3.8+
- Docker
- Docker Compose
- Redis (for Celery)
- Slack API Token
-
Clone the repository:
git clone https://github.com/pamelars86/slack-reports.git cd slack-reports
-
Create a
.env
file in the root of the project with the following content:SLACK_TOKEN=your_slack_api_token CELERY_BROKER_URL="redis://redis:6379/0" result_backend="redis://redis:6379/0" SLACK_HOME="https://your-organization.slack.com" LLAMA_HOME=""
-
Build and start the Docker containers:
docker-compose up --build
-
Start the server:
docker-compose up
To run the tests, follow these steps:
-
Make sure you have installed the development dependencies:
poetry install --with dev
-
Run the tests using
pytest
:poetry run pytest
This will execute all the tests in the tests
directory and provide a report of the test results.
To use the endpoints for generating reports, follow these steps:
-
Fetch Messages: Use the
/fetch-messages
endpoint to initiate the process of fetching messages from Slack. This operation is asynchronous and will return atask-id
. -
Top Repliers: Use the
/top-repliers
endpoint to generate a report of the top repliers in your Slack workspace. This operation is also asynchronous and will return atask-id
. -
Check Task Status: To check the status of your task, use the
/task-status/{task-id}
endpoint. Replace{task-id}
with the actual task ID you received from the previous endpoints.
For detailed information on the input and output of these endpoints, refer to the Swagger documentation available at http://localhost:5000/apidocs/
.
You can find the API documentation in Swagger by accessing the following URL once the server is up and running:
http://localhost:5000/apidocs/
To generate reports, make sure all services are running and use the endpoints documented in Swagger.
Contributions are welcome. Please open an issue or a pull request to discuss any changes you would like to make.
This project is licensed under the MIT License. See the LICENSE
file for more details.