Skip to content

Commit d896bb7

Browse files
authored
CONTENT: readme / documentation text and styles (#6)
This updates text around what we expect for docs and readme. also makes some changes to the styles of the book.
1 parent ac5c988 commit d896bb7

File tree

9 files changed

+650
-26
lines changed

9 files changed

+650
-26
lines changed

CONTRIBUTING.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
1-
# Contributing to this repository
1+
# Contributing Guide for the Python open source software packaging book
22

3-
Most of this repository is structured for **Sphinx**, a documentation engine built in Python.
3+
This is a community resource. We welcome contributions in the form of issues and/or pull requests to this guide.
44

5-
## Build the documentation
5+
* If you have an idea for something that should be included in the guide, [please open an issue here](https://github.com/pyOpenSci/python-package-guide/issues).
6+
* If you find a typo, feel free to [submit a pull request](https://github.com/pyOpenSci/python-package-guide/pulls) to modify the text directly. Or, if you are less comfortable with pull requests, feel free to open an issue.
7+
* If you want to see a larger change to the content of the guide book, please submit an issue first!
8+
9+
## How this guide structured
10+
11+
Most of this repository is structured for **Sphinx**, a documentation engine built in `Python`. We are using the Sphinx Book Theme and the `myST` syntax to create each page in this book.
12+
13+
If you wish to contribute by working on the guide book locally, you
14+
will first need to
15+
16+
1. Fork this repository
17+
2. Clone it locally
18+
3. Build the documentation locally
19+
20+
## Instructions for building the documentation locally on your computer
621

722
The easiest way to build the documentation in this repository is to use `nox`,
823
a tool for quickly building environments and running commands within them.

_templates/header.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!-- custom head content-->
2+
3+
<!-- <link rel="preconnect" href="https://fonts.googleapis.com">
4+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
5+
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&family=Raleway:wght@200;300;400;600&display=swap" rel="stylesheet"> -->
6+
<!-- END custom head content -->
7+

documentation/contributing.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# CONTRIBUTING file and License
2+
3+
## CONTRIBUTING.md File for your Python Package
4+
5+
Your python package should include a file called CONTRIBUTING.md located in the
6+
root of your repository (with your readme file).
7+
8+
### Local development environment information
9+
10+
The contributing file should include information to support a new contributing
11+
building your package locally. This includes:
12+
13+
* instructions for setting up a development environment locally to work on your package
14+
* instructions for how the test suite is setup and run
15+
16+
### Community contribution guidelines
17+
This guide should also include information for someone interested in asking questions,
18+
submitting issues or pull requests:
19+
20+
* Any guidelines that you have in place for users submitting issues, pull requests or asking questions.
21+
* A link to your code of conduct
22+
* A link to or include how your code of conduct is enforced.
23+
24+
```{note}
25+
[The mozilla open workshop has a nice outline of things to consider when
26+
creating a contributing guide](https://mozillascience.github.io/working-open-workshop/contributing/)
27+
```
28+
29+
### License
30+
pyOpenSci projects should use an open source software license that is approved
31+
by the Open Software Initiative (OSI). OSI's website has a
32+
[list of popular licenses](https://opensource.org/licenses), and GitHub has a
33+
[handy tool](https://choosealicense.com/) for choosing a license.
34+
35+
<!--
36+
pyOpenSci packages must:
37+
38+
- Contain full documentation for any user-facing functions.
39+
- Have a test suite that covers the major functionality of the package.
40+
- Use continuous integration.
41+
- Use an OSI approved software license.
42+
43+
**Good/Better/Best:**
44+
- **Good:** Include a open source software license with your package.
45+
- **Better/Best:** Choose a license based on your needs and future use of package, plus explain your choice in your submission for review. -->

documentation/create-readme-files.md

Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
# README File Guidelines and Resources
2+
3+
The **README.md** file is often the first thing that someone sees when they consider
4+
installing your package.
5+
6+
This file is both the landing page of:
7+
8+
* Your file on package manager landing pages like PyPI and Anaconda
9+
* Your package's GitHub repository
10+
11+
Thus, it is important that you spend some time up front creating a high quality
12+
**README.md** file for your Python package.
13+
14+
<!-- # TODO screenshots of landing pages in github and pypi -->
15+
16+
Your README.md file should be located in the root
17+
of your GitHub repository.
18+
19+
<!-- # TODO provide some screenshots of our repo with a readme file -->
20+
21+
## Organizing your README File from the most broad information to the most specific - Cognitive funneling
22+
23+
We suggest organizing the content in your **README** file so that the most broad information is at the top of the file. Information then
24+
becomes more specific
25+
and potentially more technical as the user moves down the file.
26+
27+
```{note}
28+
[Cognitive funneling approach](https://github.com/hackergrrl/art-of-readme#cognitive-funneling) refers to content structure where the most
29+
broad information is at the top and becomes increasingly more specific
30+
and possibly technical lower down in the file.
31+
```
32+
33+
This approach of starting broad and progressively getting more specific
34+
will make your **README** file more accessible and easier-to-digest for a broader group of users. An overly complex or poorly organized **README**
35+
file will likely result in users getting lost, not understanding
36+
what your package does and how it could be useful to them.
37+
38+
39+
<!-- # TODO make a checklist block style -->
40+
41+
````{note}
42+
An editor or the editor in chief will ask you to revise your README file
43+
before a review begins if it does not meet the criteria specified below.
44+
45+
Please go through this list before submitting your package to pyOpenSci
46+
47+
```
48+
### pyOpenSci README checklist
49+
50+
Your README file should have the following information:
51+
- [ ] The name of the package
52+
- [ ] Badges for the packages current published version, documentation and test suite build. (OPTIONAL: test coverage)
53+
- [ ] Easy-to-understand explanation (2-4 sentences) of what your tool does
54+
- [ ] Context for how the tool fits into the broader ecosystem
55+
- [ ] If it's your package is a wrapper, link to the package that it is wrapping and any associated documentation. (If you do'nt know what a wrapper is - this probably doesn't apply to you!)
56+
- [ ] A simple quickstart code example that a user can follow to provide a demonstration of what the package can do for them
57+
- [ ] Links to your packages documentation / website.
58+
- [ ] A few descriptive links to any tutorials you've created for your pacakge.
59+
```
60+
````
61+
62+
A more detailed explanation of every element in this check list is below.
63+
64+
## What your README.md file should contain (bare minimum)
65+
66+
At a minimum, your package's **README.md** file should include
67+
(from top to bottom):
68+
69+
### ✅ Your package's name
70+
Ideally your GitHub repository's name is also the name of your package. The more
71+
self explanatory that name is, the better.
72+
73+
### ✅ Badges for current package version, continuous integration and test coverage
74+
75+
Badges are a useful way to draw attention to the quality of your project and to
76+
assure users that your package is well-designed, tested, and maintained.
77+
It is common to provide a collection of badges towards the top of your
78+
README file for others to quickly browse.
79+
80+
Some badges that you should adding to your README file include:
81+
82+
* Current version of the package on pypi / conda forge (the example badge below provides a github release value in our package guide isn't an installable tool.)
83+
84+
![GitHub release (latest by date)](https://img.shields.io/github/v/release/pyopensci/python-package-guide?color=purple&display_name=tag&style=plastic)
85+
86+
87+
```markdown
88+
Github release
89+
![GitHub release (latest by date)](https://img.shields.io/github/v/release/your-github-org-name/package-repo-name?color=purple&display_name=tag&style=plastic)
90+
```
91+
92+
* Continuous integration Status of tests (pass or fail)
93+
94+
Circle CI badge:
95+
[![CircleCI](https://circleci.com/gh/pyOpenSci/python-package-guide.svg?style=svg)](https://circleci.com/gh/pyOpenSci/python-package-guide)
96+
97+
Example GitHub actions badge:
98+
99+
![Docs Building](https://github.com/pyOpenSci/python-package-guide/actions/workflows/build-book.yml/badge.svg)
100+
101+
```
102+
![Docs Building](https://github.com/pyOpenSci/python-package-guide/actions/workflows/build-book.yml/badge.svg)
103+
```
104+
105+
* Citation badge (DOI). It is OK if you do not have a DOI prior to the review. [![DOI](https://zenodo.org/badge/556814582.svg)](https://zenodo.org/badge/latestdoi/556814582)
106+
107+
Once you package is accepted to pyOpenSci, we will provide you with
108+
a badge to add to your repository that shows that it has been reviewed and accepted into the pyOpenSci scientific Python open source ecosystem!
109+
110+
<!-- # TODO: add a pyopensci accepted badge here -->
111+
112+
```{note}
113+
Beware of the overuse of badges! There is such a thing as too much of a good thing (which can overload a potential user!).
114+
```
115+
116+
### ✅ A short, easy-to-understand description of what your package does
117+
118+
At the top of your README file you should have a short, easy-to-understand, description that details the goals of your package and what purpose it serves. The language in this description should use less technical terms so that a variety of users with varying scientific (and development) backgrounds can understand it.
119+
120+
Consider writing for a 12th grade reading level which is an ideal level for more scientific content that serves a broad user base. The goal of this description to maximize accessibility of your **README** file.
121+
122+
123+
### ✅ BRIEF quickstart code demonstration of how to use the package
124+
125+
Include a code quickstart that demonstrates how to use your package.
126+
This quickstart should be simple.
127+
128+
```{important}
129+
### TOO MUCH OF A GOOD thing
130+
131+
Try to avoid including several tutorials in the readme file itself. This too will overwhelm the user with information.
132+
133+
A short quickstart vignette that shows a user how to use your package is plenty for the README file. All other tutorials and documentation should be presented as descriptive links.
134+
```
135+
136+
### ✅ Descriptive links to package documentation, tutorials or vignettes.
137+
138+
Include descriptive links in your README file to:
139+
140+
* The package's documentation page.
141+
* Tutorials or vignettes that demonstrate application of your package.
142+
143+
### ✅ Discussion of how this package fits within the broader scientific python landscape.
144+
145+
If applicable, describe how the package compares to other similar packages or complementary packages in the scientific Python ecosystem. This discussion can be brief. It's important for package maintainers to consider their package in the context of the broader ecosystem. You will be asked to do this when you submit your package for review for pyOpenSci.
146+
147+
### ✅ Installation instructions
148+
149+
Include instructions for installing your package. If you have published
150+
the package on both `PyPI` and `Conda` be sure to include instructions for both.
151+
152+
### ✅ Document any addition setup required to use you package
153+
154+
Add any additional setup required that someone will need to do before using your package. Examples of additional setup steps including authentication tokens, or critical dependencies that don't get automatically installed when your package is installed.
155+
156+
### ✅ Citation information
157+
158+
Finally be sure to include instructions on how to cite your package.
159+
160+
### ✅ Links to Contributing Guide, Code of Conduct
161+
Last but not least provide direct links to your
162+
**CONTRIBUTING** guide and to your project's **code of conduct**.
163+
164+
165+
```{note}
166+
### README Resources
167+
168+
Below are some resources on creating great README.md files that you
169+
might find helpful.
170+
171+
* [The art of the README GitHub Repo](https://github.com/hackergrrl/art-of-readme)
172+
* [Write a great readme - Bane Sullivan](https://github.com/banesullivan/README)
173+
* [Readme resources from rOpenSci](https://devguide.ropensci.org/building.html#readme)
174+
```
175+
176+
177+
<!--
178+
OLD TEXT
179+
180+
Will ultimately remove this but slowly moving things from difference places
181+
into the same page. this is all commented out for now.
182+
183+
### Badges
184+
185+
Badges are a useful way to draw attention to the quality of your project and to
186+
assure users that it is well-designed, tested, and maintained.
187+
It is common to provide a collection of badges in a table for others
188+
to quickly browse.
189+
190+
[See this example of a badge table](https://github.com/ropensci/drake). Such a table should be more wide than high. (Note that the badge for pyOpenSci peer-review will be provided upon acceptance.)
191+
192+
193+
# README.md File Best Practices
194+
195+
## Adding a Readme file.. Python Package Documentation
196+
197+
Documentation is as important to the success of your Python open source package
198+
as the code itself. While quality code is valuable as it gets the tasks that your
199+
package seeks to achieve, completed, if users don't understand how to use the
200+
tools in your package then they won't use your tool.
201+
202+
## Documentation elements that we look for when reviewing a Python package
203+
204+
In the pyOpenSci peer review process we look for several things when evaluating
205+
package documentation including:
206+
207+
1. A clear and to the point README file
208+
2. Documentation of the funcaintliy of your code. This is often setup using Sphinx/ Read the docs or some other documentation platform
209+
3. Sufficient API documentation of your packages API (this means that docstrings are formatted with explanations of each variable and better yet quick vignettes that demonstrate how to use the function or class)
210+
-->
211+

documentation/index.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Intro: Document Your Python Package
2+
3+
```{attention}
4+
🚧 UNDER CONSTRUCTION - THIS CONTENT SHOULD BE FURTHER DEVELOPED BY THE END OF 2022! KEEP CHECKING BACK TO UPDATES AS THEY ARE IN PROGRESS🚧
5+
```
6+
## Documentation is critical to the success of your Python open source package
7+
8+
Documentation is as important to the success of your Python open source package
9+
as the code itself. While quality code is valuable as it gets the tasks that your
10+
package seeks to achieve, completed, if users don't understand how to use the
11+
tools in your package then they won't use your tool.
12+
13+
## Documentation elements that we look for when reviewing a Python package
14+
15+
In the pyOpenSci peer review process we look for several things when evaluating
16+
package documentation including:
17+
18+
1. A clear and to the point **README.md** file
19+
2. Documentation of the functionality of your code. This is often setup using Sphinx/ Read the docs or some other documentation platform
20+
3. Sufficient API documentation of your packages API (this means that docstrings are formatted with explanations of each variable and better yet quick vignettes that demonstrate how to use the function or class). If you don't know what API documentation means this section is FOR YOU!
21+
4. A **CONTRIBUTING.md** file that has clear instructions that others can follow to setup a development environment. This will support others contributing to your project.
22+
5. A license file that helps people
23+
24+
<!-- # TODO LINK TO CI BUILD examples FOR Documentation - we have plenty in our repos already for folks to look at. -->
25+
26+
27+
28+
29+
30+
<!--
31+
Commenting this out for now - it will be moved to another section
32+
33+
## Other recommendations
34+
### Python version support
35+
You should always be explicit about which versions of Python your package supports.
36+
Keeping compatibility with old Python versions can be difficult as functionality changes.
37+
A good rule of thumb is that the package should support, at least,
38+
the latest three Python versions (e.g., 3.8, 3.7, 3.6).
39+
40+
### Code Style
41+
pyOpenSci encourages authors to consult [PEP 8](https://www.python.org/dev/peps/pep-0008/) for information on how to style your code.
42+
43+
### Linting
44+
An automatic linter (e.g. flake8) can help ensure your code is clean and free of syntax errors. These can be integrated with your CI. -->
45+
46+

0 commit comments

Comments
 (0)