Skip to main content

syspend

This module recursively searches the parent directory from current directory, and calls sys.path.append(directory: SYSPEND_ROOT file exists)

Usage

In the case, there is a following project.

  • project
    • mypackage.py
    • samples
      • sample.py
    • SYSPEND_ROOT <------- make this file by your self. empty file is ok.

sample.py can import mypackage using syspend.

import syspend
import mypackage

if __name__ == '__main__':
    mypackage.hello()

get_path()

get_path() returns the directory where SYSPEND_ROOT exists.

import syspend

if __name__ == '__main__':
    syspend.get_path()   # output ex: D:\project\samples
    syspend.get_path('ALT_ROOT')   # returns directory where ALT_ROOT file exists.
    syspend.get_path('SYSPEND_ROOT', '../tools')   # output ex: D:\project\tools

syspend()

syspend() calls sys.path.append(directory: SYSPEND_ROOT file exists). when calling import syspend, syspend() is automatically called.

import syspend

if __name__ == '__main__':
    syspend.syspend('ALT_ROOT')   # sys.path.append('directory: ALT_ROOT file exists')
    syspend.syspend('SYSPEND_ROOT', '../tools')   # sys.path.append('D:\project\tools')

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Metadata

Release files for syspend 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for syspend 0.0.3
File Interpreter ABI Platform
syspend-0.0.3-py3.9.egg Legacy Egg format - - Details

Release files / syspend-0.0.3-py3.9.egg

Download URL syspend-0.0.3-py3.9.egg
Size 3.4 kB
Tags Egg
SHA-256 checksum
How to use checksums
094a77c544eef40584e4ba14d89c9f6c9c9ab93dd897171f3ae770cb3c372ab1
BLAKE2b-256 checksum
How to use checksums
c0dc7df1b2aaf2679a98832be1dd0698aec9839d2ff7d53a84f1e5b9606323fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.7

Release history Release notifications | RSS feed

This release

0.0.3 This release

1 release file

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page