whatdidyoudo 0.1.0__tar.gz → 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of whatdidyoudo might be problematic. Click here for more details.

@@ -1,7 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: whatdidyoudo
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: A minimal Flask app that shows the amount of OpenStreetMap changes made by a user on a day.
5
+ Project-URL: Homepage, https://github.com/rompe/whatdidyoudo
6
+ Project-URL: Issues, https://github.com/rompe/whatdidyoudo/issues
5
7
  Author-email: Ulf Rompe <whatdidyoudo.rompe.org@rompe.org>
6
8
  License: MIT
7
9
  Requires-Python: >=3.11
@@ -21,12 +23,16 @@ A minimal Flask app that shows the amount of OpenStreetMap changes made by a use
21
23
 
22
24
  ## Background
23
25
 
24
- I often ask myself after contributing many changes to OpenStreetMap, either by walking around
25
- while extensively using StreetComplete, MapComplete or Vespucci, or by doing some tasks in iD or
26
- jOSM: **How many changes did I contribute to the map today?**
26
+ I often ask myself after contributing many changes to [OpenStreetMap](https://www.openstreetmap.org/),
27
+ either by walking around while extensively using [StreetComplete](https://streetcomplete.app/),
28
+ [MapComplete](https://mapcomplete.org/) or [Vespucci](https://vespucci.io/), or by doing some tasks
29
+ in [iD](https://www.openstreetmap.org/edit) or [JOSM](https://josm.openstreetmap.de/):
30
+
31
+ ***How many changes did I contribute to the map today?***
27
32
 
28
33
  I'm not the only one. I heard questions like this quite a few times:
29
- **Where can I see how much I did on yesterday's mapwalk?**
34
+
35
+ ***Where can I see how much I did on yesterday's mapwalk?***
30
36
 
31
37
  Because I think that simple questions deserve simple answers, I made this tool to give exactly
32
38
  this information and nothing else.
@@ -39,38 +45,44 @@ You don't need to self-host it, it is available for anyone at
39
45
  Fun fact: of course you don't really need *uv* for this. I'm just using this project to
40
46
  get used to it as I think it has a lot of potential.
41
47
 
42
- 1. Install [uv](https://github.com/astral-sh/uv) if needed:
48
+ ### Install [uv](https://github.com/astral-sh/uv) if needed
49
+
50
+ ```sh
51
+ pip install uv
52
+ ```
53
+
54
+ ### Install dependencies using *uv*
43
55
 
44
- ```sh
45
- pip install uv
46
- ```
56
+ ```sh
57
+ uv pip install -r pyproject.toml
58
+ ```
47
59
 
48
- 2. Install dependencies using *uv*:
60
+ If you want to develop:
49
61
 
50
- ```sh
51
- uv pip install -r pyproject.toml
52
- ```
62
+ ```sh
63
+ uv pip install -r pyproject.toml --extra dev
64
+ ```
53
65
 
54
- If you want to develop:
66
+ ### Run tests
55
67
 
56
- ```sh
57
- uv pip install -r pyproject.toml --extra dev
58
- ```
68
+ ```sh
69
+ pytest
70
+ ```
59
71
 
60
- 3. Run the app in test mode:
72
+ ### Run the app in test mode
61
73
 
62
- ```sh
63
- python run_test.py
64
- ```
74
+ ```sh
75
+ python whatdidyoudo/app.py
76
+ ```
65
77
 
66
- Visit [http://127.0.0.1:5000/](http://127.0.0.1:5000/) in your browser to see "hello world".
78
+ Visit [http://127.0.0.1:5000/](http://127.0.0.1:5000/) in your browser to see "hello world".
67
79
 
68
- 4. Build a package and upload it to Pypi
80
+ ### Build a package and upload it to Pypi
69
81
 
70
- ```sh
71
- uv hatchling build
72
- uv twine upload dist/*
73
- ```
82
+ ```sh
83
+ uvx hatchling build
84
+ uvx twine upload dist/*
85
+ ```
74
86
 
75
87
  ## License
76
88
 
@@ -0,0 +1,70 @@
1
+ # whatdidyoudo
2
+
3
+ A minimal Flask app that shows the amount of OpenStreetMap changes made by a user on a day.
4
+
5
+ ## Background
6
+
7
+ I often ask myself after contributing many changes to [OpenStreetMap](https://www.openstreetmap.org/),
8
+ either by walking around while extensively using [StreetComplete](https://streetcomplete.app/),
9
+ [MapComplete](https://mapcomplete.org/) or [Vespucci](https://vespucci.io/), or by doing some tasks
10
+ in [iD](https://www.openstreetmap.org/edit) or [JOSM](https://josm.openstreetmap.de/):
11
+
12
+ ***How many changes did I contribute to the map today?***
13
+
14
+ I'm not the only one. I heard questions like this quite a few times:
15
+
16
+ ***Where can I see how much I did on yesterday's mapwalk?***
17
+
18
+ Because I think that simple questions deserve simple answers, I made this tool to give exactly
19
+ this information and nothing else.
20
+
21
+ You don't need to self-host it, it is available for anyone at
22
+ [whatdidyoudo.rompe.org](https://whatdidyoudo.rompe.org).
23
+
24
+ ## Setup
25
+
26
+ Fun fact: of course you don't really need *uv* for this. I'm just using this project to
27
+ get used to it as I think it has a lot of potential.
28
+
29
+ ### Install [uv](https://github.com/astral-sh/uv) if needed
30
+
31
+ ```sh
32
+ pip install uv
33
+ ```
34
+
35
+ ### Install dependencies using *uv*
36
+
37
+ ```sh
38
+ uv pip install -r pyproject.toml
39
+ ```
40
+
41
+ If you want to develop:
42
+
43
+ ```sh
44
+ uv pip install -r pyproject.toml --extra dev
45
+ ```
46
+
47
+ ### Run tests
48
+
49
+ ```sh
50
+ pytest
51
+ ```
52
+
53
+ ### Run the app in test mode
54
+
55
+ ```sh
56
+ python whatdidyoudo/app.py
57
+ ```
58
+
59
+ Visit [http://127.0.0.1:5000/](http://127.0.0.1:5000/) in your browser to see "hello world".
60
+
61
+ ### Build a package and upload it to Pypi
62
+
63
+ ```sh
64
+ uvx hatchling build
65
+ uvx twine upload dist/*
66
+ ```
67
+
68
+ ## License
69
+
70
+ This project is licensed under the MIT License. See the `pyproject.toml` for details.
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "whatdidyoudo"
7
- version = "0.1.0"
7
+ version = "0.1.1"
8
8
  description = "A minimal Flask app that shows the amount of OpenStreetMap changes made by a user on a day."
9
9
  authors = [
10
10
  { name = "Ulf Rompe", email = "whatdidyoudo.rompe.org@rompe.org" }
@@ -26,6 +26,11 @@ dev = [
26
26
  "twine>=6.2.0",
27
27
  ]
28
28
 
29
+ [project.urls]
30
+ Homepage = "https://github.com/rompe/whatdidyoudo"
31
+ Issues = "https://github.com/rompe/whatdidyoudo/issues"
32
+
33
+
29
34
  [tool.uv]
30
35
  # uv-specific settings go here
31
36
 
@@ -0,0 +1,4 @@
1
+ """Fix path for unittests."""
2
+ import sys
3
+ import os
4
+ sys.path.insert(0, os.path.abspath(os.path.dirname(os.path.dirname(__file__))))
@@ -0,0 +1,34 @@
1
+ """Unit tests for the WhatDidYouDo Flask application."""
2
+ import unittest
3
+ from whatdidyoudo.app import app
4
+
5
+
6
+ class WhatDidYouDoTestCase(unittest.TestCase):
7
+ """Unit tests for the WhatDidYouDo Flask application."""
8
+ def setUp(self):
9
+ self.app = app.test_client()
10
+ self.app.testing = True # type: ignore
11
+
12
+ def test_home_status_code(self):
13
+ """Test that the home page returns a 200 status code."""
14
+ response = self.app.get('/')
15
+ self.assertEqual(response.status_code, 200)
16
+
17
+ def test_form_contains_user_and_date(self):
18
+ """Test that the form contains fields for user and date."""
19
+ response = self.app.get('/')
20
+ html = response.get_data(as_text=True)
21
+ self.assertIn('name="user"', html)
22
+ self.assertIn('name="date"', html)
23
+
24
+ def test_user_date_route(self):
25
+ """Test that the user/date route returns a 200 status code."""
26
+ response = self.app.get('/rompe/2024-09-29')
27
+ self.assertEqual(response.status_code, 200)
28
+ html = response.get_data(as_text=True)
29
+ self.assertIn('rompe', html)
30
+ self.assertIn('2024-09-29', html)
31
+
32
+
33
+ if __name__ == '__main__':
34
+ unittest.main()
File without changes
@@ -82,3 +82,7 @@ def whatdidyoudo(user: str | None = None, date: str | None = None) -> str:
82
82
 
83
83
  return render_template('form.html', user=user, date=date, changes=changes,
84
84
  changesets=changesets, error=error)
85
+
86
+
87
+ if __name__ == "__main__":
88
+ app.run(debug=True)
@@ -1,60 +0,0 @@
1
- # whatdidyoudo
2
-
3
- A minimal Flask app that shows the amount of OpenStreetMap changes made by a user on a day.
4
-
5
- ## Background
6
-
7
- I often ask myself after contributing many changes to OpenStreetMap, either by walking around
8
- while extensively using StreetComplete, MapComplete or Vespucci, or by doing some tasks in iD or
9
- jOSM: **How many changes did I contribute to the map today?**
10
-
11
- I'm not the only one. I heard questions like this quite a few times:
12
- **Where can I see how much I did on yesterday's mapwalk?**
13
-
14
- Because I think that simple questions deserve simple answers, I made this tool to give exactly
15
- this information and nothing else.
16
-
17
- You don't need to self-host it, it is available for anyone at
18
- [whatdidyoudo.rompe.org](https://whatdidyoudo.rompe.org).
19
-
20
- ## Setup
21
-
22
- Fun fact: of course you don't really need *uv* for this. I'm just using this project to
23
- get used to it as I think it has a lot of potential.
24
-
25
- 1. Install [uv](https://github.com/astral-sh/uv) if needed:
26
-
27
- ```sh
28
- pip install uv
29
- ```
30
-
31
- 2. Install dependencies using *uv*:
32
-
33
- ```sh
34
- uv pip install -r pyproject.toml
35
- ```
36
-
37
- If you want to develop:
38
-
39
- ```sh
40
- uv pip install -r pyproject.toml --extra dev
41
- ```
42
-
43
- 3. Run the app in test mode:
44
-
45
- ```sh
46
- python run_test.py
47
- ```
48
-
49
- Visit [http://127.0.0.1:5000/](http://127.0.0.1:5000/) in your browser to see "hello world".
50
-
51
- 4. Build a package and upload it to Pypi
52
-
53
- ```sh
54
- uv hatchling build
55
- uv twine upload dist/*
56
- ```
57
-
58
- ## License
59
-
60
- This project is licensed under the MIT License. See the `pyproject.toml` for details.
@@ -1,8 +0,0 @@
1
- import os
2
- from whatdidyoudo.app import app
3
-
4
- def run():
5
- app.run(debug=True)
6
-
7
- if __name__ == "__main__":
8
- run()
File without changes