osmsg 1.2.2__tar.gz → 1.2.3__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.
- {osmsg-1.2.2 → osmsg-1.2.3}/PKG-INFO +6 -4
- {osmsg-1.2.2 → osmsg-1.2.3}/README.md +5 -3
- osmsg-1.2.3/osmsg/__version__.py +1 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/gui.py +48 -12
- {osmsg-1.2.2 → osmsg-1.2.3}/pyproject.toml +1 -1
- osmsg-1.2.2/osmsg/__version__.py +0 -1
- {osmsg-1.2.2 → osmsg-1.2.3}/LICENSE +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/__init__.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/_http.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/_tick.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/auth.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/boundary.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/cli.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/db/__init__.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/db/duckdb_schema.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/db/ingest.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/db/queries.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/db/schema.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/exceptions.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/export/__init__.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/export/csv.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/export/json.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/export/markdown.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/export/parquet.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/export/psql.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/fetch.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/geofabrik.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/handlers.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/history.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/maintain/__init__.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/maintain/cli.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/maintain/convert.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/maintain/manifest.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/maintain/month.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/maintain/parquet.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/maintain/pbf_split.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/models.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/pg_schema.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/pipeline.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/py.typed +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/replication.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/tm.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/ui.py +0 -0
- {osmsg-1.2.2 → osmsg-1.2.3}/osmsg/workers.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: osmsg
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.3
|
|
4
4
|
Summary: OpenStreetMap Stats Generator: Commandline
|
|
5
5
|
Keywords: osm,stats,commandline,openstreetmap
|
|
6
6
|
Author: Kshitij Raj Sharma
|
|
@@ -78,8 +78,9 @@ brew install osgeonepal/tap/osmsg # macOS / Linux (Homebrew tap)
|
|
|
78
78
|
```
|
|
79
79
|
|
|
80
80
|
On Windows, download `osmsg.exe` from the [latest release](https://github.com/osgeonepal/osmsg/releases)
|
|
81
|
-
and double-click it to open the desktop app.
|
|
82
|
-
|
|
81
|
+
and double-click it to open the desktop app. Pick a Quick range (last hour, day, week, month, year, or
|
|
82
|
+
all time) or type your own dates, set the options, click Compute, and open the output folder. The CLI
|
|
83
|
+
below is for macOS, Linux, and pip/uv users.
|
|
83
84
|
|
|
84
85
|
## Quick start
|
|
85
86
|
|
|
@@ -207,7 +208,8 @@ Same pipeline as the CLI.
|
|
|
207
208
|
osmsg --config nepal.yaml
|
|
208
209
|
```
|
|
209
210
|
|
|
210
|
-
|
|
211
|
+
Each option is a YAML key written with its underscore name: `output_dir`, `history_url`, `all_stats`,
|
|
212
|
+
`formats`, `psql_dsn`, and so on (not the dashed flag). See [docs/Manual.md](./docs/Manual.md).
|
|
211
213
|
|
|
212
214
|
## Output formats
|
|
213
215
|
|
|
@@ -46,8 +46,9 @@ brew install osgeonepal/tap/osmsg # macOS / Linux (Homebrew tap)
|
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
On Windows, download `osmsg.exe` from the [latest release](https://github.com/osgeonepal/osmsg/releases)
|
|
49
|
-
and double-click it to open the desktop app.
|
|
50
|
-
|
|
49
|
+
and double-click it to open the desktop app. Pick a Quick range (last hour, day, week, month, year, or
|
|
50
|
+
all time) or type your own dates, set the options, click Compute, and open the output folder. The CLI
|
|
51
|
+
below is for macOS, Linux, and pip/uv users.
|
|
51
52
|
|
|
52
53
|
## Quick start
|
|
53
54
|
|
|
@@ -175,7 +176,8 @@ Same pipeline as the CLI.
|
|
|
175
176
|
osmsg --config nepal.yaml
|
|
176
177
|
```
|
|
177
178
|
|
|
178
|
-
|
|
179
|
+
Each option is a YAML key written with its underscore name: `output_dir`, `history_url`, `all_stats`,
|
|
180
|
+
`formats`, `psql_dsn`, and so on (not the dashed flag). See [docs/Manual.md](./docs/Manual.md).
|
|
179
181
|
|
|
180
182
|
## Output formats
|
|
181
183
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.2.3"
|
|
@@ -15,6 +15,26 @@ from .pipeline import RunConfig, run
|
|
|
15
15
|
|
|
16
16
|
UTC = dt.UTC
|
|
17
17
|
FORMATS = ["parquet", "csv", "json", "markdown"]
|
|
18
|
+
PRESETS = ["Last hour", "Last day", "Last week", "Last month", "Last year", "All time"]
|
|
19
|
+
_PRESET_DELTAS = {
|
|
20
|
+
"Last hour": dt.timedelta(hours=1),
|
|
21
|
+
"Last day": dt.timedelta(days=1),
|
|
22
|
+
"Last week": dt.timedelta(days=7),
|
|
23
|
+
"Last month": dt.timedelta(days=30),
|
|
24
|
+
"Last year": dt.timedelta(days=365),
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def preset_range(name: str, now: dt.datetime | None = None) -> tuple[dt.datetime, dt.datetime]:
|
|
29
|
+
"""Resolve a quick-range label to a (start, end) window."""
|
|
30
|
+
now = now or dt.datetime.now(UTC)
|
|
31
|
+
if name == "All time":
|
|
32
|
+
return dt.datetime(2005, 1, 1, tzinfo=UTC), now
|
|
33
|
+
return now - _PRESET_DELTAS[name], now
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _fmt(when: dt.datetime) -> str:
|
|
37
|
+
return when.strftime("%Y-%m-%d %H:%M:%S")
|
|
18
38
|
|
|
19
39
|
|
|
20
40
|
def _parse_date(value: str) -> dt.datetime | None:
|
|
@@ -112,31 +132,45 @@ class App:
|
|
|
112
132
|
ttk.Entry(frame, textvariable=var, width=40).grid(row=i, column=1, columnspan=3, sticky="we", pady=2)
|
|
113
133
|
self.vars[key] = var
|
|
114
134
|
|
|
135
|
+
preset_frame = ttk.LabelFrame(frame, text="Quick range", padding=6)
|
|
136
|
+
preset_frame.grid(row=5, column=0, columnspan=4, sticky="we", pady=6)
|
|
137
|
+
for i, name in enumerate(PRESETS):
|
|
138
|
+
ttk.Button(preset_frame, text=name, width=11, command=lambda n=name: self._apply_preset(n)).grid(
|
|
139
|
+
row=0, column=i, padx=2
|
|
140
|
+
)
|
|
141
|
+
|
|
115
142
|
self.vars["all_tags"] = tk.BooleanVar()
|
|
116
143
|
self.vars["summary"] = tk.BooleanVar()
|
|
117
|
-
ttk.Checkbutton(frame, text="All tags", variable=self.vars["all_tags"]).grid(row=
|
|
118
|
-
ttk.Checkbutton(frame, text="Daily summary", variable=self.vars["summary"]).grid(row=
|
|
144
|
+
ttk.Checkbutton(frame, text="All tags", variable=self.vars["all_tags"]).grid(row=6, column=0, sticky="w")
|
|
145
|
+
ttk.Checkbutton(frame, text="Daily summary", variable=self.vars["summary"]).grid(row=6, column=1, sticky="w")
|
|
119
146
|
|
|
120
147
|
fmt_frame = ttk.LabelFrame(frame, text="Formats", padding=6)
|
|
121
|
-
fmt_frame.grid(row=
|
|
148
|
+
fmt_frame.grid(row=7, column=0, columnspan=4, sticky="we", pady=6)
|
|
122
149
|
for i, name in enumerate(FORMATS):
|
|
123
150
|
var = tk.BooleanVar(value=name in ("parquet", "csv"))
|
|
124
151
|
ttk.Checkbutton(fmt_frame, text=name, variable=var).grid(row=0, column=i, padx=4)
|
|
125
152
|
self.vars[name] = var
|
|
126
153
|
|
|
127
154
|
self.out_label = ttk.Label(frame, text=f"Output: {self.out_dir}")
|
|
128
|
-
self.out_label.grid(row=
|
|
129
|
-
ttk.Button(frame, text="Choose folder", command=self._choose_folder).grid(row=
|
|
155
|
+
self.out_label.grid(row=8, column=0, columnspan=3, sticky="w")
|
|
156
|
+
ttk.Button(frame, text="Choose folder", command=self._choose_folder).grid(row=8, column=3, sticky="e")
|
|
130
157
|
|
|
131
|
-
self.run_btn = ttk.Button(frame, text="
|
|
132
|
-
self.run_btn.grid(row=
|
|
158
|
+
self.run_btn = ttk.Button(frame, text="Compute", command=self._on_run)
|
|
159
|
+
self.run_btn.grid(row=9, column=0, pady=8, sticky="w")
|
|
133
160
|
self.open_btn = ttk.Button(frame, text="Open output folder", command=lambda: _open_folder(Path(self.out_dir)))
|
|
134
|
-
self.open_btn.grid(row=
|
|
161
|
+
self.open_btn.grid(row=9, column=1, pady=8, sticky="w")
|
|
162
|
+
self.spinner = ttk.Progressbar(frame, mode="indeterminate", length=160)
|
|
163
|
+
self.spinner.grid(row=9, column=2, columnspan=2, pady=8, sticky="we")
|
|
135
164
|
|
|
136
165
|
self.log = scrolledtext.ScrolledText(frame, width=70, height=14, state="disabled")
|
|
137
|
-
self.log.grid(row=
|
|
166
|
+
self.log.grid(row=10, column=0, columnspan=4, sticky="nsew")
|
|
138
167
|
self.root.after(120, self._drain)
|
|
139
168
|
|
|
169
|
+
def _apply_preset(self, name: str) -> None:
|
|
170
|
+
start, end = preset_range(name)
|
|
171
|
+
self.vars["start"].set(_fmt(start))
|
|
172
|
+
self.vars["end"].set(_fmt(end))
|
|
173
|
+
|
|
140
174
|
def _choose_folder(self) -> None:
|
|
141
175
|
chosen = self._filedialog.askdirectory(initialdir=self.out_dir)
|
|
142
176
|
if chosen:
|
|
@@ -155,8 +189,9 @@ class App:
|
|
|
155
189
|
except OsmsgError as exc:
|
|
156
190
|
self._append(f"\n{exc}\n")
|
|
157
191
|
return
|
|
158
|
-
self.run_btn.config(state="disabled")
|
|
159
|
-
self.
|
|
192
|
+
self.run_btn.config(state="disabled", text="Running...")
|
|
193
|
+
self.spinner.start(12)
|
|
194
|
+
self._append(f"\nComputing into {self.out_dir} ...\n")
|
|
160
195
|
threading.Thread(target=self._worker, args=(cfg,), daemon=True).start()
|
|
161
196
|
|
|
162
197
|
def _worker(self, cfg: RunConfig) -> None:
|
|
@@ -182,7 +217,8 @@ class App:
|
|
|
182
217
|
self._append(payload)
|
|
183
218
|
else:
|
|
184
219
|
self._append(f"\n{payload}\n")
|
|
185
|
-
self.
|
|
220
|
+
self.spinner.stop()
|
|
221
|
+
self.run_btn.config(state="normal", text="Compute")
|
|
186
222
|
except queue.Empty:
|
|
187
223
|
pass
|
|
188
224
|
self.root.after(120, self._drain)
|
osmsg-1.2.2/osmsg/__version__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.2.2"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|