Set project root path for importing local modules
Project description
Import project root path to sys.path
for import local files.
Intro
If you have a project with the following structure:
| - my_proj
|
| - my_proj / config / models / account_model.py (class AccountModel)
|
| - my_proj / transaction / checker.py (class Checker)
Use ccrootpath to simplize your import
for local file importing:
import ccrootpath
PROJECT_DIR = ccrootpath.set_project_root_path(__file__, 'my_proj')
from config.models.account_model import AccountModel
from transaction.checker import Checker
How to install
pip3 install ccrootpath --upgrade --user
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 Distribution
ccrootpath-1.2.tar.gz
(2.0 kB
view hashes)