find-class-0.0.1
توضیحات
Finds a python-thing, like a class, a function or a variable by string and loads it
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | find-class-0.0.1 |
| نام | find-class |
| نسخه کتابخانه | 0.0.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Thomas Deniffel |
| ایمیل نویسنده | tdeniffel@gmail.com |
| آدرس صفحه اصلی | https://github.com/tom-010/find_class |
| آدرس اینترنتی | https://pypi.org/project/find-class/ |
| مجوز | Apache2 |
find_class
==========
This little package finds and loads a class by fully qualified string.
Let's assume there is a file in `package/sub/animal.py` with
```python
class Animal:
def say_somthing(self):
return 'wau'
def a_little_function():
return 'wuff'
a_tone = 'wiiiiii'
```
Then, you can use `find_class` to get from a string to the python-thing:
```python
a = find_class('package.sub.animal.Animal')().say_something()
b = find_class('package.sub.animal.a_little_function')()
c = find_class('package.sub.animal.a_tone')
assert a == 'wau'
assert b == 'wuff'
assert c == 'wiiiiii'
```
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3 | Python |
نحوه نصب
نصب پکیج whl find-class-0.0.1:
pip install find-class-0.0.1.whl
نصب پکیج tar.gz find-class-0.0.1:
pip install find-class-0.0.1.tar.gz