# Project Zohali (Saturn)
**NOTE: Requires a subscription to X's, formerly Twitter, [Basic or higher APIs](https://developer.twitter.com/en/products/twitter-api) to use.**
This is an API that consumes [Kenya Power's](https://twitter.com/KenyaPower_Care) 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](https://github.com/tesseract-ocr/tesseract) 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](https://www.docker.com/) and
[docker-compose](https://docs.docker.com/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](https://swagger.io/tools/swagger-ui/) as previewed below:
![Screenshot](./docs/images/swagger-preview.jpg)
### 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
exceptions.py
patterns.py
runner.py
tweetListeners.py
utils.py
-/images/
-/image_texts/
-/confs/
__init__.py
configs.py
-/migrations/
...
-/data/
db.sql
-/tests/
__init__.py
test_authenticator.py
test_tweet_listener.py
-/postman collection/
zohali.postman_collection.json
没有合适的资源?快使用搜索试试~ 我知道了~
这是一个API,它使用Kenya Power的Tweets来检查肯尼亚的计划维护.zip
共40个文件
py:26个
yml:1个
txt:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 79 浏览量
2023-12-27
15:11:02
上传
评论
收藏 78KB ZIP 举报
温馨提示
这是一个API,它使用Kenya Power的Tweets来检查肯尼亚的计划维护.zip
资源推荐
资源详情
资源评论
收起资源包目录
这是一个API,它使用Kenya Power的Tweets来检查肯尼亚的计划维护.zip (40个子文件)
1
YANG123
zohali-main
serve.py 115B
confs
__init__.py 28B
config.py 1KB
migrations
README 38B
script.py.mako 510B
env.py 2KB
versions
47a88d65f603_create_maintenance_table.py 1KB
app
tweetListeners.py 6KB
utils.py 5KB
__init__.py 16B
authenticators.py 3KB
patterns.py 997B
runner.py 2KB
exceptions.py 390B
data
db.sql 23B
alembic.ini 3KB
tests
test_authenticator.py 786B
__init__.py 0B
test_tweet_listener.py 2KB
api
utils.py 1KB
__init__.py 800B
middleware.py 314B
database.py 454B
models.py 693B
routes
__init__.py 0B
stepwise.py 4KB
all.py 1KB
schemas.py 685B
auth.py 0B
tasks.py 837B
docker-compose.yml 787B
docs
images
swagger-preview.jpg 136KB
Dockerfile 246B
init.sh 130B
requirements.txt 1KB
postman collection
zohali.postman_collection.json 3KB
.gitignore 136B
.dockerignore 157B
README.md 3KB
nginx.conf 353B
共 40 条
- 1
资源评论
m0_74456535
- 粉丝: 90
- 资源: 725
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功