dotdot-1.1.0
توضیحات
Make it easy to import the modules in parent directories
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | dotdot-1.1.0 |
| نام | dotdot |
| نسخه کتابخانه | 1.1.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Gsllchb |
| ایمیل نویسنده | gsllchb@qq.com |
| آدرس صفحه اصلی | https://github.com/Gsllchb/DotDot |
| آدرس اینترنتی | https://pypi.org/project/dotdot/ |
| مجوز | MIT |
# DotDot
___Make it easy to import the modules in parent directories___
[](https://pypi.org/project/dotdot)
[](https://github.com/Gsllchb/DotDot/blob/master/LICENSE.txt)
If you want to solve `ValueError: attempted relative import beyond top-level package`, **DotDot** may be helpful for you.
## Installation
If it can be installed and imported successfully, it should work correctly.
Install via **pip**:
```console
pip install dotdot
```
## Quick Start
Consider a common project structure as following:
```
FooProject
├── foo
│ ├── script.py
│ └── util.py
└── util.py
```
Now, `script.py` can import those `util`s by importing `dotdot` first. Like this:
```python
import dotdot
import foo.util
import util
```
Moreover, you can import the modules in grandparent or even great grandparent directory by importing `dotdotdot` or `dotdotdotdot` first.
## How It Works
DotDot does this magic by changing `sys.path[0]` in __import time__.
نحوه نصب
نصب پکیج whl dotdot-1.1.0:
pip install dotdot-1.1.0.whl
نصب پکیج tar.gz dotdot-1.1.0:
pip install dotdot-1.1.0.tar.gz