@@ -9,7 +9,7 @@ This project seeks to quantify the size and diversity of the commons--the
99collection of works that are openly licensed or in the public domain.
1010
1111
12- ## Code of Conduct
12+ ## Code of conduct
1313
1414[ ` CODE_OF_CONDUCT.md ` ] ( CODE_OF_CONDUCT.md ) :
1515> The Creative Commons team is committed to fostering a welcoming community.
@@ -27,59 +27,98 @@ collection of works that are openly licensed or in the public domain.
2727See [ ` CONTRIBUTING.md ` ] ( CONTRIBUTING.md ) .
2828
2929
30-
3130## Development
3231
3332
3433### Prerequisites
3534
3635This repository uses [ pipenv] [ pipenvdocs ] to manage the required Python
3736modules:
38- - Linux: [ Installing Pipenv] [ pipenvinstall ]
39- - macOS:
40- 1 . Install [ Homebrew] [ homebrew ]
41- 2 . Install pipenv:
42- ```
37+ 1 . Install ` pipenv ` :
38+ - Linux: [ Installing Pipenv] [ pipenvinstall ]
39+ - macOS:
40+ 1 . Install [ Homebrew] [ homebrew ]
41+ 2 . Install pipenv:
42+ ``` shell
4343 brew install pipenv
4444 ```
45+ - Windows: [Installing Pipenv][pipenvinstall]
46+ 2. Create the Python virtual environment and install prerequisites using
47+ ` pipenv` :
48+ ` ` ` shell
49+ pipenv sync --dev
50+ ` ` `
4551
4652[pipenvdocs]: https://pipenv.pypa.io/en/latest/
53+ [pipenvinstall]: https://pipenv.pypa.io/en/latest/installation/
4754[homebrew]: https://brew.sh/
48- [pipenvinstall]: https://pipenv.pypa.io/en/latest/install/#installing-pipenv
4955
5056
51- ### Running Scripts that Require Client Credentials
57+ # ## Running scripts that require client cedentials
5258
53- To successfully run scripts that require client credentials, you will need to follow these steps:
54- 1. Copy the contents of the `env.example` file in the script's directory to `.env`:
55- ```
56- cp env.example .env
57- ```
58- 2. Uncomment the variables in the `.env` file and assign values as needed. See [`sources.md`](sources.md) on how to get credentials:
59- ```
60- GOOGLE_API_KEYS=your_api_key
61- PSE_KEY=your_pse_key
62- ```
63- 3. Save the changes to the `.env` file.
59+ To successfully run scripts that require client credentials, you will need to
60+ follow these steps:
61+ 1. Copy the contents of the ` env.example` file in the script' s directory to
62+ `.env`:
63+ ```shell
64+ cp env.example .env
65+ ```
66+ 2. Uncomment the variables in the `.env` file and assign values as needed. See
67+ [`sources.md`](sources.md) on how to get credentials:
68+ ```
69+ GOOGLE_API_KEYS=your_api_key
70+ PSE_KEY=your_pse_key
71+ ```
72+ 3. Save the changes to the `.env` file.
73+ 4. You should now be able to run scripts that require client credentials
74+ without any issues.
75+
76+
77+ ### Static analysis
6478
65- 4. You should now be able to run scripts that require client credentials without any issues.
79+ The [`dev/tools.sh`][tools-sh] helper script runs the static analysis tools
80+ (`black`, `flake8`, and `isort`):
81+ ```shell
82+ ./dev/tools.sh
83+ ```
6684
85+ It can also accept command-line arguments to specify specific files or
86+ directories to check:
87+ ```shell
88+ ./dev/tools.sh PATH/TO/MY/FILE.PY
89+ ```
6790
68- ### Tooling
91+ [tools-sh]: /dev/tools.sh
92+
93+
94+ ### Resources
6995
7096- **[Python Guidelines — Creative Commons Open Source][ccospyguide]**
71- - [Black][black]: the uncompromising Python code formatter
72- - [flake8][flake8]: a python tool that glues together pep8, pyflakes, mccabe,
73- and third-party plugins to check the style and quality of some python code.
74- - [isort][isort]: A Python utility / library to sort imports.
97+ - [Black][black]: _the uncompromising Python code formatter_
98+ - [flake8][flake8]: _a python tool that glues together pep8, pyflakes, mccabe,
99+ and third-party plugins to check the style and quality of some python code._
100+ - [isort][isort]: _A Python utility / library to sort imports_
101+ - (It doesn' t import any libraries, it only sorts and formats them.)
102+ - [ppypa/pipenv][pipenv]: _Python Development Workflow for Humans._
75103
76104[ccospyguide]: https://opensource.creativecommons.org/contributing-code/python-guidelines/
77105[black]: https://github.com/psf/black
78106[flake8]: https://gitlab.com/pycqa/flake8
79107[isort]: https://pycqa.github.io/isort/
108+ [pipenv]: https://github.com/pypa/pipenv
109+
110+
111+ # ## GitHub Actions
112+
113+ The [` .github/workflows/python_static_analysis.yml` ][workflow-static-analysis]
114+ GitHub Actions workflow performs static analysis (` black` , ` flake8` , and
115+ ` isort` ) on committed changes. The workflow is triggered automatically when you
116+ push changes to the main branch or open a pull request.
117+
118+ [workflow-static-analysis]: .github/workflows/python_static_analysis.yml
80119
81120
82- ## Data Sources
121+ # # Data sources
83122
84123Kindly visit the [` sources.md` ](sources.md) file for it.
85124
@@ -89,12 +128,13 @@ Kindly visit the [`sources.md`](sources.md) file for it.
89128For information on past efforts, see [` history.md` ](history.md).
90129
91130
92- ## Copying & License
131+ # # Copying & license
93132
94133
95134# ## Code
96135
97- [`LICENSE`](LICENSE): the code within this repository is licensed under the Expat/[MIT][mit] license.
136+ [` LICENSE` ](LICENSE): the code within this repository is licensed under the
137+ Expat/[MIT][mit] license.
98138
99139[mit]: http://www.opensource.org/licenses/MIT " The MIT License | Open Source Initiative"
100140
@@ -119,4 +159,4 @@ The documentation within the project is licensed under a [Creative Commons
119159Attribution 4.0 International License][cc-by].
120160
121161[cc-by-png]: https://licensebuttons.net/l/by/4.0/88x31.png#floatleft " CC BY 4.0 license button"
122- [cc-by]: https://creativecommons.org/licenses/by/4.0/ "Creative Commons Attribution 4.0 International License"
162+ [cc-by]: https://creativecommons.org/licenses/by/4.0/ " Creative Commons Attribution 4.0 International License"
0 commit comments