Console to handle object storage using JSON serialization and deserealization.

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


Owner
Ronald Alexander
Software Developer with Quality Management Systems background. Thinking in TICS that improves the process.
Ronald Alexander
Convert Wii UI formats to JSON5 and vice versa

Convert Wii UI formats to JSON5 and vice versa

Pablo Stebler 11 Aug 28, 2022
Simple Python Library to convert JSON to XML

json2xml Simple Python Library to convert JSON to XML

Vinit Kumar 79 Nov 11, 2022
JsonParser - Parsing the Json file by provide the node name

Json Parser This project is based on Parsing the json and dumping it to CSV via

Ananta R. Pant 3 Aug 08, 2022
Small python wrapper around the valico rust library to provide fast JSON schema validation.

Small python wrapper around the valico rust library to provide fast JSON schema validation.

Simon J Knibbs 5 Jul 12, 2019
The ldap2json script allows you to extract the whole LDAP content of a Windows domain into a JSON file.

ldap2json The ldap2json script allows you to extract the whole LDAP content of a Windows domain into a JSON file. Features Authenticate with password

Podalirius 68 Dec 07, 2022
import json files directly in your python scripts

Install Install from git repository pip install git+https://github.com/zaghaghi/direct-json-import.git Use With the following json in a file named inf

Hamed Zaghaghi 51 Dec 01, 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
A fast JSON parser/generator for C++ with both SAX/DOM style API

A fast JSON parser/generator for C++ with both SAX/DOM style API Tencent is pleased to support the open source community by making RapidJSON available

Tencent 12.6k Dec 30, 2022
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

Andrew Polukhin 1 Jan 07, 2022
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
Roamtologseq - A script loads a json export of a Roam graph and cleans it up for import into Logseq

Roam to Logseq The script loads a json export of a Roam graph and cleans it up f

Sebastian Pech 4 Mar 07, 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

3 Feb 05, 2022
Easy JSON wrapper modfied to wrok with suggestions

🈷️ Suggester Easy JSON wrapper modfied to wrok with suggestions. This was made for small discord bots, for big bots you should not use this. 📥 Usage

RGBCube 1 Jan 22, 2022
Define your JSON schema as Python dataclasses

Define your JSON schema as Python dataclasses

62 Sep 20, 2022
Wikidot-forum-dump - Simple Python script that dumps a Wikidot wiki forum into JSON structures.

wikidot-forum-dump Script is partially based on 2stacks by bluesoul: https://github.com/scuttle/2stacks To dump a Wiki's forum, edit config.py and put

ZZYZX 1 Jun 29, 2022
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

Alexey Borontov 6 Dec 07, 2021
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
A fast streaming JSON parser for Python that generates SAX-like events using yajl

json-streamer jsonstreamer provides a SAX-like push parser via the JSONStreamer class and a 'object' parser via the ObjectStreamer class which emits t

Kashif Razzaqui 196 Dec 15, 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
Make JSON serialization easier

Make JSON serialization easier

4 Jun 30, 2022