Giter Site home page Giter Site logo

drive_inventory's Introduction

Drive Inventory

Drive Inventory is a Python application that creates a database of a user's Google Drive files. It saves file information such as name, extension, owner, visibility (public or private), and the last update date. Additionally, if a file is public, the application changes its visibility to private and sends an email to the owner informing them of the change, while also logging the change in the database.

Use Cases

What Do I Think Still Needs Improvement?

I am currently facing challenges in fully understanding how the Google Drive API's webhook functionality operates. While I was able to set up the entry point for the webhook, the responses received from Google lacked detailed information. Consequently, I was unable to devise an optimal method for accurately identifying changes occurring in the user's Drive. This lack of clarity in the webhook responses has hindered my ability to effectively track and manage updates in the user's Google Drive.

System architecture

Additionally, there is a need to enhance the security layer for storing credentials properly. For instance, integrating a vault into the project would allow the application to securely fetch credentials at startup. This approach would ensure that sensitive information, such as API keys and database credentials, is handled securely, reducing the risk of exposure and improving overall security.

Use Case 1: Sync Google Drive Files

  • Description: Sync a user's Google Drive files with the database.
  • Solution: Utilizes the Google Drive API to list and retrieve file information. This information is then saved in a MongoDB database.

Use Case 2: Change File Visibility

  • Description: If a file is public, change its visibility to private.
  • Solution: During synchronization, the visibility of files is checked. If a file is public, the Google Drive API is used to change its visibility to private, and an email notification is sent to the owner.

Use Case 3: Log Changes

  • Description: Log changes in file visibility.
  • Solution: Detailed logs are saved in the MongoDB database whenever a visibility change is made.

Requirements

  • Python 3.8+
  • MongoDB
  • Docker (optional, for running with containers)

Installation

Clone the Repository

git clone https://github.com/yourusername/drive-inventory.git
cd drive-inventory

Running Locally

  1. Install dependencies:

Assuming you have Poetry installed, run:

poetry install
  1. Run the application:
poetry run python -m drive_inventory.entrypoints.sync_files

Automated Tests

To run the automated tests using pytest, run:

poetry run pytest

References

drive_inventory's People

Contributors

marioidival avatar

Stargazers

Daniel Dias de Assumpção avatar

Watchers

 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.