We're very happy about every contribution! :)
You can contribute in many ways:
Look through the GitHub issues: If there is nobody assigned for an issue it is open to whoever wants to implement it.
Python Mediawiki Tools could always use more documentation, whether as part of the official Python Mediawiki Tools docs, in docstrings, or even on the web in blog posts, articles, and such.
The best way to send feedback is to file an issue at https://github.com/4training/pywikitools/issues.
If you are proposing a feature:
- Explain in detail how it would work.
- Keep the scope as narrow as possible, to make it easier to implement.
- Remember that this is a volunteer-driven project, and that contributions are welcome :)
Ready to contribute? Here's how to set up pywikitools for local development.
Fork the pywikitools repo on GitHub.
Clone your fork locally:
$ git clone [email protected]:your_name_here/pywikitools.git
Follow the setup instructions in README.rst
Create a branch for local development:
$ git checkout -b name-of-your-bugfix-or-feature
Now you can make your changes locally.
When you're done making changes, check that all tests still pass and that flake8 has nothing to complain:
$ python3 -m unittest discover -s pywikitools/test $ flake8 .
Commit your changes and push your branch to GitHub:
$ git add . $ git commit -m "Your detailed description of your changes." $ git push origin name-of-your-bugfix-or-feature
Submit a pull request through the GitHub website.
- Please write good and readable code with meaningful documentation.
- We try to follow the PEP 8 style guide ( https://pep8.org/ ) with the exception that lines can have up to 120 spaces.
- Every script should print documentation on arguments when run without or with incorrect arguments
Every script should implement good logging (see https://docs.python.org/3/howto/logging.html ). Look at translateodt.py for examples. Details:
- Create a named logger object (and only use this object for logging)
logger = logging.getLogger('pywikitools.scriptname')
- Implement -l / --loglevel argument
- Standard log level is WARNING. INFO adds relevant information. DEBUG is for verbose debugging.
- ERROR means script couldn’t finish as expected
Before you submit a pull request, check that it meets these guidelines:
- The pull request should include tests.
- If the pull request adds functionality, the docs should be updated. Minimum is to make sure functions have correct docstrings.
- Write meaningful commit messages
To run a subset of tests:
$ python3 pywikitools/test/test_script.py