Console to handle object storage using JSON serialization and deserealization.

Related tags

JSON css python html airbnb
Overview

0x00. AirBnB clone - The console

Release date: Nov-15-2021

Twitter

AirBnB Custom banner

0x00.Table of contents

0x01 Introduction

Team project to build a clone of AirBnB.

The console is a command interpreter to manage objects abstraction between objects and how they are stored

BaseModel

0x02 Environment

Suite CRM terminal python HTML5 CSS3 Suite CRM Suite CRM Suite CRM git distributed version control system Github

All the development and testing was runned over an operating system Ubuntu 20.04 LTS using programming language Python 3.8.3. The editors used were VIM 8.1.2269, VSCode 1.6.1 and Atom 1.58.0 . Control version using Git 2.25.1.

0x03 Installation

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

change to the AirBnb directory and run the command:

./console.py

Execution

In interactive mode

$ ./console.py
(hbnb) help

Documented commands (type help 
   
    ):
========================================
EOF  help  quit

(hbnb) 
(hbnb) 
(hbnb) quit
$

   

in Non-interactive mode

): ======================================== EOF help quit (hbnb) $ $ cat test_help help $ $ cat test_help | ./console.py (hbnb) Documented commands (type help ): ======================================== EOF help quit (hbnb) $ ">
$ echo "help" | ./console.py
(hbnb)

Documented commands (type help 
    
     ):
========================================
EOF  help  quit
(hbnb) 
$
$ cat test_help
help
$
$ cat test_help | ./console.py
(hbnb)

Documented commands (type help 
     
      ):
========================================
EOF  help  quit
(hbnb) 
$

     
    

0x04 Testing

Documentation

  • Modules: python3 -c 'print(__import__("my_module").__doc__)'
  • Classes: python3 -c 'print(__import__("my_module").MyClass.__doc__)'
  • Functions (inside and outside a class): python3 -c 'print(__import__("my_module").my_function.__doc__)' and python3 -c 'print(__import__("my_module").MyClass.my_function.__doc__)'

Python Unit Tests

  • unittest module
  • File extension .py
  • Files and folders star with test_
  • Organization:for models/base.py, unit tests in: tests/test_models/test_base.py
  • Execution command: python3 -m unittest discover tests
  • or: python3 -m unittest tests/test_models/test_base.py

run test in interactive mode

$ echo "python3 -m unittest discover tests" | bash

0x05 Usage

List of commands and examples usage:

The prompt (hbnb) waits for a command in an infinite loop.

  • help

example:

  • quit

example:

0x06 License

0x07 Contributing

0x08 Todo

0x09 Changelog

0x0A Tests

0x0B Questions

0x0C Conclusion

0x0D References

0x0E Acknowledgements

0x0F History

0x10 Credits

Rodrigo

Rodrigo Mato | LinkedIn

RodrigoMato00 | Github



Ronald

Ronald Rivero | Twitter

Ronald Rivero | LinkedIn

Ralex | Github


You might also like...
Python script for converting .json to .md files using Mako templates.

Install Just install poetry and update script dependencies Usage Put your settings in settings.py and .json data (optionally, with attachments) in dat

A Python tool that parses JSON documents using JsonPath

A Python tool that parses JSON documents using JsonPath

This open source Python project allow you to create JSON data trees using Minmup.com
This open source Python project allow you to create JSON data trees using Minmup.com

This open source Python project allow you to create JSON data trees using Minmup.com. I try to develop this project all the time. But feel free to use :).

jq for Python programmers Process JSON and HTML on the command-line with familiar syntax.

jq for Python programmers Process JSON and HTML on the command-line with familiar syntax.

A daily updated JSON dataset of all the Open House London venues, events, and metadata

Open House London listings data All of it. Automatically scraped hourly with updates committed to git, autogenerated per-day CSV's, and autogenerated

A JSON utility library for Python featuring Django-style queries and mutations.

JSON Enhanced JSON Enhanced implements fast and pythonic queries and mutations for JSON objects. Installation You can install json-enhanced with pip:

Python script to extract news from RSS feeds and save it as json.

Python script to extract news from RSS feeds and save it as json.

Marshall python objects to and from JSON

Pymarshaler - Marshal and Unmarshal Python Objects Disclaimer This tool is in no way production ready About Pymarshaler allows you to marshal and unma

JSONManipulator is a Python package to retrieve, add, delete, change and store objects in JSON files.

JSONManipulator JSONManipulator is a Python package to retrieve, add, delete, change and store objects in JSON files. Installation Use the package man

Owner
Ronald Alexander
Software Developer with Quality Management Systems background. Thinking in TICS that improves the process.
Ronald Alexander
Same as json.dumps or json.loads, feapson support feapson.dumps and feapson.loads

Same as json.dumps or json.loads, feapson support feapson.dumps and feapson.loads

boris 5 Dec 1, 2021
Creates fake JSON files from a JSON schema

Use jsf along with fake data generators to provide consistent and meaningful fake data for your system.

Andy Challis 86 Jan 3, 2023
Json utils is a python module that you can use when working with json files.

Json-utils Json utils is a python module that you can use when working with json files. it comes packed with a lot of featrues Features Converting jso

Advik 4 Apr 24, 2022
Random JSON Key:Pair Json Generator

Random JSON Key:Value Pair Generator This simple script take an engish dictionary of words and and makes random key value pairs. The dictionary has ap

Chris Edwards 1 Oct 14, 2021
With the help of json txt you can use your txt file as a json file in a very simple way

json txt With the help of json txt you can use your txt file as a json file in a very simple way Dependencies re filemod pip install filemod Installat

Kshitij 1 Dec 14, 2022
Ibmi-json-beautify - Beautify json string with python

Ibmi-json-beautify - Beautify json string with python

Jefferson Vaughn 3 Feb 2, 2022
No more boilerplate to check and build a Python object from JSON.

JSONloader This module is for you if you're tired of writing boilerplate that: builds a straightforward Python object from loaded JSON. checks that yo

null 3 Feb 5, 2022
A Cobalt Strike Scanner that retrieves detected Team Server beacons into a JSON object

melting-cobalt ?? A tool to hunt/mine for Cobalt Strike beacons and "reduce" their beacon configuration for later indexing. Hunts can either be expans

Splunk GitHub 150 Nov 23, 2022
json|dict to python object

Pyonize convert json|dict to python object Setup pip install pyonize Examples from pyonize import pyonize

bilal alpaslan 45 Nov 25, 2022
Convert your JSON data to a valid Python object to allow accessing keys with the member access operator(.)

JSONObjectMapper Allows you to transform JSON data into an object whose members can be queried using the member access operator. Unlike json.dumps in

Owen Trump 4 Jul 20, 2022