Thanks to visit codestin.com
Credit goes to github.com

Skip to content

👍A repository for python template

License

haomiao/monster

Repository files navigation

monster

A repository for python template

The structure template of general project which can provide some userfull files and quickly build,

How to use the general template (skeleton) for your project:

  1. Make copy of the project, the rename it as your new project, for example "project1".
  2. Rename the "monster" dir to the name of yor project or others as your root moudle.
  3. Now, edit your setup.py to what your want to modifing or adding more infomations for your project. and then run "python setup.py check" to check if the setup.py works well.
  4. Rename the tests/project_tests.py to your root module again, for example "project1_tests.py"
  5. Then you should check if you have make it right , so you will use "nosetests" at the root dir; if it ouput as "Ran 1 test in xxx.s ok", so it's all right,others you should fix it again.
  6. Okay, you can start coding for new project now.

Some project(not the monster project) requires modules as:

  1. setuptools
  2. virtualenv or conda or python3 venv
  3. nose
  4. pytest
  5. pandoc
  6. sphinx
  7. and so on

Details:

  1. If you modify the setup.py file, you can visit the website" http://docs.python.org/distutils/setupscript.html".
  2. The general template is the The most simplified, so you can adding more rules as you can do.
  3. Before you install the project, you should install some python packages, as "pip","distribute","nose","virtualenv". pip: install the python packages from PyPI, virtualenv or venv is used to isolate application specific dependencies from a shared Python installation, and nose can be as unit test tools, in fact, the distribute as the standard of Python disutils extension, but it can be replaced by "setuptools".
  4. SomeHow, those tools will not usefull in future, the web site "https://packaging.python.org/current/" can be most useful.

Usefull web sites:

Python Packaging User Guide: https://packaging.python.org/

Distributing Python Modules: https://docs.python.org/3/distributing/index.html

Packaging and Distributing Projects: https://packaging.python.org/distributing/

Python Packaging Authority: https://www.pypa.io/en/latest/

Tool Recommendations: https://packaging.python.org/current/

SetupTools:http://setuptools.readthedocs.io/en/latest/

Cookiecutter:    https://www.pydanny.com/cookie-project-templates-made-easy.html
   https://cookiecutter-pypackage.readthedocs.io/en/latest/

How to begin a python project and some useful tools

  1. python interpreter
  2. virtualenv/venv:build virtual environment
  3. project structure and the command: pip freeze > requirements.txt
  4. pyint: check the python code style and others
  5. pytest/nose/pytest-cov: pytest testing tools
  6. Sphinx: documents generator from source codes, which use reStructuredText as comment statement
  7. ReadTheDocs: continue to document integration
  8. Tox: testing standardization, edit the tox.ini as it's configuration

Others:

  1. git、github、git-flow version control and project management flow
  2. TravisCI: continuous testing integration, edit the .travis.yml as it's configurations
  3. Cookiecutter: automate these steps when starting your next project, in fact, the tool can be do many things as you done before

About

👍A repository for python template

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages