Analyzing stock has never been easier.
Project description
finlab
Analyzing stock has never been easier.
Encryption
Prerequirements
pip install --upgrade google-cloud-storage
export GOOGLE_APPLICATION_CREDENTIALS=path_of_the_credentials
Create an encrypted module
- name the module as
yourModule_encrypted.pyin any package - run the following script
python encryption.py generate packageA packageB ...
It will automatically generate yourModule.py, so that the user can import it seamlessly.
Notes
When importing the *_encrypted.py from other py files (self dependencies), the following rules should be followed, otherwise the production version may throw errors.
- Use
import package.moduleNameinstead ofimport package.moduleName_encrypted - Avoid using
from package.moduleName import some_function, use
instead.import package.moduleName as m m.some_function - Avoid using relative import in
moduleName_encryption.py.
Upload encrypted modules
run the following script
python encryption.py upload packageA packageB ...
A folder encrypted_py_file will be created.
The folder contains all files with the postfix *_encrypted.py of packages.
Inside the folder, the sourcedefender module is called to encrypt *_encrypted.py -> *_encrypted.pye
Finally, all files *_encrypted.pye are uploaded to cloud storage.
Scope of encrypted modules
When the user imports an encrypted module, the system loads the module in the following order:
- local version
*_encrypted.py - online version
packageName__encrypted.pyeif user is VIP - a shallow module that has functions that throw errors. A developer with the source code default to importing the local module. However, an online test is still necessary.
Testing the online encrypted version of the module
To test the online version, a developer can use the following commands to hide or show the *_encrypted.py:
python encryption.py hide packageA packageB ...
python encryption.py show packageA packageB ...
When *_encrypted.py is hidden, an online version of the file is automatically loaded.
When hiding a file such as yourFile_encrypted.py, the file will be renamed to ".yourFile_encrypted.py", so you can still find it with the command ls --all.
How to update the official package:
- change the version of setup.py and finlab/init.py
- source upload.sh (with password)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file finlab-0.1.22.dev1-py3-none-any.whl.
File metadata
- Download URL: finlab-0.1.22.dev1-py3-none-any.whl
- Upload date:
- Size: 52.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.22.0 setuptools/51.0.0.post20201207 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ba58b2d07eb959afb72571470d5694bb70d07d59dbe8c4852b48cdcb6a5ae07
|
|
| MD5 |
8a8d62b332e222737aba1c1154d8dff4
|
|
| BLAKE2b-256 |
391b40dd9a696627ee5e95f526ea4f937a819e3a950b45cd1edd40a8ff64ebcd
|