Coder Social home page Coder Social logo

williamren / python3_module_template Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sdpython/python3_module_template

0.0 2.0 0.0 177 KB

a template to create python module including unit tests, Sphinx documentation and setup.

License: Other

Python 84.18% Shell 15.82%

python3_module_template's Introduction

README / Changes

Build status

image

PYPI Package

Links:

Introduction

This project is a skeleton for any new project. It contains:
  • a source folder: src
  • a unit test folder: _unittests, go to this folder and run run_unittests.py
  • a _doc folder: _doc, it will contains the documentation
  • a file setup.py to build and to install the module
All theses steps were only tested on Windows. Suppot for linux will be added later. To create your own project, you need to rename the folder project_name in src by your true module name. You also need to replace project_name wherever it is found:
  • project_var_name = 'project_name' in setup.py, make_help.py and _doc/sphinxdoc/source/conf.py
  • from src.project_name.subproject.myexample import myclass in _unittests/ut_example/test_example.py
  • many places in _doc/sphinxdoc/source/index.rst
  • many places in README.rst

The project is also hosted here where you can find a link to the generated documentation based on this template.

Automation

Adding a new module or subpackage

Any new module or subpackage should be added in src/project_name. Every subfolder should contain a file __init__.py. If the new file needs an existing submodule, you need to add something like the following:

import os,sys

from ..subproject.myexample import myclass

You should use relative imports as much as possible. To add a module at deeper level than the previous one, you should add relative imports in every __init__.py along the way.

Versions

  • 0.0 - 2014/??/??
    • new: first version
    • fix: the setup does not need the file README.rst anymore

python3_module_template's People

Contributors

sdpython avatar

Watchers

william avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.