From throw-away to quality code

Who do I want to work with?

Who do I want as users?

Notebook

Library

Command line tool

GUI

Website

Who do I want to avoid?

Authorship

Programming → Creative

Programmer → Copyright

Works for employer are owned by the employer

Works for hire are owned by the creator

Rights of the author

  • Distribution
  • Copy
  • Acknowledgement
  • Moral

License

Open Source

Copyright

Copyleft

Common licenses

GPLv3

LGPL

MIT

BSD 3 Clause

Apache

Creative Commons NC-SA

Software Quality

Issues

  • issues
  • patches
  • forum/maillist
http://issuetracker.deltares.nl
http://oss.deltares.nl

Style guide


# official style
pep8 
# pep8 + logical errors + complexity
flake8
# extra style + errors
pylint 

Tests

Unit tests

doctests

build.deltares.nl

Documentation

Sphinx

sphinx-doc.org

Read the docs

readthedocs.org

Example

Requests

github.com/kennethreitz/requests
  • License?
  • Author?
  • Tests?
  • Quality?
  • Revisions?
  • Committers?
  • Docs?

Tutorial

Starters

  1. Use pep8 to check your code
  2. Write a unit test
  3. Consider a license
  4. Document your functions

Extra

  1. packaging.python.org
  2. Download sample project
  3. Adapt with your code