fair-test is a library to build and deploy FAIR metrics tests APIs supporting the specifications used by the FAIRMetrics working group.

Overview

☑️ FAIR test

Version Python versions

Run tests Publish to PyPI CodeQL Coverage

fair-test is a library to build and deploy FAIR metrics tests APIs supporting the specifications used by the FAIRMetrics working group.

It aims to enable python developers to easily write, and deploy FAIR metric tests functions that can be queried by various FAIR evaluations services, such as FAIR enough and the FAIRsharing FAIR Evaluator

Feel free to create an issue, or send a pull request if you are facing issues or would like to see a feature implemented.

ℹ️ How it works

The user defines and registers custom FAIR metrics tests in separated files in a specific folder (the metrics folder by default), and start the API.

Built with FastAPI, pydantic and RDFLib. Tested for Python 3.7, 3.8 and 3.9

📥 Install the package

Install the package from PyPI:

pip install fair-test

🐍 Build a FAIR metrics test API

Checkout the example folder for a complete working app example to get started, including a docker deployment.

If you want to start from a project with everything ready to deploy in production we recommend you to fork the fair-enough-metrics repository.

📝 Define the API

Create a main.py file to declare the API, you can provide a different folder than metrics here, the folder path is relative to where you start the API (the root of the repository):

from fair_test import FairTestAPI

app = FairTestAPI(
    title='FAIR Metrics tests API',
    metrics_folder_path='metrics',
    description="""FAIR Metrics tests API""",
    cors_enabled=True,
    license_info = {
        "name": "MIT license",
        "url": "https://opensource.org/licenses/MIT"
    },
)

Create a .env file to provide informations used for the API, such as contact details and the host URL (note that you don't need to change it for localhost in development), e.g.:

HOST="metrics.api.fair-enough.semanticscience.org"
BASE_URI="https://metrics.api.fair-enough.semanticscience.org"
CONTACT_URL="https://github.com/MaastrichtU-IDS/fair-enough-metrics"
CONTACT_NAME="Vincent Emonet"
CONTACT_EMAIL="[email protected]"
CONTACT_ORCID="0000-0000-0000-0000"
ORG_NAME="Institute of Data Science at Maastricht University"
DEFAULT_SUBJECT="https://doi.org/10.1594/PANGAEA.908011"

🎯 Define a FAIR metrics test

Create a a1_my_test.py file in the metrics folder with your test:

0: self.success(f'{len(g)} triples found, test sucessful') else: self.failure('No triples found, test failed') return self.response()">
from fair_test import FairTest

class MetricTest(FairTest):
    metric_path = 'a1-check-something'
    applies_to_principle = 'A1'
    title = 'Check something'
    description = """Test something"""
    author = 'https://orcid.org/0000-0000-0000-0000'
    metric_version = '0.1.0'

    def evaluate(self):
        self.info(f'Checking something for {self.subject}')
        g = self.getRDF(self.subject, use_harvester=False)
        if len(g) > 0:
            self.success(f'{len(g)} triples found, test sucessful')
        else:
            self.failure('No triples found, test failed')
        return self.response()

A few common operations are available on the self object, such as logging or retrieving RDF metadata from a URL.

🦄 Deploy the API

You can then run the metrics tests API on http://localhost:8000 with uvicorn, e.g. with the code provided in the example folder:

cd example
pip install -r requirements.txt
uvicorn main:app --reload

Checkout in the example/README.md for more details, such as deploying it with docker.

🧑‍💻 Development

📥 Install for development

Clone the repository and install the dependencies locally for development:

git clone https://github.com/MaastrichtU-IDS/fair-test
cd fair-test
pip install -e .

You can try to use a virtual environment to avoid conflicts, if you face issues:

# Create the virtual environment folder in your workspace
python3 -m venv .venv
# Activate it using a script in the created folder
source .venv/bin/activate

✔️ Run the tests

Install pytest for testing:

pip install pytest

Run the tests locally (from the root folder) and display prints:

pytest -s

📂 Projects using fair-test

Here are some projects using fair-test to deploy FAIR test services:

You might also like...
♻️ API to run evaluations of the FAIR principles (Findable, Accessible, Interoperable, Reusable) on online resources

♻️ FAIR enough 🎯 An OpenAPI where anyone can run evaluations to assess how compliant to the FAIR principles is a resource, given the resource identif

This is simply code for bitcoin fair value.

About The Project This is a code for bitcoin fair value, its simply exclude bubble data using RANSAC method, and then plot the results. Check youtube

Fairstructure - Structure your data in a FAIR way using google sheets or TSVs

Fairstructure - Structure your data in a FAIR way using google sheets or TSVs. These are then converted to LinkML, and from there other formats

MONAI Deploy App SDK offers a framework and associated tools to design, develop and verify AI-driven applications in the healthcare imaging domain.
MONAI Deploy App SDK offers a framework and associated tools to design, develop and verify AI-driven applications in the healthcare imaging domain.

MONAI Deploy App SDK offers a framework and associated tools to design, develop and verify AI-driven applications in the healthcare imaging domain.

Gathers data and displays metrics related to climate change and resource depletion on a PowerBI report.

Apocalypse Status Dashboard Purpose Climate change and resource depletion are grave long-term dangers. The code in this repository will pull data from

🐍 The official Python client library for Google's discovery based APIs.

Google API Client This is the Python client library for Google's discovery based APIs. To get started, please see the docs folder. These client librar

The official Python client library for the Kite Connect trading APIs

The Kite Connect API Python client - v3 The official Python client for communicating with the Kite Connect API. Kite Connect is a set of REST-like API

🐍 The official Python client library for Google's discovery based APIs.

Google API Client This is the Python client library for Google's discovery based APIs. To get started, please see the docs folder. These client librar

AuthGG is a Python library for dealing with Auth.gg apis

AuthGG AuthGG is a Python library for dealing with Auth.gg apis Installation Use the package manager pip to install requests Add the auth.py file in y

Releases(0.0.10)
  • 0.0.10(Nov 23, 2022)

  • 0.0.9(Nov 23, 2022)

    Changes

    • Move the process to harvest metadata for a URL to a separate class MetadataHarvester

    Full Changelog: https://github.com/MaastrichtU-IDS/fair-test/compare/0.0.8...0.0.9

    Source code(tar.gz)
    Source code(zip)
  • 0.0.8(Sep 21, 2022)

    Changelog

    • Migrated from setup.py to using pyproject.toml with Hatch as build backend
    • Improved development workflow to use hatch virtual environment management capabilities

    Full Changelog: https://github.com/MaastrichtU-IDS/fair-test/compare/0.0.7...0.0.8

    Source code(tar.gz)
    Source code(zip)
  • 0.0.7(May 13, 2022)

    Changelog

    • Enable to define readme url and contact infos in each metric test
    • Improve support for signposting links in retrieve_metadata(): extracting meta, alternate and describedby

    Full Changelog: https://github.com/MaastrichtU-IDS/fair-test/compare/0.0.6...0.0.7

    Source code(tar.gz)
    Source code(zip)
  • 0.0.6(Apr 4, 2022)

    Changelog

    • Various improvements to the FairTestEvaluation helpers to extract metadata
    • retrieve_rdf() has been renamed to retrieve_metadata(), and can now return JSON as a fallback if RDF metadata is not found
    Source code(tar.gz)
    Source code(zip)
  • 0.0.5(Mar 28, 2022)

  • 0.0.4(Mar 28, 2022)

    Changelog

    • FAIR Tests now also returns metadata they retrieved during the process (provided as hashmap under the predicate http://semanticscience.org/resource/metadata)
    • Add new helpers functions such as extract_prop(g, props_list) or extract_data_uri(g)
    • Refactor name of functions to use snake case style consistently
    • Don't print() anymore when using self.log() to avoid too much logs
    • Now also tested for python 3.10
    • Improve tests
    Source code(tar.gz)
    Source code(zip)
  • 0.0.3(Feb 15, 2022)

  • 0.0.2(Feb 15, 2022)

  • 0.0.1(Feb 14, 2022)

Owner
Maastricht University IDS
Institute of Data Science at Maastricht University
Maastricht University IDS
The community bot for the Python Discord community

Python Utility Bot This project is a Discord bot specifically for use with the Python Discord server. It provides numerous utilities and other tools t

Python Discord 998 Jan 03, 2023
trackbranch is a tool for developers that can be used to store collections of branches in the form of profiles.

trackbranch trackbranch is a tool for developers that can be used to store collections of branches in the form of profiles. This can be useful for sit

Kevin Morris 1 Oct 21, 2021
The most fresh and updateable Telegram userbot. By one of the most active contibutors to GeekTG

Installation Script installation: Simply run this command out of root: . (wget -qO- http://gg.gg/get_hikka) Manual installation: apt update && apt in

Dan Gazizullin 150 Jan 04, 2023
Multipurpose Discord bot hosted on replit.com

RockyBot Multipurpose Discord bot hosted on https://replit.com/ Installing Dependencies Install poetry through pip: pip install poetry Then simply exe

Rocky 2 May 18, 2022
Telegram Radio - A User-bot who continuously play random audio files (from the famous telegram music channel @mveargasm) in the intended voice chat.

MvEargasmDJ: This is my submission for the Telegram Radio Project of Baivaru. Which required a userbot to continiously play random audio files from th

eyaadh 24 Nov 12, 2022
📅 Calendar file generator for triathlonlive.tv upcoming events

Triathlon Live Calendar Calendar file generator for triathlonlive.tv upcoming events. Install Requires Python 3.9.4 and Poetry. $ poetry install Runni

Eduardo Cuducos 4 Sep 02, 2022
Python client for numerbay.ai - the Numerai community marketplace

NumerBay Python API Programmatic interaction with numerbay.ai - the Numerai community marketplace. If you encounter a problem or have suggestions, fee

Numerai Council of Elders 5 Nov 30, 2022
A python library for creating Slack slash commands using AWS Lambda Functions

slashbot Slashbot makes it easy to create slash commands using AWS Lambda functions. These can be handy for creating a secure way to execute automated

Eric Brassell 17 Oct 21, 2022
A telegram to pyrogram json bot

Pyrogram-Json-Bot A telegram to pyrogram json bot Please fork this repository don't import code Made with Python3 (C) @FayasNoushad Copyright permissi

Fayas Noushad 11 Dec 20, 2022
Sync mastodon toot and Telegram channel or group in both direction.

Sync mastodon toot and telegram channel or group in both direction.

Littlebear0729 7 Dec 18, 2022
Python functions to run WASS stereo wave processing executables, and load and post process WASS output files.

wass-pyfuns Python functions to run the WASS stereo wave processing executables, and load and post process the WASS output files. General WASS (Waves

Mika Malila 3 May 13, 2022
Freqtrade is a free and open source crypto trading bot written in Python.

Freqtrade is a free and open source crypto trading bot written in Python. It is designed to support all major exchanges and be controlled via Telegram. It contains backtesting, plotting and money man

Kazune Takeda 5 Dec 30, 2021
Acid's Utilities is a bot for my Discord server that alerts when I go live, welcomes new users, has some awesome games and so much more!

Acid's Utilities Acid's Utilities is a bot for my Discord server that alerts when I go live, welcomes new users, has some awesome games and so much mo

AcidFilms (Fin Stuart) 3 Nov 19, 2021
A feishu bot daily push arxiv latest articles.

arxiv-feishu-bot We develop A simple feishu bot script daily pushes arxiv latest articles. His effect is as follows: Of course, you can also use other

huchi 6 Apr 06, 2022
This is a Innexia Chat Bot Open Source Code 🤬

⚡ Innexia ⚡ A Powerful, Smart And Simple Chat Bot ... Written with Python... Available on Telegram as @InnexiaChatBot ❤️ Support ⭐️ Thanks to everyone

Dark Cyber 4 Oct 02, 2022
IOGen - An Open source discord token generator

_____ ____ _____ |_ _/ __ \ / ____| | || | | | |

0xVichy#1234 85 Nov 03, 2022
Notion API Database Python Implementation

Python Notion Database Notion API Database Python Implementation created only by database from the official Notion API. Installing / Getting started p

minwook 78 Dec 19, 2022
Fastest Tiktok Username checker on site.

Tiktok Username Checker Fastest Tiktok Username checker on site

sql 3 Jun 19, 2021
Python Telegram Bot Template

Python Telegram Bot Template Concepts Customizable python-telegram-bot template implementing code refactoring to streamline development process: handl

Jansen A. Simanullang 1 Jan 25, 2022
A Telelgram Bot to Extract Text from an Image

Text-Scanner-OCR A Telelgram Bot to Extract Text from an Image Configs Vars API_KEY: Your API_KEY from OCR Space GROUP: Your Group Username without '@

ALBY 8 Feb 20, 2022