osmsg 0.2.4__tar.gz → 0.3.0__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 osmsg might be problematic. Click here for more details.

@@ -1,29 +1,22 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: osmsg
3
- Version: 0.2.4
3
+ Version: 0.3.0
4
4
  Summary: OpenStreetMap Stats Generator: Commandline
5
- License: MIT
6
- Author: Kshitij Raj Sharma
7
- Author-email: skshitizraj@gmail.com
8
- Requires-Python: >=3.6,<4.0
9
- Classifier: License :: OSI Approved :: MIT License
5
+ License: GPL-3.0-only
6
+ Keywords: osm,stats,commandline,openstreetmap
7
+ Author-email: Kshitij Raj Sharma <skshitizraj@gmail.com>
8
+ Requires-Python: >=3.9
10
9
  Classifier: Programming Language :: Python :: 3
11
- Classifier: Programming Language :: Python :: 3.6
12
- Classifier: Programming Language :: Python :: 3.7
13
- Classifier: Programming Language :: Python :: 3.8
14
- Classifier: Programming Language :: Python :: 3.9
15
10
  Classifier: Programming Language :: Python :: 3.10
16
11
  Classifier: Programming Language :: Python :: 3.11
17
- Classifier: Programming Language :: Python :: 3.12
18
- Requires-Dist: geopandas (==0.10.2)
19
- Requires-Dist: humanize
20
- Requires-Dist: matplotlib
21
- Requires-Dist: osmium
22
- Requires-Dist: pandas (==1.5.2)
23
- Requires-Dist: requests
24
- Requires-Dist: seaborn
25
- Requires-Dist: shapely
26
- Requires-Dist: tqdm
12
+ Classifier: Programming Language :: Python :: 3.9
13
+ Classifier: Topic :: Scientific/Engineering :: GIS
14
+ Classifier: Topic :: Utilities
15
+ Provides-Extra: docs
16
+ Provides-Extra: test
17
+ Project-URL: documentation, https://github.com/kshitijrajsharma/osmsg
18
+ Project-URL: homepage, https://github.com/kshitijrajsharma/osmsg
19
+ Project-URL: repository, https://github.com/kshitijrajsharma/osmsg
27
20
  Description-Content-Type: text/markdown
28
21
 
29
22
  # OpenStreetMap Stats Generator
@@ -0,0 +1 @@
1
+ __version__ = "0.3.0"
@@ -41,6 +41,7 @@ import pandas as pd
41
41
  from matplotlib.font_manager import FontProperties
42
42
  from tqdm import tqdm
43
43
 
44
+ from .__version__ import __version__
44
45
  from .changefiles import (
45
46
  get_download_urls_changefiles,
46
47
  get_prev_hour,
@@ -471,6 +472,9 @@ def auth(username, password):
471
472
 
472
473
  def parse_args():
473
474
  parser = argparse.ArgumentParser()
475
+ parser.add_argument(
476
+ "--version", action="version", version=f"%(prog)s {__version__}"
477
+ )
474
478
  parser.add_argument(
475
479
  "--start_date",
476
480
  help="Start date in the format YYYY-MM-DD HH:M:Sz eg: 2023-01-28 17:43:09+05:45",
@@ -313,7 +313,7 @@ def create_charts(df, fname):
313
313
  other_editors_count = grouped_editors.iloc[num_categories:].sum()
314
314
 
315
315
  # Create a new series with the top categories and "others" count
316
- editors_data = top_editors.append(
316
+ editors_data = top_editors._append(
317
317
  pd.Series(other_editors_count, index=["Others"])
318
318
  )
319
319
 
@@ -528,12 +528,16 @@ def update_stats(df1, df2):
528
528
  # Iterate over the integer columns and update the values
529
529
  for col in int_cols:
530
530
  merged_df[col] = merged_df.apply(
531
- lambda row: pd.to_numeric(row[f"{col}_x"], errors="coerce")
532
- + pd.to_numeric(row[f"{col}_y"], errors="coerce")
533
- if pd.notnull(row[f"{col}_x"]) and pd.notnull(row[f"{col}_y"])
534
- else pd.to_numeric(row[f"{col}_x"], errors="coerce") or 0
535
- if pd.notnull(row[f"{col}_x"])
536
- else pd.to_numeric(row[f"{col}_y"], errors="coerce") or 0,
531
+ lambda row: (
532
+ pd.to_numeric(row[f"{col}_x"], errors="coerce")
533
+ + pd.to_numeric(row[f"{col}_y"], errors="coerce")
534
+ if pd.notnull(row[f"{col}_x"]) and pd.notnull(row[f"{col}_y"])
535
+ else (
536
+ pd.to_numeric(row[f"{col}_x"], errors="coerce") or 0
537
+ if pd.notnull(row[f"{col}_x"])
538
+ else pd.to_numeric(row[f"{col}_y"], errors="coerce") or 0
539
+ )
540
+ ),
537
541
  axis=1,
538
542
  )
539
543
 
@@ -641,12 +645,16 @@ def update_summary(df1, df2):
641
645
  # Iterate over the integer columns and update the values
642
646
  for col in int_cols:
643
647
  merged_df[col] = merged_df.apply(
644
- lambda row: pd.to_numeric(row[f"{col}_x"], errors="coerce")
645
- + pd.to_numeric(row[f"{col}_y"], errors="coerce")
646
- if pd.notnull(row[f"{col}_x"]) and pd.notnull(row[f"{col}_y"])
647
- else pd.to_numeric(row[f"{col}_x"], errors="coerce") or 0
648
- if pd.notnull(row[f"{col}_x"])
649
- else pd.to_numeric(row[f"{col}_y"], errors="coerce") or 0,
648
+ lambda row: (
649
+ pd.to_numeric(row[f"{col}_x"], errors="coerce")
650
+ + pd.to_numeric(row[f"{col}_y"], errors="coerce")
651
+ if pd.notnull(row[f"{col}_x"]) and pd.notnull(row[f"{col}_y"])
652
+ else (
653
+ pd.to_numeric(row[f"{col}_x"], errors="coerce") or 0
654
+ if pd.notnull(row[f"{col}_x"])
655
+ else pd.to_numeric(row[f"{col}_y"], errors="coerce") or 0
656
+ )
657
+ ),
650
658
  axis=1,
651
659
  )
652
660
  if "editors" in df1.columns:
@@ -0,0 +1,142 @@
1
+ [project]
2
+ name = "osmsg"
3
+ version = "0.3.0"
4
+ dynamic = []
5
+ description = "OpenStreetMap Stats Generator: Commandline"
6
+ readme = "README.md"
7
+ authors = [
8
+ { name = "Kshitij Raj Sharma", email = "skshitizraj@gmail.com" },
9
+ ]
10
+ requires-python = ">=3.9"
11
+ dependencies = [
12
+ "pandas <= 2.2.2",
13
+ "osmium <= 3.7.0",
14
+ "requests <= 2.32.3",
15
+ "shapely <= 2.0.6",
16
+ "geopandas <= 1.0.1",
17
+ "tqdm <= 4.66.5",
18
+ "seaborn <= 0.13.2",
19
+ "matplotlib <= 3.9.2",
20
+ "humanize <= 4.10.0",
21
+ ]
22
+ keywords = [
23
+ "osm",
24
+ "stats",
25
+ "commandline",
26
+ "openstreetmap",
27
+ ]
28
+ classifiers = [
29
+ "Topic :: Utilities",
30
+ "Topic :: Scientific/Engineering :: GIS",
31
+ "Programming Language :: Python :: 3",
32
+ "Programming Language :: Python :: 3.9",
33
+ "Programming Language :: Python :: 3.10",
34
+ "Programming Language :: Python :: 3.11",
35
+ ]
36
+
37
+ [project.license]
38
+ text = "GPL-3.0-only"
39
+
40
+ [project.urls]
41
+ homepage = "https://github.com/kshitijrajsharma/osmsg"
42
+ documentation = "https://github.com/kshitijrajsharma/osmsg"
43
+ repository = "https://github.com/kshitijrajsharma/osmsg"
44
+
45
+ [project.optional-dependencies]
46
+ test = [
47
+ "pytest>=7.4.2",
48
+ "pytest-mock>=3.14.0",
49
+ "coverage>=7.6.1",
50
+ "coverage-badge>=1.1.2",
51
+ ]
52
+ docs = [
53
+ "mkdocs>=1.5.3",
54
+ "mkdocs-material>=9.4.2",
55
+ "mkdocstrings-python>=1.7.0",
56
+ "mkdocs-exclude>=1.0.2",
57
+ ]
58
+
59
+ [project.scripts]
60
+ osmsg = "osmsg.app:main"
61
+
62
+ [build-system]
63
+ requires = [
64
+ "pdm-pep517>=1.1.4",
65
+ ]
66
+ build-backend = "pdm.pep517.api"
67
+
68
+ [tool.pytest.ini_options]
69
+ addopts = "-ra -q -p no:warnings"
70
+ testpaths = [
71
+ "tests",
72
+ ]
73
+ pythonpath = "osmsg"
74
+
75
+ [tool.commitizen]
76
+ name = "cz_conventional_commits"
77
+ tag_format = "v$version"
78
+ version_scheme = "semver"
79
+ version_provider = "pep621"
80
+ update_changelog_on_bump = true
81
+ version_files = [
82
+ "pyproject.toml:version",
83
+ "osmsg/__version__.py",
84
+ ]
85
+
86
+ [tool.pdm.version]
87
+ from = "osmsg/__version__.py"
88
+
89
+ [tool.pdm.build]
90
+ includes = [
91
+ "osmsg",
92
+ ]
93
+ source-includes = [
94
+ "tests",
95
+ "LICENSE",
96
+ "README.md",
97
+ ]
98
+
99
+ [tool.black]
100
+ line-length = 132
101
+ target-versions = [
102
+ "py39",
103
+ "py310",
104
+ "py311",
105
+ ]
106
+
107
+ [tool.ruff]
108
+ fix = true
109
+ line-length = 132
110
+ target-version = "py39"
111
+ exclude = [
112
+ ".git",
113
+ ".ruff_cache",
114
+ ".vscode",
115
+ "__pypackages__",
116
+ "build",
117
+ "dist",
118
+ "osmsg/__version__.py",
119
+ ]
120
+
121
+ [tool.ruff.lint]
122
+ select = [
123
+ "I",
124
+ "E",
125
+ "W",
126
+ "D",
127
+ "B",
128
+ "F",
129
+ "N",
130
+ "Q",
131
+ ]
132
+
133
+ [tool.ruff.lint.pydocstyle]
134
+ convention = "google"
135
+
136
+ [tool.coverage.run]
137
+ source = [
138
+ "osmsg",
139
+ ]
140
+
141
+ [tool.coverage.report]
142
+ show_missing = true
@@ -1,44 +0,0 @@
1
- [build-system]
2
- requires = ["setuptools", "wheel"]
3
- build-backend = "setuptools.build_meta"
4
-
5
- [project]
6
- name = "osmsg"
7
- version = "0.2.5"
8
- description = "OpenStreetMap Stats Generator: Commandline"
9
- readme = "README.md"
10
- authors = [{name = "Kshitij Raj Sharma", email = "skshitizraj@gmail.com"}]
11
- license = "MIT"
12
-
13
- [tool.poetry]
14
- name = "osmsg"
15
- version = "0.2.4"
16
- description = "OpenStreetMap Stats Generator: Commandline"
17
- readme = "README.md"
18
- authors = [ "Kshitij Raj Sharma <skshitizraj@gmail.com>"]
19
- license = "MIT"
20
-
21
- [project.scripts]
22
- osmsg = "osmsg.app:main"
23
-
24
- [tool.poetry.dependencies]
25
- python = "^3.6"
26
- osmium = "*"
27
- pandas = "==1.5.2"
28
- requests = "*"
29
- shapely = "*"
30
- geopandas = "==0.10.2"
31
- tqdm = "*"
32
- seaborn = "*"
33
- matplotlib = "*"
34
- humanize = "*"
35
-
36
- [tool.poetry.scripts]
37
- osmsg = "osmsg.app:main"
38
-
39
- [tool.commitizen]
40
- name = "cz_conventional_commits"
41
- tag_format = "v$version"
42
- version_scheme = "semver"
43
- version_provider = "pep621"
44
- update_changelog_on_bump = true
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes