30th project of the Trybe Web Development course.
The Inventory Report is a Python project focused on generating simple and complete inventory reports from data stored in CSV, JSON, and XML files. In order to create an efficient and scalable system, Object-Oriented Programming concepts were applied, as well as design patterns such as Adapter, Strategy and Iterator.
ℹ️ I wrote tests for the functions implemented by Trybe. These tests can be found in the
tests
subdirectories.
The project was developed in Python. The tests were written using Pytest and code quality was ensured using the Flake8 linter.
- Import data from CSV, JSON, and XML files.
- Generate simple and complete reports based on the imported data.
To run the project locally, follow the steps below.
- Clone the repository.
git clone [email protected]:garciaagui/inventory-report.git
- Navigate to the root of the project.
cd inventory-report/
- Create the virtual environment.
python3 -m venv .venv
- Activate the virtual environment.
source .venv/bin/activate
- Note that at the beginning of the terminal line there will be
(.venv)
, as in the example below.
(.venv) gui@gui-desktop:~/Trybe/inventory-report$
- To deactivate the virtual environment, run the command
deactivate
. Remember to activate it again when you return to the project.
- Install dependencies in the virtual environment.
python3 -m pip install -r dev-requirements.txt
- Run the command below to enable report generator.
pip install .
- Now, it's possible to generate the reports using the command pattern below.
inventory_report <input_file_path> <report_type>
- Example:
inventory_report inventory_report/data/inventory.csv simple
- Accepted values for
report_type
: simple, complete, colored.
ℹ️ For additional instructions, click here.
- 🧪 To run all tests, execute the command below.
python3 -m pytest
- 🧪 To run only one test file, follow the example below.
python3 -m pytest tests/product/test_product.py
- 🧪 To run only one specific test, follow the example below.
python3 -m pytest -k test_create_product_sucessfully
- If you wish to manually test directly in the modules where the functions were implemented, follow the example below.
python3 -m inventory_report.reports.simple_report
"Trybe is a future school for anyone who wants to improve their lives and build a successful career in technology, where the person only pays when they get a good job."
"The program features over 1,500 hours of online classes covering introduction to software development, front-end, back-end, computer science, software engineering, agile methodologies, and behavioral skills."
Project developed by Guilherme Garcia. Below are my social networks and means of contact. 🤘