/watchit-toolkit

Building Block Toolkit for WatchIt

Primary LanguagePythonGNU Affero General Public License v3.0AGPL-3.0

Watchit Toolkit (WIP)

All Contributors Gitter CI

Getting started

Quick summary

NOTE! The gateway is alpha-stage software. It means watchit-gateway hasn't been security audited and programming APIs and data formats can still change.

The watchit gateway is an interface or micro framework for the migration of content to IPFS and the distribution of metadata through OrbitDB.

Watchit gateway adds migrated data to the metastore (orbitdb) which is distributed in a predefined scheme to ensure the integrity of the data that is later consumed by the dapp. Watchit gateway provides simple tools for the generation and fetching of content.

Resolvers

"A resolver is a set of instructions, expressed as a Python class. A gateway will execute a resolver to fetch content from various sources that later populate the schema." - @aphelionz

Resolvers implement the logic necessary for fetch, preprocessing, cleaning and schematization of data from any available resource. Based on the following class abstraction we can see the methods required for the development of a resolver:

Define your resolvers modules below.
Ex: Each resolver must implement 2 fundamental methods.

class Dummy:
    def __str__(self) -> str:
        return 'Test'

    def __call__(self, scheme, *args, **kwargs):
       """
        Returned meta should be valid scheme
        Process your data and populate scheme struct
        src/core/scheme/definition.py
        
        :param scheme: MovieScheme object
        :returns: Scheme valid object list ex: {movie1, movie2}
        :rtype Generator[MovieScheme]
        """
        yield data

Please see example

Scheme and Usage

Development

Please make sure you have make installed. Please see instructions for windows install.

Install

make bootstrap to install dependencies

Test

In the project directory, you can run:

make test to run code test and make test-coverage to check code coverage

Lint

In the project directory, you can run: make to run linter or make fix-coding-style to fix linting

More info

Contributors ✨

Thanks goes to these wonderful people (emoji key):


phillmac

💻 📓 🤔 🚇

Mark Robert Henderson

💻 🤔

Echedenyan

🚇

This project follows the all-contributors specification. Contributions of any kind welcome!