Coder Social home page Coder Social logo

cannlytics / cannlytics-engine Goto Github PK

View Code? Open in Web Editor NEW
6.0 4.0 1.0 4.42 MB

A Python ๐Ÿ package that implements the logic of ๐Ÿ”ฅ Cannlytics.

Home Page: https://cannlytics.com

License: MIT License

Python 100.00%
cannabis cannabis-api python metrc api cannabis-data cannabis-app cannabis-scripts cannabisapp

cannlytics-engine's Introduction

Simple, easy, cannabis analytics.

https://cannlytics.com

License: MIT Version

๐Ÿ”ฅ Cannlytics is simple, easy-to-use, end-to-end cannabis analytics software designed to make your data and information accessible. We believe that everyone in the cannabis industry should be able to access their rich, valuable data quickly and easily and that everyone will be better off for it. The Cannlytics Engine comes with batteries included, but you are always welcome to supercharge your setup with modifications and custom components.

๐Ÿš€ Installation

You can install the Cannlytics engine from PyPI.

pip install cannlytics

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

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

๐Ÿ‘ฉโ€๐Ÿซ Documentation

Please refer to the Cannlytics developer documentation for detailed information about the module and various use cases.

๐Ÿ—๏ธ Authentication, Data, and File Management

Cannlytics leverages Firebase by default for a database, file storage, and authentication. You can refer to the documentation for instructions on how to setup your Firebase project for use with Cannlytics.

๐Ÿง Traceability

Cannlytics supports Metrc out-of-the-box. Simply plug in your API keys and you're off to the races.

from cannlytics import metrc

# Initialize a Metrc API client.
track = metrc.authorize(
    'your-vendor-api-key',
    'your-user-api-key',
    primary_license='your-user-license-number',
    state='ma',
)

Producer / processor workflow:

# Get a plant by it's ID.
plant = track.get_plants(uid='123')

# Change the growth phase from vegetative to flowering.
plant.flower(tag='your-plant-tag')

# Move the flowering plant to a new room.
plant.move(location_name='The Flower Room')

# Manicure useable cannabis from the flowering plant.
plant.manicure(harvest_name='Old-Time Moonshine', weight=4.20)

# Harvest the flowering plant.
plant.harvest(harvest_name='Old-Time Moonshine', weight=420)

Lab workflow:

# Post lab results.
track.post_lab_results([{...}, {...}])

# Get a tested package.
test_package = track.get_packages(label='abc')

# Get the tested package's lab result.
lab_results = track.get_lab_results(uid=test_package.id)

Retail workflow:

# Get a retail package.
package = track.get_packages(label='abc')

# Create a sales receipts.
track.create_receipts([{...}, {...}])

# Get recent receipts.
sales = track.get_receipts(action='active', start='2021-04-20')

# Update the sales receipt using.
sale = track.get_receipts(uid='420')
sale.total_price = 25
sale.update()

๐Ÿ‘ฉโ€๐Ÿ”ฌ Testing

You can run tests with code coverage with pytest.

pytest --cov=cannlytics tests/

๐Ÿค Contributing

Contributions are always welcome! You are encouraged to submit issues, functionality, and features that you want to be addressed. You can also develop your own new features, fix known issues, and add documentation, tests, and examples. Anyone is welcome to contribute anything. Please see the contributing guide for more information.

โค๏ธ Support

Cannlytics is made available with โค๏ธ and your good will. Please consider making a contribution to keep the good work coming. Thank you ๐Ÿ™

๐Ÿฅž Bitcoin donation address: 34CoUcAFprRnLnDTHt6FKMjZyvKvQHb6c6

๐Ÿ›๏ธ License

Copyright (c) 2021-2022 Cannlytics

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.

cannlytics-engine's People

Contributors

keeganskeate avatar ufosoftwarellc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

ufosoftwarellc

cannlytics-engine's Issues

`logistics.py` and `scraper.py` need tests

Unit tests need to be written for logistics.py and scraper.py in the cannlytics module. The tests should be named logistics_test.py and scraper_test.py and should be located in the tests directory. See firebase_test.py and find_labs_dev.py for examples of unit tests.

A way to test the functions can be to use them to find details for licensed cannabis waste disposal facilities in Oklahoma. Ideally, details can be found for a facility given only it's name, e.g. Egnite Waste Management. A map of facilities can be found at https://oklahoma.gov/omma/businesses/list-of-licensed-businesses/licensed-waste-disposal-facility.html

Examples needed!

A myriad of examples are needed, from use of the lims module to use of the metrc module and some of the more handy utils.

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.