Giter Club home page Giter Club logo

a1_zoo's Introduction

A1 Zoo ๐Ÿผ

To run as docker image with composer

docker-compose build
docker-compose run cli python calculate.py --api_base_url=http://prod.example.de:8020

To run as docker container

docker build . -t a1_zoo
docker run -it --rm a1_zoo python calculate.py --api_base_url=http://prod.example.de:8020

Run via CLI with arguments

python calculate.py --api_base_url=http://prod.example.de:8020

or with or with ENV

export API_BASE_URL=http://prod.example.de:8020
python calculate.py 

run tests

$ make test
nosetests tests
..
----------------------------------------------------------------------
Ran 2 tests in 0.038s

OK

Example output

$ docker-compose run cli python calculate.py --api_base_url=http://prod.example.de:8020
2019-03-21 21:19:23,521 - a1_zoo - INFO - Begin session
2019-03-21 21:19:23,521 - a1_zoo - INFO - API_BASE_URL: http://prod.example.de:8020
2019-03-21 21:19:23,521 - a1_zoo - INFO - LOG_LOGGER: a1_zoo
2019-03-21 21:19:23,522 - a1_zoo - INFO - LOG_FILE: a1_zoo.log
2019-03-21 21:19:23,522 - a1_zoo - INFO - CACHE_DIR: /tmp/a1_zoorjabveu5/
2019-03-21 21:19:23,522 - a1_zoo - INFO - Start Zoo Session
2019-03-21 21:19:23,522 - a1_zoo - INFO - Download and save data locally
2019-03-21 21:19:23,522 - a1_zoo - INFO - get animals...
2019-03-21 21:19:23,570 - a1_zoo - INFO - done
2019-03-21 21:19:23,571 - a1_zoo - INFO - get food data...
2019-03-21 21:19:23,641 - a1_zoo - INFO - done
2019-03-21 21:19:23,642 - a1_zoo - INFO - get zookeeper data...
2019-03-21 21:19:23,686 - a1_zoo - INFO - done
2019-03-21 21:19:23,740 - a1_zoo - INFO - total_amount_per_animal: 2027.7142857142856
2019-03-21 21:19:23,745 - a1_zoo - INFO - total_cost_per_compound: compound
alligators    472.857143
big_cat       790.285714
bird          256.571429
water_bird    508.000000
Name: total_cost_per_day_per_animal, dtype: float64
2019-03-21 21:19:23,749 - a1_zoo - INFO - most_expensive_compound: big_cat
2019-03-21 21:19:23,749 - a1_zoo - INFO - report to director
2019-03-21 21:19:23,793 - a1_zoo - INFO - directors response: You made it!
================================

Yay, you helped the zoo having a future plan.
Due to your awesomeness the zoo director recommends you to send a message
with the code word "Jumpstart" and the code you wrote
to [email protected].
:
2019-03-21 21:19:23,793 - a1_zoo - INFO - done

a1_zoo's People

Contributors

printminion avatar

Watchers

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