Skip to content

Commit 8d0481e

Browse files
committed
Fix README
1 parent 0faeb61 commit 8d0481e

File tree

1 file changed

+28
-43
lines changed

1 file changed

+28
-43
lines changed

README.md

Lines changed: 28 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
# Python Project Starter Repository
22

3-
This repository serves as a template demonstrating Python best practices for data analysis projects. It includes examples of:
4-
- CSV data processing
5-
- Data visualization with matplotlib
6-
- Command-line argument parsing
7-
- Type annotations
8-
- Testing
9-
- Code quality tools
10-
- Continuous Integration
3+
This repository serves as a template demonstrating Python best practices for data analysis projects. It includes:
4+
5+
- An example Python program (reading in data and plotting)
6+
- Command-line argument parsing ([argparse](https://docs.python.org/3/library/argparse.html))
7+
- Code style checking, aka "linting" (with [ruff](https://github.com/astral-sh/ruff))
8+
- Static type checking (with [mypy](https://mypy.readthedocs.io/))
9+
- Pre-commit hooks that run these checks automatically (with [pre-commit](https://pre-commit.com/))
10+
- Testing (with [pytest](https://docs.pytest.org/))
11+
- Continuous Integration (with [GitHub Actions](https://github.com/features/actions))
12+
- Package management (with [pip](https://pip.pypa.io/) and [pyproject.toml](https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/))
13+
- An open source license ([MIT](https://opensource.org/licenses/MIT))
1114

1215
## Features
1316

1417
### 1. Data Processing and Visualization
15-
The main script ([starter_repo/plot_data.py](starter_repo/plot_data.py)) demonstrates:
16-
- Reading CSV files using pandas
17-
- Creating plots with matplotlib
18-
- Modern Python type annotations
19-
- Command-line argument parsing with argparse
2018

21-
Example usage:
19+
The main script ([starter_repo/plot_data.py](starter_repo/plot_data.py)) can be replaced with any code that you want to write.
20+
21+
Installation can be done as follows:
22+
2223
```bash
2324
# Install the package
2425
pip install .
@@ -28,59 +29,44 @@ python -m starter_repo.plot_data data/sample.csv year population --title "Popula
2829
```
2930

3031
### 2. Testing
31-
The project uses pytest for testing. Test files are located in the [tests/](tests/) directory.
32+
33+
Writing unit tests is a good way to ensure that your code behaves as expected, and you can write unit tests before you write the code that you want to test (aka "test-driven development"). Test files are located in the [tests/](tests/) directory.
3234

3335
To run tests:
36+
3437
```bash
3538
pip install ".[dev]" # Install development dependencies
3639
pytest
3740
```
3841

3942
### 3. Code Quality Tools
43+
4044
This project uses several tools to maintain code quality:
4145

4246
#### Pre-commit Hooks
47+
4348
We use [pre-commit](.pre-commit-config.yaml) with:
49+
4450
- [Ruff](https://github.com/charliermarsh/ruff) for linting and formatting
4551
- [mypy](https://mypy.readthedocs.io/) for static type checking
4652

4753
To set up pre-commit:
54+
4855
```bash
4956
pip install pre-commit
5057
pre-commit install
5158
```
5259

5360
### 4. Continuous Integration
61+
5462
GitHub Actions workflows are set up for:
63+
5564
- [Linting](.github/workflows/lint.yml): Runs Ruff and mypy
5665
- [Testing](.github/workflows/test.yml): Runs pytest on multiple Python versions
5766

58-
### 5. Project Structure
59-
```
60-
.
61-
|- starter_repo/ # Source code
62-
| |- plot_data.py # Main script
63-
|- tests/ # Test files
64-
| |- test_plot_data.py
65-
|- data/ # Sample data
66-
| |- sample.csv
67-
|- .github/workflows/ # CI configuration
68-
|- pyproject.toml # Project metadata and dependencies
69-
|- .pre-commit-config.yaml # Pre-commit hook configuration
70-
|- README.md
71-
```
72-
73-
## Installation
74-
75-
```bash
76-
# For users
77-
pip install .
78-
79-
# For developers
80-
pip install -e ".[dev]"
81-
```
8267

8368
## Contributing
69+
8470
1. Fork the repository
8571
2. Install development dependencies: `pip install -e ".[dev]"`
8672
3. Install pre-commit hooks: `pre-commit install`
@@ -94,11 +80,9 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
9480

9581
> **Note**: Without a license, the code is under exclusive copyright by default. This means no one can copy, distribute, or modify your work without facing potential legal consequences. Adding a license (like MIT) explicitly grants these permissions, making it clear how others can use your code.
9682
97-
## Author
98-
Graham Neubig ([email protected])
99-
10083
## Citation
10184

85+
This was created by [Graham Neubig](https://phontron.com) primarily as an example for student researchers.
10286
If you use this repository in your research, please cite it using the following BibTeX entry:
10387

10488
```bibtex
@@ -109,4 +93,5 @@ If you use this repository in your research, please cite it using the following
10993
publisher = {GitHub},
11094
journal = {GitHub Repository},
11195
howpublished = {\url{https://github.com/neubig/starter-repo}}
112-
}
96+
}
97+
```

0 commit comments

Comments
 (0)