twine were the two fundamental packages.
build package literally builds a repository into a distributable compressed file.
This simple command
python3 -m build will create a
dist/ directory which contains the
twine can directly upload your repository to
testpypi is nothing more than a test version of
pypi. This comes in handy before you publish to
pypi in order to get an exact preview.
The following is the project tree structure of my
tictronome package. Starting from the top,
LICENSE file is a simple text file that contains an open source license. The MIT license is widely used.
README.md should contain instructions on how to install and use your package. I personally recommend creating a separate readme file for
pypi since it does not render images in my
assets folder. For convenience I just used the same
README.md file for my GitHub repo.
assests directory contains images and resources associated with my
build/ is automatically created by running the
pyproject.toml contains configurations of your build system, such as the version of
setup.cfg is the core configuration file. This will be a roadmap to your build. The
.cfg file is a static config file. However you can also use a dynamic configuration file(
setup.py). I decided to use the static configfile from this documentation.
test/ contains simple tests for my main scripts.
I used the
src directory to be my package directory. So if I do a
pip install tictronome, then I can import code in the following way.
Tic in the first line is a class defined in
Even after some trial and error, I was not able to perform a direct import. In other words, I could not do this.
Still trying to figure out how I could make this happen.
Also, on my next build, I’m considering to use a dynamic configuration file(
setup.py) and not use the
build package and only using the