Skip to main content

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


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 details)

Uploaded Source

File details

Details for the file ccrootpath-1.2.tar.gz.

File metadata

  • Download URL: ccrootpath-1.2.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.9

File hashes

Hashes for ccrootpath-1.2.tar.gz
Algorithm Hash digest
SHA256 3fdfce81a110dcec681b6b37d9151238923efd920976991301ba7854dbd291c9
MD5 fa8624328d5d3c748af9d08df636d87e
BLAKE2b-256 c0d0d669afe1fc1f83f65a8eecdfa037a7b232fc578d988034875a83f1cae6fd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page