Logo Lanfrica

GichanaMayaka/zohali

Domain:

digital infrastructure

Record type:

software
Creator:
Gic
Host:
This is an API that consumes Kenya Power's Tweets to check for scheduled/planned maintenance in Kenya. # Project Zohali (Saturn) **NOTE: Requires a subscription to X's, formerly Twitter, Basic or higher APIs to use.** This is an API that consumes Kenya Power's Tweets to check for scheduled/planned maintenance in Kenya. Information extracted includes the Region, County, Area, Specific places, time as well as date of the planned incidents. This API, consequently, makes the information publicly searchable, and analysable. ## Getting Started ### Configuration First, supply a .env file that will hold all configuration details to the application's root directory. Ensure all options and tokens are supplied as shown below (keys and tokens are generated from Twitter) ENCODING = "utf-8" API_KEY = API_KEY_SECRET = BEARER_TOKEN = ACCESS_TOKEN = ACCESS_TOKEN_SECRET = SCREEN_NAME = "KenyaPower_Care" TWEET_MODE = "extended" TWEETS_COUNT = 1500 EXCLUDE_REPLIES = True INCLUDE_RETWEETS = False TIMEOUT = 120 POSTGRES_HOSTNAME = POSTGRES_USER = POSTGRES_PASSWORD = POSTGRES_PORT = 5432 POSTGRES_DATABASE_NAME = The application requires Tesseract-OCR to be installed and present in the path. Please review the Tesseract-OCR documentation for directions on how to configure for your environment. Once all requisite configuration details are supplied accordingly, quickly run the project using docker and docker-compose: ```bash $ docker-compose up -d ``` If docker is not available, you can run locally by activating the virtualenv as below, if on Windows ```bash $ venv\Scripts\activate $ python serve.py ``` or if on Linux ```bash $ chmod +x init.sh $ source/scripts/activate $ init.sh ``` ### Endpoints All endpoints can be accessed through _**localhost:8000/docs**_ which is powered by Swagger UI as previewed below: ### Directory Structure: -/zohali/ init.sh serve.py README.md docker-compose.yml Dockerfile requirements.txt alembic.ini nginx.conf .dockerignore .gitignore -/api/ __ini__.py auth.py database.py models.py schemas.py tasks.py utils.py -/app/ __init__.py authenticators.py …