Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose YAML object class in SDK #10

Closed
buddha314 opened this issue May 9, 2023 · 3 comments · Fixed by #14
Closed

Expose YAML object class in SDK #10

buddha314 opened this issue May 9, 2023 · 3 comments · Fixed by #14
Assignees
Labels
enhancement New feature or request

Comments

@buddha314
Copy link

Feature Request

While using the Python SDK, it would be useful to construct the fact.yaml, rules.yaml etc programmatically. If these are translated into classes, perhaps expose that class and allow pr.load_rules(R) where R = pr.RulesClass()

@dyumanaditya
Copy link
Contributor

Thanks again @buddha314 we'll get this working soon too

@dyumanaditya dyumanaditya self-assigned this May 11, 2023
@dyumanaditya dyumanaditya added the enhancement New feature or request label May 11, 2023
@dyumanaditya dyumanaditya linked a pull request Jun 11, 2023 that will close this issue
22 tasks
@dyumanaditya dyumanaditya mentioned this issue Sep 28, 2023
22 tasks
@buddha314
Copy link
Author

Are there code examples for this functionality?

@dyumanaditya
Copy link
Contributor

YAML files are no longer supported. Rules should be input into pyreason in string format.

You can load a single rule with pr.add_rule and load a file with a rule on each new line with pr.add_rules_from_file. Same with facts. An example of this can be seen here. Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants