MostlyKIGuess / mAI-Mail

Apache License 2.0
5 stars 0 forks source link

mAI-Mail

Team Chipi Chapa Dubi Daba

Model Data

References

Our work uses the following software:

How to use it?

Setting up Credentials.json

To use this web scrapper, you need a credentials.json file for authenticating with the Gmail API. Here's how you can get it:

  1. Go to the Google Cloud Console.

  2. Click on "Select a project" at the top of the page, then click on "New Project", and create a project.

  3. Once the project is created, select it.

  4. In the left-hand menu, go to "APIs & Services" > "Library".

  5. Search for "Gmail API" and click on it.

  6. Click "Enable" to enable the Gmail API for your project.

  7. In the left-hand menu, go to "APIs & Services" > "Credentials".

  8. Click on "Create Credentials" > "OAuth client ID".

  9. If you haven't configured the OAuth consent screen yet, you'll be asked to do so. Fill in the required fields. You can set the "User Type" to "External" for testing purposes.

  10. Once the OAuth consent screen is configured, you'll be able to create the OAuth client ID. Set the "Application type" to "Desktop app", give it a name, and click "Create".

  11. You'll see a screen with your client ID and client secret. Click "OK".

  12. Back in the "Credentials" screen, you'll see your new OAuth 2.0 Client ID. Click on the download icon on the right to download your credentials.json file.

  13. Move the credentials.json file to the ./scrapper directory of this project.

  14. Now you need to run the python file pythongmail.py, make sure to do it from the parent directory and not the same directory.And you will get your scrapped data on a file name threads.txt.

  15. Then run the threadcopy.sh to trasnfer data to it's place where it could be ingested.

  16. If you are facing an error of email scrapping failed, be sure to install google-api-python-client lib by doing:

    pip install --user google-api-python-client

    or just this if you are in venv, which you should be for your safety.

    pip install google-api-python-client
    • And WOHOO you are done and set uped.

Final.sh