I am creating pypi
python package and for that i tired many solution avilable in different websites.
- First of all I followed this Approach1, in this approach author has created
class
andfunctions
but when tried this one my package gave me an error thatno module
andclass name is not define
- I tired many other Approaches like this one Approach2 in this approach author created only
functions
withoutclass
and__init__.py
- and then tried this one also which is very common Approach3
and here is important files structure provided by pypi
officials
├── LICENSE
├── README.md
├── example_pkg
│ └── __init__.py
├── setup.py
└── tests
I am ready with my package but after spending whole night finding which one is Best coding practice? and now got confused
so my questions are as follows
- what is the use of file
__init__.py
? - best practice for giving directory, class and functions names so that it will help during importing.because according to these answers some people said import directory name, some said filename followed by class etc..
- Can anyone provide me proper steps so that i can follow in upcoming packages also