Code Monkey home page Code Monkey logo

pyproject-structure-example's Introduction

Example-python-project-structure

This is a simple example of the overall organization of a Python project based on best practices.

  • ./bin - directory for storing binary files and for keeping executable files, primarily.
    • don't give executables .py extension, even if they are Python source files.
    • don't put any code in them except an import of and call to a main function defined somewhere else in projects
    • other folders containing non-essential programs can be /usr/bin, /usr/local/bin etc
  • ./doc - package reference documentation
  • ./etc - non-Python files that are to be regarded as external to the project source files, but have to be initialized with some values when application starts running
  • ./lib - static-link libraries, used for building .dlls, C extensions
    • stored files which containing machine code that cannot be executed directly
  • ./project - the code of interest
    • application startup registered in one of the scripts
    • don't put source in a directory called src or lib, this makes it hard to run without installing
    • if project is expressable as a single Python source file, then put it into the directory and name it something related to your project: Project/project.py
  • ./project/test - package integration and unit tests
    • test directory in one of two places: under the package directory containing test code and resources or as a stand-alone top level directory
  • ./project/native - put non-Python sources such as C++ for pyd/so binary extension modules
  • ./data - may contain external data from third party sources, intermediate data, final processed data, original data and etc.
  • ./scripts - for that kind of command-line interface stuff
  • ./var - files that may be created or modified by the application during execution
  • .LICENSE - lawyering up
  • .Makefile - generic management tasks
  • .requirements.txt - development dependencies
  • .setup.py - package and distribution management
Project/
|-- bin/
|   |-- project
|
|-- doc/
|-- etc/
|-- lib/
|-- project/
|	|-- native/
|   |-- test/
|   |   |-- __init__.py
|   |   |-- test_main.py
|   |   
|   |-- __init__.py
|   |-- main.py
|
|-- data/
|-- scripts/
|-- var/
|-- .gitignore
|-- LICENSE
|-- Makefile
|-- README.me
|-- TODO.me
|-- requirments.txt
|-- setup.py

pyproject-structure-example's People

Contributors

qovaxx avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.