Skip to main content

No project description provided

Project description

Diagnostipy



Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License

About The Project

Diagnostipy is a open-source, Python library for rule-based diagnosis and evaluation. It allows users to define rules with conditions and weights, manage rulesets, and evaluate input data using customizable scoring and confidence functions.

Features

  • Define rules using SymptomRule with customizable conditions, weights, and criticality.
  • Manage collections of rules via SymptomRuleset.
  • Evaluate data using built-in or custom scoring and confidence functions with Evaluator.
  • Flexible and extensible API.

When Should I Use Diagnostipy?

  • When interpretability is more important than accuracy, and you need a clear, rules-based system to explain decision-making
  • If you lack access to large datasets for training machine learning models but still require a structured evaluation or diagnostic tool
  • When collaborating with domain experts to formalize diagnostic or evaluation criteria without a data-driven approach
  • When working in regulated industries or domains where decisions must be auditable and transparent
  • For quick prototyping of logic-based systems without the overhead of complex data pipelines

(back to top)


Getting Started

To get a local copy up and running, follow these steps.

Prerequisites

  • Python 3.10 or later

Installation

Install Diagnostipy using pip:

pip install diagnostipy

(back to top)

Usage

Define Rules

from diagnostipy.core.models.symptom_rule import SymptomRule

rule_high_fever = SymptomRule(
    name="High Fever",
    weight=6.0,
    critical=True,
    apply_condition=lambda data: data.get("temperature", 0) >= 39,
)

rule_cough = SymptomRule(
    name="Persistent Cough",
    weight=4.0,
    critical=False,
    apply_condition=lambda data: data.get("cough", False),
)

rule_sore_throat = SymptomRule(
    name="Sore Throat",
    weight=5.0,
    critical=True,
    apply_condition=lambda data: data.get("sore_throat", False),
)

Create Ruleset

from diagnostipy import SymptomRuleset

ruleset = SymptomRuleset([rule_high_fever, rule_cough, rule_sore_throat])

Evaluate data

from diagnostipy import Evaluator

data = {
    "temperature": 39.5,
    "cough": True,
    "sore_throat": False,
}

evaluator = Evaluator(ruleset)
results = evaluator.run(data=data)

print(results)
total_score=10.0 label='High' confidence=0.8333333333333334 metadata=None

(back to top)

Roadmap

  • Add support for more built-in confidence functions.
  • Improve error handling.
  • Expand the API to include more user-friendly options.

(back to top)

Contributing

We are open to, and grateful for, any contributions made by the community.

A huge thank you to all the contributors.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/some-feature)
  3. Commit your Changes (git commit -m 'Add some feature')
  4. Push to the Branch (git push origin feature/some-feature)
  5. Open a Pull Request

Top contributors:

(back to top)

License

Diagnostipy is distributed under the MIT License.

(back to top)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

diagnostipy-0.1.0.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

diagnostipy-0.1.0-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file diagnostipy-0.1.0.tar.gz.

File metadata

  • Download URL: diagnostipy-0.1.0.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for diagnostipy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6064aa059d0a553eb884e3ca70579ab78fb3b50f32be90619db55b749fd81daa
MD5 241eec89aaff43124a45bd86898c455c
BLAKE2b-256 3cde9204c5aae1fd251e231ace0b165398b860b804d61312a9b57b6a67cc9061

See more details on using hashes here.

File details

Details for the file diagnostipy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: diagnostipy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for diagnostipy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 118a0e57cf6a201cc094e5aa5b4e48027cce6d4c93e7a4330499846f1e14625e
MD5 9f52cd8a2a95e124760a55144426a7a3
BLAKE2b-256 14c0b30089ae934439e0198112f6b88eb1af758c76e3a036aacc5d2aa3e6d172

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page