projects

View the Project on GitHub Fran-cois/projects

Redis project : newslater

author: Amat François

contact: amat.francois@gmail.com

Intro

This mini-project has be done to get familiar with redis functions. It implements a very simple newslater system.

Set-up

First install on your machine redis, python3 and the following python libraries :

pip3 install redis,gensim,urllib,progress,termcolor

Launch Redis server by the following command :

redis-server

The redis-server should be launch at the port 6379 Open two terminals and launch

python3 server.py
python3 client.py

The server will start to seed the redis database by parsing some wikipedia pages.

Redis structure

news.py is the file where all the redis functions are used.

I have defined the news as an hset with an id and their body.

I have defined a global set of keywords for an easier implementation of the get_subjects function.

In addition, there is a set mapping all keywords to their news_id.

Finnaly, the user is just an id in a simple store with an set “user_keyword:" to store all keyword for each user.

Client/Server structure

The client here do all the functions (subcribe and publish).

There is an socket with a communication of a couple of (id, command) from the client to the server.

The server will handle all the commands given in the section below.

In addition, useful activity logs will be print in the console used to launch the server.

Fonctionnalities:

Screenshots

first capture

second capture

leads for further fonctionnalities

Conclusion:

I found the redis database very simple in its usage and very convenient for simple project like that.