Skip to content
This repository has been archived by the owner on Oct 12, 2020. It is now read-only.
/ cogito-py Public archive

A tiny python library that links against libcogito.

License

Notifications You must be signed in to change notification settings

cogito-lang/cogito-py

Repository files navigation

cogito-py

Build Status PyPI

A tiny python library that links against libcogito.

Usage

>>> import cogito
>>> print cogito.to_json('ALLOW a on b;')
[
  {
    "Effect": "Allow",
    "Action": [
      "a"
    ],
    "Resource": [
      "b"
    ]
  }
]

>>> print cogito.to_iam('[{ "Effect": "Allow", "Action": "a", "Resource": "b" }]')
ALLOW
  a
ON
  b;

If your libcogito library is in a non-standard location, you should set the COGITO_PATH environment variable before you import the cogito module.

import os
os.environ['COGITO_PATH'] = os.path.join(os.getcwd(), 'local', 'lib', 'libcogito.so')
import cogito

Development

To run tests, run py.test. To release a new version:

pip install twine
python setup.py sdist
python setup.py bdist_wheel --universal
twine upload dist/*

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/cogito-lang/cogito-py.

License

The package is available as open source under the terms of the MIT License.

About

A tiny python library that links against libcogito.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages