README usage instructions

This commit is contained in:
2021-10-17 21:09:34 +02:00
parent b5e659fc59
commit c4dd980267

View File

@@ -9,13 +9,26 @@ Protect yourself and your customers with database encryption.
Installation Installation
============ ============
::
pip install cryptbase pip install cryptbase
You can also install the in-development version with::
pip install git+ssh://git@https://code.eghuro.com/cryptbase/python-cryptbase.git@master Usage
============
You can use cryptbase with django ORM or witg SQLAlchemy.
To use with SQLAlchemy:
from cryptbase import EncryptedText
sensitive = Column(EncryptedText(key=DB_KEY))
To use with django:
from cryptbase import EncryptedTextField
sensitive = EncryptedTextField(key=DB_KEY)
DB_KEY is 32 bytes encryption key as hex encoded string. Fields behave as TEXT fields, data are transparently encrypted
when storing into the database and decrypted on retrieval.
Development Development
@@ -24,20 +37,3 @@ Development
To run all the tests run:: To run all the tests run::
tox tox
Note, to combine the coverage data from all the tox environments run:
.. list-table::
:widths: 10 90
:stub-columns: 1
- - Windows
- ::
set PYTEST_ADDOPTS=--cov-append
tox
- - Other
- ::
PYTEST_ADDOPTS=--cov-append tox