blog/District Tour

Tour of every Prague Municipal Authority

In September 2019 I embarked on a quest to sequentially visit every Prague Municipal Authority (Urad Mestske Casti, UMC) building from 1 to 22 as a way to visit every Prague district at least once. I would always start at a UMC and walk to the next one and take a selfie. I took year long breaks between the walks but never forgot the mission.

The lengths varied from 3km to 36km and I learned the UMC are built in a spiral which means the later ones are across the entire city.

Google My Map links

Total km walked: 0.00
Total hours walked: 0.0
Output
Show code
import matplotlib.pyplot as plt
from datetime import datetime
import json

# Collect and parse data
data_blocks = nb.query_all(block_type='data')
tours = []
for x in data_blocks:
  if 'schema' in x['metadata'] and x['metadata']['schema'] == 'prague tour':
    data = json.loads(x['content'])
    blog_link = [l for l in x['tags'] if l.startswith('blog/')][0]
    journal_link = [l for l in x['tags'] if l.startswith("journal/")][0]
    date = journal_link.split("journal/")[-1]
    date = datetime.strptime(date, '%Y-%m-%d')
    name = blog_link.split('/')[-1]  # e.g., "Prague 11 12"
    h, m = data['duration'].split(':')
    hours = int(h) + int(m) / 60
    tours.append({
        'name': name,
        'distance': data['distance'],
        'hours': hours,
        'date': date
    })

# Sort by district number for logical ordering
tours.sort(key=lambda t: t['date'])

total_km = sum(x['distance'] for x in tours)
total_hours = sum(x['hours'] for x in tours)

print(f"Total km walked: {total_km:.2f}")
print(f"Total hours walked: {total_hours:.1f}")

cum_dist = []
cum_hours = []
total_d, total_h = 0, 0
for t in tours:
  total_d += t['distance']
  total_h += t['hours']
  cum_dist.append(total_d)
  cum_hours.append(total_h)

dates = [t['date'] for t in tours]
names = [t['name'] for t in tours]

# Plot
fig, ax = plt.subplots(figsize=(12, 6))
ax.step(dates, cum_dist, where='post', linewidth=2, color='steelblue')
ax.fill_between(dates, cum_dist, step='post', alpha=0.3)

# Mark each tour
ax.scatter(dates, cum_dist, s=60, zorder=5)
for i, t in enumerate(tours):
  ax.annotate(t['name'].replace('Prague ', 'P'), (dates[i], cum_dist[i]),
              textcoords='offset points', xytext=(5, 8), fontsize=7, rotation=45)

ax.set_xlabel('Date')
ax.set_ylabel('Cumulative Distance (km)')
ax.set_title(f'Prague District Tour Progress — {total_d:.1f} km over {len(tours)} walks')
ax.grid(axis='y', alpha=0.3)
fig.autofmt_xdate()
plt.tight_layout()
plt.show()