apiverve-exercises 1.1.5__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,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 APIVerve, and Evlar LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,222 @@
1
+ Metadata-Version: 2.1
2
+ Name: apiverve-exercises
3
+ Version: 1.1.5
4
+ Summary: Exercises is a simple tool for getting exercise information. It returns information on various exercises.
5
+ Author-email: APIVerve <hello@apiverve.com>
6
+ Project-URL: Homepage, https://apiverve.com?utm_source=pypi
7
+ Project-URL: Repository, https://github.com/apiverve/exercises.Python-API
8
+ Project-URL: Documentation, https://docs.apiverve.com/api/exercises?utm_source=pypi
9
+ Project-URL: Twitter, https://twitter.com/apivervehq
10
+ Keywords: exercises,exercises api,exercises tool,exercises software,exercises service
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: Financial and Insurance Industry
17
+ Classifier: Intended Audience :: Healthcare Industry
18
+ Classifier: Intended Audience :: Education
19
+ Classifier: Intended Audience :: Science/Research
20
+ Classifier: Intended Audience :: Information Technology
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Classifier: Topic :: Utilities
23
+ Classifier: Topic :: Scientific/Engineering
24
+ Classifier: Topic :: Education
25
+ Classifier: Topic :: Internet :: WWW/HTTP :: Indexing/Search
26
+ Classifier: Topic :: Internet :: WWW/HTTP :: Site Management
27
+ Classifier: Topic :: Internet :: WWW/HTTP
28
+ Classifier: Topic :: Software Development :: Libraries
29
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
30
+ Classifier: Topic :: Internet
31
+ Classifier: Topic :: Communications
32
+ Classifier: Topic :: Office/Business
33
+ Classifier: Topic :: Text Processing
34
+ Classifier: Topic :: Security
35
+ Classifier: Topic :: Database
36
+ Classifier: Topic :: Software Development :: Code Generators
37
+ Classifier: Topic :: Software Development :: Pre-processors
38
+ Classifier: Topic :: Software Development :: Quality Assurance
39
+ Classifier: Topic :: Software Development :: Testing
40
+ Classifier: Natural Language :: English
41
+ Requires-Python: >=3.12
42
+ Description-Content-Type: text/markdown
43
+ License-File: LICENSE
44
+
45
+ Exercises API
46
+ ============
47
+
48
+ Exercises is a simple tool for getting exercise information. It returns information on various exercises.
49
+
50
+ ![Build Status](https://img.shields.io/badge/build-passing-green)
51
+ ![Code Climate](https://img.shields.io/badge/maintainability-B-purple)
52
+ ![Prod Ready](https://img.shields.io/badge/production-ready-blue)
53
+
54
+ This is a Python API Wrapper for the [Exercises API](https://apiverve.com/marketplace/api/exercises)
55
+
56
+ ---
57
+
58
+ ## Installation
59
+ pip install apiverve-exercises
60
+
61
+ ---
62
+
63
+ ## Configuration
64
+
65
+ Before using the exercises API client, you have to setup your account and obtain your API Key.
66
+ You can get it by signing up at [https://apiverve.com](https://apiverve.com)
67
+
68
+ ---
69
+
70
+ ## Usage
71
+
72
+ The Exercises API documentation is found here: [https://docs.apiverve.com/api/exercises](https://docs.apiverve.com/api/exercises).
73
+ You can find parameters, example responses, and status codes documented here.
74
+
75
+ ### Setup
76
+
77
+ ```
78
+ # Import the client module
79
+ from apiverve_exercises.apiClient import ExercisesAPIClient
80
+
81
+ # Initialize the client with your APIVerve API key
82
+ api = ExercisesAPIClient("[YOUR_API_KEY]")
83
+ ```
84
+
85
+ ---
86
+
87
+
88
+ ### Perform Request
89
+ Using the API client, you can perform requests to the API.
90
+
91
+ ###### Define Query
92
+
93
+ ```
94
+ query = { "muscle": "chest", "name": "barbell", "equipment": "barbell" }
95
+ ```
96
+
97
+ ###### Simple Request
98
+
99
+ ```
100
+ # Make a request to the API
101
+ result = api.execute(query)
102
+
103
+ # Print the result
104
+ print(result)
105
+ ```
106
+
107
+ ###### Example Response
108
+
109
+ ```
110
+ {
111
+ "status": "ok",
112
+ "error": null,
113
+ "data": {
114
+ "count": 5,
115
+ "exercises": [
116
+ {
117
+ "name": "Barbell Ab Rollout",
118
+ "force": "pull",
119
+ "level": "intermediate",
120
+ "mechanic": "compound",
121
+ "equipment": "barbell",
122
+ "instructions": [
123
+ "For this exercise you will need to get into a pushup position, but instead of having your hands of the floor, you will be grabbing on to an Olympic barbell (loaded with 5-10 lbs on each side) instead. This will be your starting position.",
124
+ "While keeping a slight arch on your back, lift your hips and roll the barbell towards your feet as you exhale. Tip: As you perform the movement, your glutes should be coming up, you should be keeping the abs tight and should maintain your back posture at all times. Also your arms should be staying perpendicular to the floor throughout the movement. If you don't, you will work out your shoulders and back more than the abs.",
125
+ "After a second contraction at the top, start to roll the barbell back forward to the starting position slowly as you inhale.",
126
+ "Repeat for the recommended amount of repetitions."
127
+ ],
128
+ "muscle": "biceps"
129
+ },
130
+ {
131
+ "name": "Barbell Ab Rollout - On Knees",
132
+ "force": "pull",
133
+ "level": "expert",
134
+ "mechanic": "compound",
135
+ "equipment": "barbell",
136
+ "instructions": [
137
+ "Hold an Olympic barbell loaded with 5-10lbs on each side and kneel on the floor.",
138
+ "Now place the barbell on the floor in front of you so that you are on all your hands and knees (as in a kneeling push up position). This will be your starting position.",
139
+ "Slowly roll the barbell straight forward, stretching your body into a straight position. Tip: Go down as far as you can without touching the floor with your body. Breathe in during this portion of the movement.",
140
+ "After a second pause at the stretched position, start pulling yourself back to the starting position as you breathe out. Tip: Go slowly and keep your abs tight at all times."
141
+ ],
142
+ "muscle": "biceps"
143
+ },
144
+ {
145
+ "name": "Barbell Bench Press - Medium Grip",
146
+ "force": "push",
147
+ "level": "beginner",
148
+ "mechanic": "compound",
149
+ "equipment": "barbell",
150
+ "instructions": [
151
+ "Lie back on a flat bench. Using a medium width grip (a grip that creates a 90-degree angle in the middle of the movement between the forearms and the upper arms), lift the bar from the rack and hold it straight over you with your arms locked. This will be your starting position.",
152
+ "From the starting position, breathe in and begin coming down slowly until the bar touches your middle chest.",
153
+ "After a brief pause, push the bar back to the starting position as you breathe out. Focus on pushing the bar using your chest muscles. Lock your arms and squeeze your chest in the contracted position at the top of the motion, hold for a second and then start coming down slowly again. Tip: Ideally, lowering the weight should take about twice as long as raising it.",
154
+ "Repeat the movement for the prescribed amount of repetitions.",
155
+ "When you are done, place the bar back in the rack."
156
+ ],
157
+ "muscle": "biceps"
158
+ },
159
+ {
160
+ "name": "Barbell Curl",
161
+ "force": "pull",
162
+ "level": "beginner",
163
+ "mechanic": "isolation",
164
+ "equipment": "barbell",
165
+ "instructions": [
166
+ "Stand up with your torso upright while holding a barbell at a shoulder-width grip. The palm of your hands should be facing forward and the elbows should be close to the torso. This will be your starting position.",
167
+ "While holding the upper arms stationary, curl the weights forward while contracting the biceps as you breathe out. Tip: Only the forearms should move.",
168
+ "Continue the movement until your biceps are fully contracted and the bar is at shoulder level. Hold the contracted position for a second and squeeze the biceps hard.",
169
+ "Slowly begin to bring the bar back to starting position as your breathe in.",
170
+ "Repeat for the recommended amount of repetitions."
171
+ ],
172
+ "muscle": "biceps"
173
+ },
174
+ {
175
+ "name": "Barbell Curls Lying Against An Incline",
176
+ "force": "pull",
177
+ "level": "beginner",
178
+ "mechanic": "isolation",
179
+ "equipment": "barbell",
180
+ "instructions": [
181
+ "Lie against an incline bench, with your arms holding a barbell and hanging down in a horizontal line. This will be your starting position.",
182
+ "While keeping the upper arms stationary, curl the weight up as high as you can while squeezing the biceps. Breathe out as you perform this portion of the movement. Tip: Only the forearms should move. Do not swing the arms.",
183
+ "After a second contraction, slowly go back to the starting position as you inhale. Tip: Make sure that you go all of the way down.",
184
+ "Repeat for the recommended amount of repetitions."
185
+ ],
186
+ "muscle": "biceps"
187
+ }
188
+ ]
189
+ },
190
+ "code": 200
191
+ }
192
+ ```
193
+
194
+ ---
195
+
196
+ ## Customer Support
197
+
198
+ Need any assistance? [Get in touch with Customer Support](https://apiverve.com/contact).
199
+
200
+ ---
201
+
202
+ ## Updates
203
+ Stay up to date by following [@apiverveHQ](https://twitter.com/apiverveHQ) on Twitter.
204
+
205
+ ---
206
+
207
+ ## Legal
208
+
209
+ All usage of the APIVerve website, API, and services is subject to the [APIVerve Terms of Service](https://apiverve.com/terms) and all legal documents and agreements.
210
+
211
+ ---
212
+
213
+ ## License
214
+ Licensed under the The MIT License (MIT)
215
+
216
+ Copyright (&copy;) 2024 APIVerve, and Evlar LLC
217
+
218
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
219
+
220
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
221
+
222
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,178 @@
1
+ Exercises API
2
+ ============
3
+
4
+ Exercises is a simple tool for getting exercise information. It returns information on various exercises.
5
+
6
+ ![Build Status](https://img.shields.io/badge/build-passing-green)
7
+ ![Code Climate](https://img.shields.io/badge/maintainability-B-purple)
8
+ ![Prod Ready](https://img.shields.io/badge/production-ready-blue)
9
+
10
+ This is a Python API Wrapper for the [Exercises API](https://apiverve.com/marketplace/api/exercises)
11
+
12
+ ---
13
+
14
+ ## Installation
15
+ pip install apiverve-exercises
16
+
17
+ ---
18
+
19
+ ## Configuration
20
+
21
+ Before using the exercises API client, you have to setup your account and obtain your API Key.
22
+ You can get it by signing up at [https://apiverve.com](https://apiverve.com)
23
+
24
+ ---
25
+
26
+ ## Usage
27
+
28
+ The Exercises API documentation is found here: [https://docs.apiverve.com/api/exercises](https://docs.apiverve.com/api/exercises).
29
+ You can find parameters, example responses, and status codes documented here.
30
+
31
+ ### Setup
32
+
33
+ ```
34
+ # Import the client module
35
+ from apiverve_exercises.apiClient import ExercisesAPIClient
36
+
37
+ # Initialize the client with your APIVerve API key
38
+ api = ExercisesAPIClient("[YOUR_API_KEY]")
39
+ ```
40
+
41
+ ---
42
+
43
+
44
+ ### Perform Request
45
+ Using the API client, you can perform requests to the API.
46
+
47
+ ###### Define Query
48
+
49
+ ```
50
+ query = { "muscle": "chest", "name": "barbell", "equipment": "barbell" }
51
+ ```
52
+
53
+ ###### Simple Request
54
+
55
+ ```
56
+ # Make a request to the API
57
+ result = api.execute(query)
58
+
59
+ # Print the result
60
+ print(result)
61
+ ```
62
+
63
+ ###### Example Response
64
+
65
+ ```
66
+ {
67
+ "status": "ok",
68
+ "error": null,
69
+ "data": {
70
+ "count": 5,
71
+ "exercises": [
72
+ {
73
+ "name": "Barbell Ab Rollout",
74
+ "force": "pull",
75
+ "level": "intermediate",
76
+ "mechanic": "compound",
77
+ "equipment": "barbell",
78
+ "instructions": [
79
+ "For this exercise you will need to get into a pushup position, but instead of having your hands of the floor, you will be grabbing on to an Olympic barbell (loaded with 5-10 lbs on each side) instead. This will be your starting position.",
80
+ "While keeping a slight arch on your back, lift your hips and roll the barbell towards your feet as you exhale. Tip: As you perform the movement, your glutes should be coming up, you should be keeping the abs tight and should maintain your back posture at all times. Also your arms should be staying perpendicular to the floor throughout the movement. If you don't, you will work out your shoulders and back more than the abs.",
81
+ "After a second contraction at the top, start to roll the barbell back forward to the starting position slowly as you inhale.",
82
+ "Repeat for the recommended amount of repetitions."
83
+ ],
84
+ "muscle": "biceps"
85
+ },
86
+ {
87
+ "name": "Barbell Ab Rollout - On Knees",
88
+ "force": "pull",
89
+ "level": "expert",
90
+ "mechanic": "compound",
91
+ "equipment": "barbell",
92
+ "instructions": [
93
+ "Hold an Olympic barbell loaded with 5-10lbs on each side and kneel on the floor.",
94
+ "Now place the barbell on the floor in front of you so that you are on all your hands and knees (as in a kneeling push up position). This will be your starting position.",
95
+ "Slowly roll the barbell straight forward, stretching your body into a straight position. Tip: Go down as far as you can without touching the floor with your body. Breathe in during this portion of the movement.",
96
+ "After a second pause at the stretched position, start pulling yourself back to the starting position as you breathe out. Tip: Go slowly and keep your abs tight at all times."
97
+ ],
98
+ "muscle": "biceps"
99
+ },
100
+ {
101
+ "name": "Barbell Bench Press - Medium Grip",
102
+ "force": "push",
103
+ "level": "beginner",
104
+ "mechanic": "compound",
105
+ "equipment": "barbell",
106
+ "instructions": [
107
+ "Lie back on a flat bench. Using a medium width grip (a grip that creates a 90-degree angle in the middle of the movement between the forearms and the upper arms), lift the bar from the rack and hold it straight over you with your arms locked. This will be your starting position.",
108
+ "From the starting position, breathe in and begin coming down slowly until the bar touches your middle chest.",
109
+ "After a brief pause, push the bar back to the starting position as you breathe out. Focus on pushing the bar using your chest muscles. Lock your arms and squeeze your chest in the contracted position at the top of the motion, hold for a second and then start coming down slowly again. Tip: Ideally, lowering the weight should take about twice as long as raising it.",
110
+ "Repeat the movement for the prescribed amount of repetitions.",
111
+ "When you are done, place the bar back in the rack."
112
+ ],
113
+ "muscle": "biceps"
114
+ },
115
+ {
116
+ "name": "Barbell Curl",
117
+ "force": "pull",
118
+ "level": "beginner",
119
+ "mechanic": "isolation",
120
+ "equipment": "barbell",
121
+ "instructions": [
122
+ "Stand up with your torso upright while holding a barbell at a shoulder-width grip. The palm of your hands should be facing forward and the elbows should be close to the torso. This will be your starting position.",
123
+ "While holding the upper arms stationary, curl the weights forward while contracting the biceps as you breathe out. Tip: Only the forearms should move.",
124
+ "Continue the movement until your biceps are fully contracted and the bar is at shoulder level. Hold the contracted position for a second and squeeze the biceps hard.",
125
+ "Slowly begin to bring the bar back to starting position as your breathe in.",
126
+ "Repeat for the recommended amount of repetitions."
127
+ ],
128
+ "muscle": "biceps"
129
+ },
130
+ {
131
+ "name": "Barbell Curls Lying Against An Incline",
132
+ "force": "pull",
133
+ "level": "beginner",
134
+ "mechanic": "isolation",
135
+ "equipment": "barbell",
136
+ "instructions": [
137
+ "Lie against an incline bench, with your arms holding a barbell and hanging down in a horizontal line. This will be your starting position.",
138
+ "While keeping the upper arms stationary, curl the weight up as high as you can while squeezing the biceps. Breathe out as you perform this portion of the movement. Tip: Only the forearms should move. Do not swing the arms.",
139
+ "After a second contraction, slowly go back to the starting position as you inhale. Tip: Make sure that you go all of the way down.",
140
+ "Repeat for the recommended amount of repetitions."
141
+ ],
142
+ "muscle": "biceps"
143
+ }
144
+ ]
145
+ },
146
+ "code": 200
147
+ }
148
+ ```
149
+
150
+ ---
151
+
152
+ ## Customer Support
153
+
154
+ Need any assistance? [Get in touch with Customer Support](https://apiverve.com/contact).
155
+
156
+ ---
157
+
158
+ ## Updates
159
+ Stay up to date by following [@apiverveHQ](https://twitter.com/apiverveHQ) on Twitter.
160
+
161
+ ---
162
+
163
+ ## Legal
164
+
165
+ All usage of the APIVerve website, API, and services is subject to the [APIVerve Terms of Service](https://apiverve.com/terms) and all legal documents and agreements.
166
+
167
+ ---
168
+
169
+ ## License
170
+ Licensed under the The MIT License (MIT)
171
+
172
+ Copyright (&copy;) 2024 APIVerve, and Evlar LLC
173
+
174
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
175
+
176
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
177
+
178
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,48 @@
1
+ [project]
2
+ name = "apiverve-exercises"
3
+ version = "1.1.5"
4
+ authors = [
5
+ { name="APIVerve", email="hello@apiverve.com" },
6
+ ]
7
+ description = "Exercises is a simple tool for getting exercise information. It returns information on various exercises."
8
+ keywords = ["exercises","exercises api","exercises tool","exercises software","exercises service"]
9
+ readme = "README.md"
10
+ requires-python = ">=3.12"
11
+ classifiers = [
12
+ "Development Status :: 5 - Production/Stable",
13
+ "Programming Language :: Python :: 3",
14
+ "License :: OSI Approved :: MIT License",
15
+ "Operating System :: OS Independent",
16
+ "Intended Audience :: Developers",
17
+ "Intended Audience :: Financial and Insurance Industry",
18
+ "Intended Audience :: Healthcare Industry",
19
+ "Intended Audience :: Education",
20
+ "Intended Audience :: Science/Research",
21
+ "Intended Audience :: Information Technology",
22
+ "Topic :: Software Development :: Libraries :: Python Modules",
23
+ "Topic :: Utilities",
24
+ "Topic :: Scientific/Engineering",
25
+ "Topic :: Education",
26
+ "Topic :: Internet :: WWW/HTTP :: Indexing/Search",
27
+ "Topic :: Internet :: WWW/HTTP :: Site Management",
28
+ "Topic :: Internet :: WWW/HTTP",
29
+ "Topic :: Software Development :: Libraries",
30
+ "Topic :: Software Development :: Libraries :: Application Frameworks",
31
+ "Topic :: Internet",
32
+ "Topic :: Communications",
33
+ "Topic :: Office/Business",
34
+ "Topic :: Text Processing",
35
+ "Topic :: Security",
36
+ "Topic :: Database",
37
+ "Topic :: Software Development :: Code Generators",
38
+ "Topic :: Software Development :: Pre-processors",
39
+ "Topic :: Software Development :: Quality Assurance",
40
+ "Topic :: Software Development :: Testing",
41
+ "Natural Language :: English",
42
+ ]
43
+
44
+ [project.urls]
45
+ Homepage = "https://apiverve.com?utm_source=pypi"
46
+ Repository = "https://github.com/apiverve/exercises.Python-API"
47
+ Documentation = "https://docs.apiverve.com/api/exercises?utm_source=pypi"
48
+ Twitter = "https://twitter.com/apivervehq"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1 @@
1
+ from .apiClient import ExercisesAPIClient
@@ -0,0 +1,38 @@
1
+ import requests
2
+
3
+ class ExercisesAPIClient:
4
+ def __init__(self, api_key, secure=True):
5
+ """
6
+ Initialize the ExercisesAPIClient with the API key and secure flag
7
+ :param api_key: API key
8
+ :param secure: Deprecated. Always set to True
9
+ """
10
+
11
+ self.api_key = api_key
12
+ self.secure = secure
13
+ self.base_url = 'https://api.apiverve.com/v1/exercises'
14
+ self.headers = {
15
+ 'x-api-key': self.api_key,
16
+ 'auth-mode': 'pypi-package'
17
+ }
18
+
19
+ def execute(self, params=None):
20
+ """
21
+ Execute the API request
22
+ :param params: API parameters, if any
23
+ :return: API response
24
+ """
25
+
26
+ method = "GET"
27
+
28
+ try:
29
+ if method.upper() == 'POST':
30
+ response = requests.post(self.base_url, headers=self.headers, json=params)
31
+ else:
32
+ response = requests.get(self.base_url, headers=self.headers, params=params)
33
+
34
+ response.raise_for_status()
35
+ return response.json()
36
+ except requests.exceptions.RequestException as e:
37
+ print(f"An error occurred: {e}")
38
+ raise e
@@ -0,0 +1,3 @@
1
+ class ExercisesExercisesAPIError(Exception):
2
+ """A custom exception for API errors"""
3
+ pass
@@ -0,0 +1,26 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ import os
4
+ lib_folder = os.path.dirname(os.path.realpath(__file__))
5
+ requirements_file = os.path.join(lib_folder, 'requirements.txt')
6
+ install_requires = ["requests >= 2.25.1", "setuptools >= 56.0.0"]
7
+ if os.path.exists(requirements_file):
8
+ with open(requirements_file, 'r') as f:
9
+ install_requires = f.read().splitlines()
10
+
11
+ setup(
12
+ name='apiverve_exercises',
13
+ version='1.1.5',
14
+ packages=find_packages(),
15
+ include_package_data=True,
16
+ install_requires=install_requires,
17
+ description='Exercises is a simple tool for getting exercise information. It returns information on various exercises.',
18
+ author='APIVerve',
19
+ author_email='hello@apiverve.com',
20
+ url='https://apiverve.com',
21
+ classifiers=[
22
+ 'Programming Language :: Python :: 3',
23
+ 'Operating System :: OS Independent',
24
+ ],
25
+ python_requires='>=3.6',
26
+ )
@@ -0,0 +1,21 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name='apiverve_exercises',
5
+ version='1.1.5',
6
+ packages=find_packages(),
7
+ include_package_data=True,
8
+ install_requires=[
9
+ 'requests',
10
+ 'setuptools'
11
+ ],
12
+ description='Exercises is a simple tool for getting exercise information. It returns information on various exercises.',
13
+ author='APIVerve',
14
+ author_email='hello@apiverve.com',
15
+ url='https://apiverve.com',
16
+ classifiers=[
17
+ 'Programming Language :: Python :: 3',
18
+ 'Operating System :: OS Independent',
19
+ ],
20
+ python_requires='>=3.6',
21
+ )
@@ -0,0 +1 @@
1
+ # Initialize test module
@@ -0,0 +1,19 @@
1
+ import unittest
2
+ from apiverve_exercises.apiClient import ExercisesAPIClient
3
+
4
+ class TestClient(unittest.TestCase):
5
+
6
+ def setUp(self):
7
+ self.api_key = 'test_api_key'
8
+ self.client = ExercisesAPIClient(self.api_key)
9
+
10
+ def test_get(self):
11
+ # Assuming there's an endpoint 'test_endpoint' for testing purposes
12
+ try:
13
+ response = self.client.get('test_endpoint')
14
+ self.assertIsInstance(response, dict)
15
+ except Exception as e:
16
+ self.fail(f"GET request failed with exception {e}")
17
+
18
+ if __name__ == '__main__':
19
+ unittest.main()
@@ -0,0 +1,222 @@
1
+ Metadata-Version: 2.1
2
+ Name: apiverve-exercises
3
+ Version: 1.1.5
4
+ Summary: Exercises is a simple tool for getting exercise information. It returns information on various exercises.
5
+ Author-email: APIVerve <hello@apiverve.com>
6
+ Project-URL: Homepage, https://apiverve.com?utm_source=pypi
7
+ Project-URL: Repository, https://github.com/apiverve/exercises.Python-API
8
+ Project-URL: Documentation, https://docs.apiverve.com/api/exercises?utm_source=pypi
9
+ Project-URL: Twitter, https://twitter.com/apivervehq
10
+ Keywords: exercises,exercises api,exercises tool,exercises software,exercises service
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: Financial and Insurance Industry
17
+ Classifier: Intended Audience :: Healthcare Industry
18
+ Classifier: Intended Audience :: Education
19
+ Classifier: Intended Audience :: Science/Research
20
+ Classifier: Intended Audience :: Information Technology
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Classifier: Topic :: Utilities
23
+ Classifier: Topic :: Scientific/Engineering
24
+ Classifier: Topic :: Education
25
+ Classifier: Topic :: Internet :: WWW/HTTP :: Indexing/Search
26
+ Classifier: Topic :: Internet :: WWW/HTTP :: Site Management
27
+ Classifier: Topic :: Internet :: WWW/HTTP
28
+ Classifier: Topic :: Software Development :: Libraries
29
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
30
+ Classifier: Topic :: Internet
31
+ Classifier: Topic :: Communications
32
+ Classifier: Topic :: Office/Business
33
+ Classifier: Topic :: Text Processing
34
+ Classifier: Topic :: Security
35
+ Classifier: Topic :: Database
36
+ Classifier: Topic :: Software Development :: Code Generators
37
+ Classifier: Topic :: Software Development :: Pre-processors
38
+ Classifier: Topic :: Software Development :: Quality Assurance
39
+ Classifier: Topic :: Software Development :: Testing
40
+ Classifier: Natural Language :: English
41
+ Requires-Python: >=3.12
42
+ Description-Content-Type: text/markdown
43
+ License-File: LICENSE
44
+
45
+ Exercises API
46
+ ============
47
+
48
+ Exercises is a simple tool for getting exercise information. It returns information on various exercises.
49
+
50
+ ![Build Status](https://img.shields.io/badge/build-passing-green)
51
+ ![Code Climate](https://img.shields.io/badge/maintainability-B-purple)
52
+ ![Prod Ready](https://img.shields.io/badge/production-ready-blue)
53
+
54
+ This is a Python API Wrapper for the [Exercises API](https://apiverve.com/marketplace/api/exercises)
55
+
56
+ ---
57
+
58
+ ## Installation
59
+ pip install apiverve-exercises
60
+
61
+ ---
62
+
63
+ ## Configuration
64
+
65
+ Before using the exercises API client, you have to setup your account and obtain your API Key.
66
+ You can get it by signing up at [https://apiverve.com](https://apiverve.com)
67
+
68
+ ---
69
+
70
+ ## Usage
71
+
72
+ The Exercises API documentation is found here: [https://docs.apiverve.com/api/exercises](https://docs.apiverve.com/api/exercises).
73
+ You can find parameters, example responses, and status codes documented here.
74
+
75
+ ### Setup
76
+
77
+ ```
78
+ # Import the client module
79
+ from apiverve_exercises.apiClient import ExercisesAPIClient
80
+
81
+ # Initialize the client with your APIVerve API key
82
+ api = ExercisesAPIClient("[YOUR_API_KEY]")
83
+ ```
84
+
85
+ ---
86
+
87
+
88
+ ### Perform Request
89
+ Using the API client, you can perform requests to the API.
90
+
91
+ ###### Define Query
92
+
93
+ ```
94
+ query = { "muscle": "chest", "name": "barbell", "equipment": "barbell" }
95
+ ```
96
+
97
+ ###### Simple Request
98
+
99
+ ```
100
+ # Make a request to the API
101
+ result = api.execute(query)
102
+
103
+ # Print the result
104
+ print(result)
105
+ ```
106
+
107
+ ###### Example Response
108
+
109
+ ```
110
+ {
111
+ "status": "ok",
112
+ "error": null,
113
+ "data": {
114
+ "count": 5,
115
+ "exercises": [
116
+ {
117
+ "name": "Barbell Ab Rollout",
118
+ "force": "pull",
119
+ "level": "intermediate",
120
+ "mechanic": "compound",
121
+ "equipment": "barbell",
122
+ "instructions": [
123
+ "For this exercise you will need to get into a pushup position, but instead of having your hands of the floor, you will be grabbing on to an Olympic barbell (loaded with 5-10 lbs on each side) instead. This will be your starting position.",
124
+ "While keeping a slight arch on your back, lift your hips and roll the barbell towards your feet as you exhale. Tip: As you perform the movement, your glutes should be coming up, you should be keeping the abs tight and should maintain your back posture at all times. Also your arms should be staying perpendicular to the floor throughout the movement. If you don't, you will work out your shoulders and back more than the abs.",
125
+ "After a second contraction at the top, start to roll the barbell back forward to the starting position slowly as you inhale.",
126
+ "Repeat for the recommended amount of repetitions."
127
+ ],
128
+ "muscle": "biceps"
129
+ },
130
+ {
131
+ "name": "Barbell Ab Rollout - On Knees",
132
+ "force": "pull",
133
+ "level": "expert",
134
+ "mechanic": "compound",
135
+ "equipment": "barbell",
136
+ "instructions": [
137
+ "Hold an Olympic barbell loaded with 5-10lbs on each side and kneel on the floor.",
138
+ "Now place the barbell on the floor in front of you so that you are on all your hands and knees (as in a kneeling push up position). This will be your starting position.",
139
+ "Slowly roll the barbell straight forward, stretching your body into a straight position. Tip: Go down as far as you can without touching the floor with your body. Breathe in during this portion of the movement.",
140
+ "After a second pause at the stretched position, start pulling yourself back to the starting position as you breathe out. Tip: Go slowly and keep your abs tight at all times."
141
+ ],
142
+ "muscle": "biceps"
143
+ },
144
+ {
145
+ "name": "Barbell Bench Press - Medium Grip",
146
+ "force": "push",
147
+ "level": "beginner",
148
+ "mechanic": "compound",
149
+ "equipment": "barbell",
150
+ "instructions": [
151
+ "Lie back on a flat bench. Using a medium width grip (a grip that creates a 90-degree angle in the middle of the movement between the forearms and the upper arms), lift the bar from the rack and hold it straight over you with your arms locked. This will be your starting position.",
152
+ "From the starting position, breathe in and begin coming down slowly until the bar touches your middle chest.",
153
+ "After a brief pause, push the bar back to the starting position as you breathe out. Focus on pushing the bar using your chest muscles. Lock your arms and squeeze your chest in the contracted position at the top of the motion, hold for a second and then start coming down slowly again. Tip: Ideally, lowering the weight should take about twice as long as raising it.",
154
+ "Repeat the movement for the prescribed amount of repetitions.",
155
+ "When you are done, place the bar back in the rack."
156
+ ],
157
+ "muscle": "biceps"
158
+ },
159
+ {
160
+ "name": "Barbell Curl",
161
+ "force": "pull",
162
+ "level": "beginner",
163
+ "mechanic": "isolation",
164
+ "equipment": "barbell",
165
+ "instructions": [
166
+ "Stand up with your torso upright while holding a barbell at a shoulder-width grip. The palm of your hands should be facing forward and the elbows should be close to the torso. This will be your starting position.",
167
+ "While holding the upper arms stationary, curl the weights forward while contracting the biceps as you breathe out. Tip: Only the forearms should move.",
168
+ "Continue the movement until your biceps are fully contracted and the bar is at shoulder level. Hold the contracted position for a second and squeeze the biceps hard.",
169
+ "Slowly begin to bring the bar back to starting position as your breathe in.",
170
+ "Repeat for the recommended amount of repetitions."
171
+ ],
172
+ "muscle": "biceps"
173
+ },
174
+ {
175
+ "name": "Barbell Curls Lying Against An Incline",
176
+ "force": "pull",
177
+ "level": "beginner",
178
+ "mechanic": "isolation",
179
+ "equipment": "barbell",
180
+ "instructions": [
181
+ "Lie against an incline bench, with your arms holding a barbell and hanging down in a horizontal line. This will be your starting position.",
182
+ "While keeping the upper arms stationary, curl the weight up as high as you can while squeezing the biceps. Breathe out as you perform this portion of the movement. Tip: Only the forearms should move. Do not swing the arms.",
183
+ "After a second contraction, slowly go back to the starting position as you inhale. Tip: Make sure that you go all of the way down.",
184
+ "Repeat for the recommended amount of repetitions."
185
+ ],
186
+ "muscle": "biceps"
187
+ }
188
+ ]
189
+ },
190
+ "code": 200
191
+ }
192
+ ```
193
+
194
+ ---
195
+
196
+ ## Customer Support
197
+
198
+ Need any assistance? [Get in touch with Customer Support](https://apiverve.com/contact).
199
+
200
+ ---
201
+
202
+ ## Updates
203
+ Stay up to date by following [@apiverveHQ](https://twitter.com/apiverveHQ) on Twitter.
204
+
205
+ ---
206
+
207
+ ## Legal
208
+
209
+ All usage of the APIVerve website, API, and services is subject to the [APIVerve Terms of Service](https://apiverve.com/terms) and all legal documents and agreements.
210
+
211
+ ---
212
+
213
+ ## License
214
+ Licensed under the The MIT License (MIT)
215
+
216
+ Copyright (&copy;) 2024 APIVerve, and Evlar LLC
217
+
218
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
219
+
220
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
221
+
222
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,15 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/apiverve_exercises/__init__.py
5
+ src/apiverve_exercises/apiClient.py
6
+ src/apiverve_exercises/exceptions.py
7
+ src/apiverve_exercises/setup.py
8
+ src/apiverve_exercises/setup_dep.py
9
+ src/apiverve_exercises.egg-info/PKG-INFO
10
+ src/apiverve_exercises.egg-info/SOURCES.txt
11
+ src/apiverve_exercises.egg-info/dependency_links.txt
12
+ src/apiverve_exercises.egg-info/top_level.txt
13
+ src/apiverve_exercises/tests/__init__.py
14
+ src/apiverve_exercises/tests/test_api.py
15
+ tests/test_api.py
@@ -0,0 +1 @@
1
+ apiverve_exercises
@@ -0,0 +1,27 @@
1
+ import unittest
2
+ from apiverve_exercises.apiClient import ExercisesAPIClient
3
+ from unittest.mock import patch
4
+
5
+ class TestExercisesAPIClient(unittest.TestCase):
6
+
7
+ def setUp(self):
8
+ self.api_key = 'test_api_key'
9
+ self.client = ExercisesAPIClient(self.api_key)
10
+
11
+ @patch('apiverve_exercises.apiClient.requests.get')
12
+ def test_make_request_success(self, mock_get):
13
+ # Assuming there's an endpoint 'test_endpoint' for testing purposes
14
+ mock_get.return_value.status_code = 200
15
+ mock_get.return_value.json.return_value = {'test': 'test'}
16
+ response = self.client.get('test_endpoint')
17
+ self.assertIsInstance(response, dict)
18
+
19
+ @patch('apiverve_exercises.apiClient.requests.get')
20
+ def test_make_request_failure(self, mock_get):
21
+ # Assuming there's an endpoint 'test_endpoint' for testing purposes
22
+ mock_get.return_value.status_code = 404
23
+ with self.assertRaises(Exception):
24
+ self.client.get('test_endpoint')
25
+
26
+ if __name__ == '__main__':
27
+ unittest.main()