Giter Club home page Giter Club logo

airbnb_clone's Introduction

AirBnB_clone - Console

the-console

Welcome to the AirBnB clone project! (The Holberton B&B)

This project is a clone of Airbnb console

This project allows through a simple console (command interpreter) to create a data model. through the console you can create, update, destroy, etc. objects in JSON files. which allows a persistence of files to later be connected to the front-end.

Table of Contents

  1. Requeriments
  2. How to start it
  3. Test
  4. Execute commands
  5. How to use it
  6. Development environment
  7. Authors

Requeriments 📋

Airbnb was built and tested in Ubuntu 14.04 LTS via Vagrant in VirtualBox. Programming languaje python3

How to start it 🚀

Do you need clone this repository:

	git clone https://github.com/somarae8/AirBnB_clone

and then you can enter the folder of project:

	cd Airbnb_clone

after you can excecute with this command:

	./console.py

Test ⚙️

Some examples of how to used this console:

interactive mode:

vagrant@vagrant-ubuntu-trusty-64:~/Airbnb_clone$ ./console.py
(hbnb) help

Documented commands (type help <topic>):
============================================
EOF  help  quit  show  all  update  destroy

(hbnb)
(hbnb)
(hbnb) quit
vagrant@vagrant-ubuntu-trusty-64:~/Airbnb_clone$

non-interactive mode:

vagrant@vagrant-ubuntu-trusty-64:~/Airbnb_console$ echo "help" | ./console.py
(hbnb)

Documented commands (type help <topic>):
========================================
EOF  help  quit
(hbnb)
vagrant@vagrant-ubuntu-trusty-64:~/Airbnb_console$ cat test_help
help
vagrant@vagrant-ubuntu-trusty-64:~/Airbnb_console$
vagrant@vagrant-ubuntu-trusty-64:~/Airbnb_console$ cat test_help | ./console.py
(hbnb)

Documented commands (type help <topic>):
========================================
EOF  help  quit
(hbnb)
vagrant@vagrant-ubuntu-trusty-64:~/Airbnb_console$ |

Execute commands ⌨️

Command Syntax Output
help help [option] Displays all available commands
quit quit Exit command interpreter
EOF EOF (ctrl + d) Exit command interpreter
create create [class_name] Creates an instance of class_name
update update [class_name] [object_id] [update_key] [update_value] or [class].update([object_id] [update_key] [update_value])
or [class name].update([object_id], [dictionary representation])
Updates the key:value of class_name.object_id instance
show show [class_name] [object_id] or [class_name].show([object_id]) Displays all attributes of class_name.object_id
all all or all [class_name], [class_name].all() Displays every instance of class_name, if used without option displays every instance saved to the file
destroy destroy [class_name] [object_id] or [class_name].destroy([object_id]) Deletes all attributes of class_name.object_id

How to use it 🔧

Enter the console and try some commands

vagrant@vagrant-ubuntu-trusty-64:~/AirBnB_clone$ ./console.py 
(hbnb) create City
6d8c38cf-789a-4d74-a57a-6fdcfe506704

(hbnb) all
["[City] (6d8c38cf-789a-4d74-a57a-6fdcfe506704) {'updated_at': datetime.datetime(2020, 7, 2, 2, 11, 38, 653094), 'created_at': datetime.datetime(2020, 7, 2, 2, 11, 38, 653072), 'id': '6d8c38cf-789a-4d74-a57a-6fdcfe506704'}"]
(hbnb) 

(hbnb) show BaseModel 884eb378-998d-4aae-9160-fb37ffd17744
[BaseModel] (884eb378-998d-4aae-9160-fb37ffd17744) {'updated_at': datetime.datetime(2020, 7, 2, 2, 14, 41, 975276), 'created_at': datetime.datetime(2020, 7, 2, 2, 14, 41, 975249), 'id': '884eb378-998d-4aae-9160-fb37ffd17744'}
(hbnb)

(hbnb) destroy BaseModel 884eb378-998d-4aae-9160-fb37ffd17744
(hbnb) all
["[City] (6d8c38cf-789a-4d74-a57a-6fdcfe506704) {'updated_at': datetime.datetime(2020, 7, 2, 2, 11, 38, 653094), 'created_at': datetime.datetime(2020, 7, 2, 2, 11, 38, 653072), 'id': '6d8c38cf-789a-4d74-a57a-6fdcfe506704'}"]
(hbnb) 

(hbnb) City.update("6d8c38cf-789a-4d74-a57a-6fdcfe506704", "first_name", "John")
(hbnb) show City 6d8c38cf-789a-4d74-a57a-6fdcfe506704
[City] (6d8c38cf-789a-4d74-a57a-6fdcfe506704) {'id': '6d8c38cf-789a-4d74-a57a-6fdcfe506704', 'updated_at': datetime.datetime(2020, 7, 2, 2, 19, 56, 287961), 'created_at': datetime.datetime(2020, 7, 2, 2, 11, 38, 653072), 'first_name': 'John'}
(hbnb) 

Development environment 🛠️

This project has been tested on Ubuntu 14.06.6 LTS

  • Programming languaje Python
  • The tests are carried out in virtualBox
  • Development environment manager vagrant
  • Style guidelines: PEP 8 (version 1.7) || Google Style Python Docstrings

Authors✒️

  • Eduardo Ramos - student at Holberton School
  • Oscar Eduardo Info - student at Holberton School

You can also look at the list of all contributors who have participated in this project.

airbnb_clone's People

Contributors

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