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, weather 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 GitHub 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 git@github.com:your_name_here/pywikitools.git
-
Follow the setup instructions in README.md
-
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 are passing 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 meaningful 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 do our best to follow the PEP 8 style guide (PEP 8)
with the exception that lines can have up to
120 characters
. - Every script should print documentation on arguments when run without or with incorrect arguments.
Every script should implement good logging (
see Python Logging). 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 the 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. The 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