bsao / cannlytics-ai

πŸ”₯ Cannlytics-powered artificial intelligence πŸ€–

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple, easy, cannabis analytics.

License: MIT Coverage Status

https://cannlytics.com

Cannlytics AI is πŸ”₯ Cannlytics-powered artificial intelligence πŸ€–. Cannlytics strives to be the go-to source of public cannabis data. Cannlytics wishes to use our comparative advantage in aggregating data from disparate resources and provide you with a simple, standardized interface to consume the data.

🌱 Installation

You can simply clone the repository to get your hands on the AI source code.

git clone https://github.com/cannlytics/cannlytics-ai.git

πŸƒβ€β™€οΈ Quickstart

You can run each data collection routine through the command line. For example:

python ai/get_cannabis_data/get_data_ma.py

πŸ”¨ Development

Please see the data collection guides for information on how public data is collected.

🦾 Automation

Now for the fun part, automation.

Note that you will need to enable billing for your project, enable the Cloud Scheduler API, and enable the Pub/Sub API.

  1. Create a Pub/Sub topic:

    gcloud pubsub topics create get_cannabis_data_daily
    
  2. Deploy the function:

    gcloud functions deploy get_cannabis_data_daily --entry-point get_cannabis_data_daily --runtime python39 --trigger-topic get_cannabis_data_daily --memory 1024MB --timeout 300 --env-vars-file env.yaml
    
  3. Finally, create a Cloud Scheduler cron job:

    gcloud scheduler jobs create pubsub get_cannabis_data_daily --schedule "20 4 * * *" --topic get_cannabis_data_daily --message-body "success"
    

Your function should now run nicely everyday at 4:20am EDT. You can read the logs for your function with:

gcloud functions logs read get_cannabis_data_daily

πŸ‘©β€πŸ”¬ Testing

You can run tests with code coverage with pytest.

pytest --cov=ai tests/

❀️ Support

Cannlytics is made available with ❀️ and your good will. Please consider making a contribution to keep the good work coming 🚒

πŸ₯ž Bitcoin donation address: 34CoUcAFprRnLnDTHt6FKMjZyvKvQHb6c6

πŸ›οΈ License

Copyright (c) 2021 Cannlytics and Cannlytics Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

About

πŸ”₯ Cannlytics-powered artificial intelligence πŸ€–

License:MIT License


Languages

Language:Python 99.2%Language:Makefile 0.8%