GitHub - jaysyrk/teleos · GitHub
/" data-turbo-transient="true" />
Skip to content
Search or jump to...
Search code, repositories, users, issues, pull requests...
-->
Search
Clear
Search syntax tips
Provide feedback
--><br>We read every piece of feedback, and take your input very seriously.
Include my email address so I can be contacted
Cancel
Submit feedback
Saved searches
Use saved searches to filter your results more quickly
-->
Name
Query
To see all available qualifiers, see our documentation.
Cancel
Create saved search
Sign in
/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up
Appearance settings
Resetting focus
You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
jaysyrk
teleos
Public
Notifications<br>You must be signed in to change notification settings
Fork
Star
main
BranchesTags
Go to file
CodeOpen more actions menu
Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit
History<br>8 Commits<br>8 Commits
bindings
bindings
examples
examples
playground
playground
teleos-core
teleos-core
teleos
teleos
tests
tests
vscode-teleos
vscode-teleos
.gitignore
.gitignore
LICENSE
LICENSE
README.rst
README.rst
pyproject.toml
pyproject.toml
run-tests.ps1
run-tests.ps1
View all files
Repository files navigation
Teleos
NOTICE: Apparently my timelines seem suspicious on this project, so I wanted to clear that up. While building this i was in a hypomanic episode. I stayed up for days on end hyperfixated on this project then committed it pretty much all at once, similar to how all my other projects get done.
Plain-language logic engine — write rules in English, query from any language.
Think of it like SQL, but for rules instead of data. Instead of writing<br>business logic as if/else code buried in your application, you write it in a<br>.teleos file that reads like English. Any language — Python, Go, JavaScript,<br>C++, C#, Java — can load that file and query it.
fact: alice is admin<br>fact: charlie is user<br>fact: charlie is banned<br>rule: if X is admin then X can access Y<br>rule: if X is user and not X is banned then X can access Y
ask: alice can access document → true<br>ask: charlie can access document → false<br>why: charlie can access document → Cannot prove: charlie can access document<br>Nearest rule failed because: charlie is banned
Install
pip install py-teleos
Quick start
import teleos
engine = teleos.load("rules.teleos")
engine.ask("alice can access document") # True<br>engine.why("alice can access document") # proof string<br>engine.all("WHO can access report") # ["alice", "bob"]<br>engine.add_fact("dave is admin") # add at runtime
CLI
teleos run rules.teleos # run all ask:/why:/all: queries<br>teleos test rules.teleos # run all assert: statements<br>teleos repl rules.teleos # interactive session
.teleos syntax
# facts<br>fact: alice is admin<br>fact: alice has score 95
# rules — variables are ALL CAPS<br>rule: if X is admin then X can access Y<br>rule: if X has score S and S >= 90 then X gets distinction
# negation<br>rule: if X is user and not X is banned then X can post
# import another file<br>import: base-rules.teleos
# queries<br>ask: alice can access document → true / false<br>why: alice can access document → proof explanation<br>all: WHO gets distinction → every matching value
# assertions (for teleos test)<br>assert: alice can access document<br>assert not: charlie can access document
Language bindings
Teleos includes a Rust core (teleos-core) that compiles to a shared library<br>callable from any language via C FFI.
Bindings are available for Go, JavaScript/TypeScript, C++, C#, and Java.
License
MIT
About
No description, website, or topics provided.
Resources
Readme
License
MIT license
Uh oh!
There was an error while loading. Please reload this page.
Activity
Stars
star
Watchers
watching
Forks
forks
Report repository
Releases
No releases published
Packages
Uh oh!
There was an error while loading. Please reload this page.
Contributors
Uh oh!
There was an error while loading. Please reload this page.
Languages
Python<br>31.3%
Rust<br>26.2%
Java<br>7.6%
C#<br>7.5%
C++<br>6.8%
HTML<br>6.8%
Other<br>13.8%
You can’t perform that action at this time.