-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from hugovk/cli
Add CLI as strava_py
- Loading branch information
Showing
8 changed files
with
86 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
[metadata] | ||
name = strava_py | ||
version = 0.0.1 | ||
description = Create artistic visualisations with your exercise data | ||
long_description = file: README.md | ||
long_description_content_type = text/markdown | ||
url = https://github.com/marcusvolz/strava_py | ||
author = Marcus Volz | ||
license = MIT | ||
license_file = LICENSE | ||
classifiers = | ||
Development Status :: 3 - Alpha | ||
License :: OSI Approved :: MIT License | ||
Programming Language :: Python :: 3 | ||
Programming Language :: Python :: 3 :: Only | ||
Programming Language :: Python :: 3.7 | ||
Programming Language :: Python :: 3.8 | ||
Programming Language :: Python :: 3.9 | ||
Programming Language :: Python :: 3.10 | ||
Topic :: Artistic Software | ||
Topic :: Multimedia :: Graphics | ||
Topic :: Scientific/Engineering :: Visualization | ||
keywords = | ||
strava | ||
artistic visualisations | ||
artistic | ||
visualisation | ||
exercise data | ||
exercise | ||
project_urls = | ||
Source=https://github.com/marcusvolz/strava_py | ||
|
||
[options] | ||
packages = find: | ||
install_requires = | ||
fit2gpx | ||
gpxpy | ||
matplotlib | ||
pandas | ||
seaborn | ||
python_requires = >=3.7 | ||
package_dir = =src | ||
zip_safe = True | ||
|
||
[options.packages.find] | ||
where = src | ||
|
||
[options.entry_points] | ||
console_scripts = | ||
strava_py = strava_py.cli:main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from setuptools import setup | ||
|
||
setup() |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from strava_py import cli | ||
|
||
if __name__ == "__main__": | ||
cli.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import argparse | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser( | ||
formatter_class=argparse.ArgumentDefaultsHelpFormatter | ||
) | ||
parser.add_argument("path", help="Input path to folder with GPX and / or FIT files") | ||
parser.add_argument( | ||
"-o", "--output_file", default="plot.png", help="Output PNG file" | ||
) | ||
args = parser.parse_args() | ||
|
||
# Normally imports go at the top, but scientific libraries can be slow to import | ||
# so let's validate arguments first | ||
from strava_py.plot_facets import plot_facets | ||
from strava_py.process_data import process_data | ||
|
||
print("Processing data...") | ||
df = process_data(args.path) | ||
|
||
print("Plotting facets...") | ||
plot_facets(df, output_file=args.output_file) | ||
print(f"Saved to {args.output_file}") | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
File renamed without changes.
File renamed without changes.