Skip to main content

Let's describe alowed rules!

Project description

Describe rules for domain

Usage example:

import json
from domainrules import Domain, Rule
from domainrules.fabric import NewRule

#1. Set rules decorators
domain = Domain("")
# default bal - 0
base_rule = Rule(domain).set_rules(bal=0)
system_domain_rules: list[dict]
for rule in system_domain_rules:
    rule_dict = json.loads(rule)
    base_rule = NewRule.build(base_rule, rule_dict)

#2. apply
system_domain_rules.name = "somedomain.com"
if system_domain_rules.weight > 50:
    print("Warning!")

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

domainrules-0.1.15.1.tar.gz (5.5 kB view hashes)

Uploaded Source

Built Distribution

domainrules-0.1.15.1-py3-none-any.whl (9.2 kB view hashes)

Uploaded Python 3

Supported by

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