can-i-park 0.0.2__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.
@@ -0,0 +1,55 @@
1
+ Metadata-Version: 2.4
2
+ Name: can-i-park
3
+ Version: 0.0.2
4
+ Summary: A CLI and exporter to fetch the status of parkings in Ghent
5
+ Author-email: Bram Oosterlynck <bram.oosterlynck@gmail.com>
6
+ Project-URL: Homepage, https://github.com/boosterl/can-i-park
7
+ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
8
+ Classifier: Intended Audience :: Developers
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Python :: 3.8
11
+ Classifier: Programming Language :: Python :: 3.9
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Description-Content-Type: text/markdown
17
+ Requires-Dist: certifi>=2025.4.26
18
+ Requires-Dist: charset-normalizer>=3.4.2
19
+ Requires-Dist: click>=8.2.1
20
+ Requires-Dist: idna>=3.10
21
+ Requires-Dist: requests>=2.32.3
22
+ Requires-Dist: urllib3>=2.4.0
23
+
24
+ # Can I park?
25
+
26
+ Driving to Ghent and want to know if there is place in one of the car parks
27
+ managed by the city, without leaving the warmth of your terminal before you
28
+ leave? Look no further than this utility!
29
+
30
+ ## How to install
31
+
32
+ ### Using pip
33
+
34
+ ```
35
+ pip install can-i-park
36
+ ```
37
+
38
+ ## How to use
39
+
40
+ ### CLI
41
+
42
+ The CLI can be used in the following ways:
43
+
44
+ ```bash
45
+ # Using arguments
46
+ $ can-i-park
47
+ # Arguments can be passed to filter on garages, if they are in a low emission zone and for showing extra information about the garage
48
+ $ can-i-park --name sint-pieters --no-lez -v
49
+ # The script can also be called using it's abbreviation
50
+ $ cip
51
+ ```
52
+
53
+ ## See it in action
54
+
55
+ ![GIF of an example session interacting with the cli](demo.gif)
@@ -0,0 +1,32 @@
1
+ # Can I park?
2
+
3
+ Driving to Ghent and want to know if there is place in one of the car parks
4
+ managed by the city, without leaving the warmth of your terminal before you
5
+ leave? Look no further than this utility!
6
+
7
+ ## How to install
8
+
9
+ ### Using pip
10
+
11
+ ```
12
+ pip install can-i-park
13
+ ```
14
+
15
+ ## How to use
16
+
17
+ ### CLI
18
+
19
+ The CLI can be used in the following ways:
20
+
21
+ ```bash
22
+ # Using arguments
23
+ $ can-i-park
24
+ # Arguments can be passed to filter on garages, if they are in a low emission zone and for showing extra information about the garage
25
+ $ can-i-park --name sint-pieters --no-lez -v
26
+ # The script can also be called using it's abbreviation
27
+ $ cip
28
+ ```
29
+
30
+ ## See it in action
31
+
32
+ ![GIF of an example session interacting with the cli](demo.gif)
@@ -0,0 +1,39 @@
1
+ # pyproject.toml
2
+
3
+ [build-system]
4
+ requires = ["setuptools>=61.0.0", "wheel"]
5
+ build-backend = "setuptools.build_meta"
6
+
7
+ [project]
8
+ name = "can-i-park"
9
+ version = "0.0.2"
10
+ description = "A CLI and exporter to fetch the status of parkings in Ghent"
11
+ readme = "README.md"
12
+ authors = [{ name = "Bram Oosterlynck", email = "bram.oosterlynck@gmail.com" }]
13
+ license = { file = "LICENSE" }
14
+ classifiers = [
15
+ "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
16
+ "Intended Audience :: Developers",
17
+ "Programming Language :: Python :: 3",
18
+ "Programming Language :: Python :: 3.8",
19
+ "Programming Language :: Python :: 3.9",
20
+ "Programming Language :: Python :: 3.10",
21
+ "Programming Language :: Python :: 3.11",
22
+ "Programming Language :: Python :: 3.12",
23
+ "Programming Language :: Python :: 3.13",
24
+ ]
25
+ dependencies = [
26
+ "certifi>=2025.4.26",
27
+ "charset-normalizer>=3.4.2",
28
+ "click>=8.2.1",
29
+ "idna>=3.10",
30
+ "requests>=2.32.3",
31
+ "urllib3>=2.4.0",
32
+ ]
33
+
34
+ [project.urls]
35
+ Homepage = "https://github.com/boosterl/can-i-park"
36
+
37
+ [project.scripts]
38
+ can-i-park = "can_i_park.__main__:main"
39
+ cip = "can_i_park.__main__:main"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1 @@
1
+ __version__ = "0.0.2"
@@ -0,0 +1,19 @@
1
+ from can_i_park.cli import display_parking_data
2
+ from click import command, option, version_option
3
+ # from prometheus_client import start_http_server
4
+
5
+
6
+ @command()
7
+ @option("-e", "--exporter", envvar="EXPORTER", is_flag=True)
8
+ @option("-i", "--interval", envvar="EXPORTER_INTERVAL", type=int)
9
+ @option("-p", "--port", envvar="EXPORTER_PORT", type=int)
10
+ @option("-n", "--name", envvar="NAME", multiple=True)
11
+ @option("-v", "--verbose", count=True)
12
+ @option("--lez/--no-lez", envvar="LEZ", default=True)
13
+ @version_option()
14
+ def main(exporter, interval, port, name, verbose, lez):
15
+ display_parking_data(name, lez, verbose)
16
+
17
+
18
+ if __name__ == "__main__":
19
+ main()
@@ -0,0 +1,39 @@
1
+ import click
2
+ import requests
3
+
4
+ API_URL = "https://data.stad.gent/api/explore/v2.1/catalog/datasets/bezetting-parkeergarages-real-time/records?limit=20"
5
+
6
+ def fetch_parking_data():
7
+ response = requests.get(API_URL)
8
+ if response.status_code == 200:
9
+ return response.json().get("results", [])
10
+ else:
11
+ raise Exception("Failed to fetch data from API")
12
+
13
+ def display_parking_data(names, lez, verbose):
14
+ parkings = fetch_parking_data()
15
+ for parking in parkings:
16
+ if names and not any(name.lower() in parking.get('name').lower() for name in names):
17
+ continue
18
+ if not lez and "in lez" in parking.get('categorie').lower():
19
+ continue
20
+ click.echo(f"📍 Parking: {parking.get('name')}")
21
+ if parking.get('occupation') < 75:
22
+ click.echo(f" - Parking is free ✅")
23
+ elif 75 <= parking.get('occupation') < 95:
24
+ click.echo(f" - Parking only has {parking.get('availablecapacity')} places free")
25
+ else:
26
+ click.echo(f" - Parking is full 🚫")
27
+ display_parking_details(parking, verbose)
28
+
29
+ def display_parking_details(parking, verbose):
30
+ if verbose < 1:
31
+ return
32
+ print(f" Total capacity: {parking.get('totalcapacity')}")
33
+ print(f" Available capacity: {parking.get('availablecapacity')}")
34
+ print(f" Parking in LEZ: {'yes' if 'in lez' in parking.get('categorie').lower() else 'no'}")
35
+ print(f" Occupation: {parking.get('occupation')}%")
36
+ print(print_occupation_chart(parking.get("occupation")))
37
+
38
+ def print_occupation_chart(occupation):
39
+ return f" [{'#' * occupation}{' ' * (100 - occupation)}]"
@@ -0,0 +1,55 @@
1
+ Metadata-Version: 2.4
2
+ Name: can-i-park
3
+ Version: 0.0.2
4
+ Summary: A CLI and exporter to fetch the status of parkings in Ghent
5
+ Author-email: Bram Oosterlynck <bram.oosterlynck@gmail.com>
6
+ Project-URL: Homepage, https://github.com/boosterl/can-i-park
7
+ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
8
+ Classifier: Intended Audience :: Developers
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Python :: 3.8
11
+ Classifier: Programming Language :: Python :: 3.9
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Description-Content-Type: text/markdown
17
+ Requires-Dist: certifi>=2025.4.26
18
+ Requires-Dist: charset-normalizer>=3.4.2
19
+ Requires-Dist: click>=8.2.1
20
+ Requires-Dist: idna>=3.10
21
+ Requires-Dist: requests>=2.32.3
22
+ Requires-Dist: urllib3>=2.4.0
23
+
24
+ # Can I park?
25
+
26
+ Driving to Ghent and want to know if there is place in one of the car parks
27
+ managed by the city, without leaving the warmth of your terminal before you
28
+ leave? Look no further than this utility!
29
+
30
+ ## How to install
31
+
32
+ ### Using pip
33
+
34
+ ```
35
+ pip install can-i-park
36
+ ```
37
+
38
+ ## How to use
39
+
40
+ ### CLI
41
+
42
+ The CLI can be used in the following ways:
43
+
44
+ ```bash
45
+ # Using arguments
46
+ $ can-i-park
47
+ # Arguments can be passed to filter on garages, if they are in a low emission zone and for showing extra information about the garage
48
+ $ can-i-park --name sint-pieters --no-lez -v
49
+ # The script can also be called using it's abbreviation
50
+ $ cip
51
+ ```
52
+
53
+ ## See it in action
54
+
55
+ ![GIF of an example session interacting with the cli](demo.gif)
@@ -0,0 +1,11 @@
1
+ README.md
2
+ pyproject.toml
3
+ src/can_i_park/__init__.py
4
+ src/can_i_park/__main__.py
5
+ src/can_i_park/cli.py
6
+ src/can_i_park.egg-info/PKG-INFO
7
+ src/can_i_park.egg-info/SOURCES.txt
8
+ src/can_i_park.egg-info/dependency_links.txt
9
+ src/can_i_park.egg-info/entry_points.txt
10
+ src/can_i_park.egg-info/requires.txt
11
+ src/can_i_park.egg-info/top_level.txt
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ can-i-park = can_i_park.__main__:main
3
+ cip = can_i_park.__main__:main
@@ -0,0 +1,6 @@
1
+ certifi>=2025.4.26
2
+ charset-normalizer>=3.4.2
3
+ click>=8.2.1
4
+ idna>=3.10
5
+ requests>=2.32.3
6
+ urllib3>=2.4.0
@@ -0,0 +1 @@
1
+ can_i_park