Coder Social home page Coder Social logo

wordcount-api's Introduction

WordCount API

Dockerized API for WordCount excercise. Developed on Python using Flask Framework.

Pre-Requisites

Make sure you have Docker with Docker Compose installed on your machine.

Installation

Download git repositories

Download this and wordcount-client repositories.

Allocate repositories

Unzip if necessary, then set both directories in the same folder, the structure should look like this (make sure the directory names are the same as they appear in the diagram bellow):

	root_dir/ (Example name)
	├── wordcount-api/
	└── wordcount-client/

Move docker-compose file

Inside wordcount-api is the docker-compose file called wordcount-compose.yaml for deploying the containers, once located, move it to the root_dir/. Then it should look like this:

	root_dir/ (Example name)
	├── wordcount-api/
	├── wordcount-client/
	└── wordcount-compose.yaml

Deploy the containers

Open the shell and run the command bellow:

docker-compose -f wordcount-compose.yaml up

The container should be running and ready to use. ✌🏻

Usage

To use the API you need to make a request from the Client terminal, as:

python3 wordcount_client.py [--file | -f] <file_name>

Also, you need to have a plain-text file with the words to count in the data-in/ directory.

So, create a file in the data-in/ directory:

touch data-in/document.txt

Then write some words on the file with (The image generated comes with nano app installed):

nano data-in/document.txt

Now you are set! 💪🏻 Let´s run the program and see the magic happen. ✨

wordcount-api's People

Contributors

gcornejov avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.