Skip to content

Instantly share code, notes, and snippets.

@minorsecond
Created May 19, 2015 00:01
Show Gist options
  • Save minorsecond/915b690c1f12d973bfb9 to your computer and use it in GitHub Desktop.
Save minorsecond/915b690c1f12d973bfb9 to your computer and use it in GitHub Desktop.
Sqlalchemy/Sqlcipher code
if encryption is True:
print("***PYPER TIMESHEET UTILITY***")
print("\nEnter encryption password below:")
key = getpass.getpass()
DB_NAME = ".timesheet.db?cipher=aes-256-cfb&kdf_iter=64000"
engine = create_engine('sqlite:///{}'.format(DB_NAME), module=sqlite)
else:
print("WARNING: Unencrypted session. Install pysqlcipher3 to enable encryption\n")
engine = create_engine('sqlite:///{}'.format(DB_NAME))
DBSession = sessionmaker(bind=engine)
session = DBSession()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment