Giter VIP home page Giter VIP logo

pycroservice's Introduction

Pycroservice

This is an example micro service built with Python as a hack day experiment.

Features

  • RESTful microservice
  • API documentation in Swagger (OpenAPI)
  • CQRS splitting read and update operations
  • Updates are queued into RabbitMQ for eventual consistency
  • Data persisted in Cassandra

Dependencies

You will need the following dependencies

  • Python 3.6
  • Docker, Docker Compose

I recommend using virtualenv or similar to manage your python environment. Either way, you need to eventually pull the python packages you need which you can do by running pip

pip install -r requires.txt

Getting started

The downstream dependencies (Cassandra and RabbitMQ) are hosted in containers and are defined in the docker-compose.yml file. To start the containers, simply invoke docker compose like this

docker-compose up

To create the message queues, cassandra key space and tables, use the following python scripts

python src/setup/cass.py
python src/setup/rabb.py

To start the REST api service, use connexion

connexion run swagger/recipes.yml -v --debug

You can then view the swagger UI at localhost:5050/ui

Things to write about still

  • Update service
  • Development environment in docker

Wish list

  • DI
  • Unit tests
  • Resilience
  • Move connection settings into ENV

pycroservice's People

Contributors

nicholasjgreen 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.