-
Notifications
You must be signed in to change notification settings - Fork 10
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 #28 from route4me/development
Development
- Loading branch information
Showing
53 changed files
with
2,003 additions
and
1,030 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ Route4Me_SDK.egg-info/ | |
.venv | ||
docs/html/* | ||
.tox | ||
.DS_Store |
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 |
---|---|---|
|
@@ -6,17 +6,17 @@ | |
# VERSION.py - MAINTAINER's. Don't edit, if you don't know what are you doing | ||
# ============================================================================== | ||
|
||
VERSION = (0, 1, 5, 1) | ||
RELEASE_SUFFIX = '' | ||
VERSION = (0, 1, 6, 0) | ||
RELEASE_SUFFIX = "" | ||
|
||
VERSION_STRING = '.'.join([str(x) for x in VERSION]) | ||
VERSION_STRING = ".".join([str(x) for x in VERSION]) | ||
RELEASE_STRING = "v{}{}".format(VERSION_STRING, RELEASE_SUFFIX) | ||
|
||
PROJECT = 'Route4Me Python SDK' | ||
COPYRIGHT = '2016-2021 © Route4Me Python Team' | ||
AUTHOR = 'Route4Me Python Team (SDK)' | ||
AUTHOR_EMAIL = '[email protected]' | ||
TITLE = 'route4me' | ||
LICENSE = 'ISC' | ||
BUILD = None # TRAVIS_COMMIT | ||
PROJECT = "Route4Me Python SDK" | ||
COPYRIGHT = "2016-2021 © Route4Me Python Team" | ||
AUTHOR = "Route4Me Python Team (SDK)" | ||
AUTHOR_EMAIL = "[email protected]" | ||
TITLE = "route4me" | ||
LICENSE = "ISC" | ||
BUILD = None # TRAVIS_COMMIT | ||
COMMIT = None # TRAVIS_BUILD_NUMBER |
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
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
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
27 changes: 27 additions & 0 deletions
27
examples/orders_group/assign_optimization_profile_to_group.py
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,27 @@ | ||
# -*- coding: utf-8 -*- | ||
# codebeat:disable[ABC] | ||
|
||
import argparse | ||
|
||
from route4me import Route4Me | ||
|
||
|
||
def main(api_key): | ||
r4m = Route4Me(api_key) | ||
orders_groups = r4m.orders_group | ||
|
||
group_id = "ACE8FFFFFFFFFFFFFCCCCCCCCCCCCC" | ||
optimization_profile_id = "00000000-1111-1111-1111-000000000000" | ||
data = orders_groups.assign_optimization_profile(optimization_profile_id, group_id) | ||
print(data) | ||
|
||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser(description="Assign Optimization Profile") | ||
parser.add_argument( | ||
"--api_key", dest="api_key", help="Route4Me API KEY", type=str, required=True | ||
) | ||
args = parser.parse_args() | ||
main(args.api_key) | ||
|
||
# codebeat:enable[ABC] |
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,36 @@ | ||
# -*- coding: utf-8 -*- | ||
# codebeat:disable[ABC] | ||
|
||
import argparse | ||
|
||
from route4me import Route4Me | ||
|
||
|
||
def main(api_key): | ||
r4m = Route4Me(api_key) | ||
optimization_profiles = r4m.optimization_profiles | ||
|
||
print("\nGetting Optimization Profiles:\n") | ||
profiles = optimization_profiles.get_optimization_profiles() | ||
|
||
for profile in profiles.get("items", []): | ||
print( | ||
" - ".join( | ||
[ | ||
f"ID: {profile['optimization_profile_id']}", | ||
f"ProfileName: {profile['profile_name']}", | ||
f"isDefault: {profile['is_default']}", | ||
] | ||
) | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser(description="Get Optimizations Profile") | ||
parser.add_argument( | ||
"--api_key", dest="api_key", help="Route4Me API KEY", type=str, required=True | ||
) | ||
args = parser.parse_args() | ||
main(args.api_key) | ||
|
||
# codebeat:enable[ABC] |
Oops, something went wrong.