nextmv


Namenextmv JSON
Version 0.13.1 PyPI version JSON
download
home_pageNone
SummaryThe Python SDK for Nextmv
upload_time2024-10-17 05:34:09
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseApache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2022-2023 nextmv.io inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
keywords decision engineering decision science decisions nextmv operations research optimization shift scheduling solver vehicle routing problem
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Nextmv Python SDK

This is the Python SDK for the Nextmv Platform.

## Installation

Requires Python `>=3.8`. Install using `pip`:

```bash
pip install nextmv
```

## Usage

The Nextmv Python SDK is used to interact with various parts of the Nextmv
Platform:

- [Working with a Decision Model][working-with-a-decision-model]: Get to know
      the functionality for running decision models. These API functions work
      the same way in any machine (local or hosted).
- [Cloud][cloud]: Interact with the Nextmv Cloud API.

### Working with a Decision Model

To run a model, you can use the various helper functionality provided by the
SDK. Note that when you create an app that runs locally in your machine, it
will run in the same way in a Nextmv Cloud-hosted machine.

#### Options

Use options to capture parameters (i.e.: configurations) for the run:

```python
import nextmv

options = nextmv.Options(
    nextmv.Parameter("str_option", str, "default value", "A string option", required=True),
    nextmv.Parameter("int_option", int, 1, "An int option", required=False),
    nextmv.Parameter("float_option", float, 1.0, "A float option", required=False),
    nextmv.Parameter("bool_option", bool, True, "A bool option", required=True),
)

print(options.str_option)
print(options.int_option)
print(options.float_option)
print(options.bool_option)
print(options.to_dict())
```

By using options, you are able to pass in the values of the parameters with CLI
arguments or environment variables.

<!-- markdownlint-disable -->

```bash
$ python main.py --help
usage: main.py [options]

Options for main.py. Use command-line arguments (highest precedence) or environment variables.

optiTo exclude the `markdownlint` rule start and end block, you can use the
following syntax in your markdown file:STR_OPTION
        [env var: STR_OPTION] (required) (default: default value) (type: str): A string option
  -int_optRemember to replace `Your markdown content here` with your actual markdown
content.(type: int): An int option
  -float_option FLOAT_OPTION, --float_option FLOAT_OPTION
        [env var: FLOAT_OPTION] (default: 1.0) (type: float): A float option
  -bool_option BOOL_OPTION, --bool_option BOOL_OPTION
        [env var: BOOL_OPTION] (required) (default: True) (type: bool): A bool option
```

<!-- markdownlint-enable -->

#### Input

Capture the input data for the run.

- Work with `JSON`inputs.

    ```python
    import nextmv

    # Read JSON from stdin.
    json_input_1 = nextmv.load_local()
    print(json_input_1.data)

    # Can also specify JSON format directly, and read from a file.
    json_input_2 = nextmv.load_local(input_format=nextmv.InputFormat.JSON, path="input.json")
    print(json_input_2.data)
    ```

- Work with plain, `utf-8` encoded, text inputs.

    ```python
    import nextmv

    # Read text from stdin.
    text_input_1 = nextmv.load_local(input_format=nextmv.InputFormat.TEXT)
    print(text_input_1.data)

    # Can also read from a file.
    text_input_2 = nextmv.load_local(input_format=nextmv.InputFormat.TEXT, path="input.txt")
    print(text_input_2.data)
    ```

<!-- markdownlint-disable -->

- Work with multiple `CSV` files.

    ```python
    import nextmv

    # Read multiple CSV files from a dir named "input".
    csv_archive_input_1 = nextmv.load_local(input_format=nextmv.InputFormat.CSV_ARCHIVE)
    print(csv_archive_input_1.data)

    # Read multiple CSV files from a custom dir.
    csv_archive_input_2 = nextmv.load_local(input_format=nextmv.InputFormat.CSV_ARCHIVE, path="custom_dir")
    print(csv_archive_input_2.data)
    ```

<!-- markdownlint-enable -->

#### Logging

The Nextmv platform captures logs via `stderr`. Use the provided functionality
to record logs.

```python
import sys

import nextmv

print("0. I do nothing")

nextmv.redirect_stdout()

nextmv.log("1. I log a message to stderr")

print("2. I print a message to stdout")

nextmv.reset_stdout()

print("3. I print another message to stdout")

print("4. I print yet another message to stderr without the logger", file=sys.stderr)

nextmv.log("5. I log a message to stderr using the nextmv module directly")

print("6. I print a message to stdout, again")
```

After executing it, here are the messages printed to the different streams.

- `stdout`

    ```txt
    1. I do nothing
    2. I print another message to stdout
    3. I print a message to stdout, again
    ```

- `stderr`

    ```txt
    1. I log a message to stderr
    2. I print a message to stdout
    3. I print yet another message to stderr without the logger
    4. I log a message to stderr using the nextmv module directly
    ```

#### Output

Write the output data after a run is completed.

- Work with `JSON` outputs.

    ```python
    import nextmv

    output = nextmv.Output(
        solution={"foo": "bar"},
        statistics=nextmv.Statistics(
            result=nextmv.ResultStatistics(
                duration=1.0,
                value=2.0,
                custom={"custom": "result_value"},
            ),
            run=nextmv.RunStatistics(
                duration=3.0,
                iterations=4,
                custom={"custom": "run_value"},
            ),
        ),
    )

    # Write to stdout.
    nextmv.write_local(output)

    # Write to a file.
    nextmv.write_local(output, path="output.json")
    ```

- Work with multple `CSV` files.

    ```python
    import nextmv

    output = nextmv.Output(
        output_format=nextmv.OutputFormat.CSV_ARCHIVE,
        solution={
            "output": [
                {"name": "Alice", "age": 30},
                {"name": "Bob", "age": 40},
            ],
        },
        statistics=nextmv.Statistics(
            result=nextmv.ResultStatistics(
                duration=1.0,
                value=2.0,
                custom={"custom": "result_value"},
            ),
            run=nextmv.RunStatistics(
                duration=3.0,
                iterations=4,
                custom={"custom": "run_value"},
            ),
        ),
    )

    # Write multiple CSV fiules to a dir named "output".
    nextmv.write_local(output)

    # Write multiple CSV files to a custom dir.
    nextmv.write_local(output, "custom_dir")
    ```

### Cloud

Before starting:

1. [Sign up][signup] for a Nextmv account.
2. Get your API key. Go to [Team > API Key][api-key].

Visit the [docs][docs] for more information. Make sure that you have your API
key set as an environment variable:

```bash
export NEXTMV_API_KEY="<YOUR-API-KEY>"
```

Additionally, you must have a valid app in Nextmv Cloud.

#### Push an application

Place the following script in the root of your app directory and run it to push
your app to the Nextmv Cloud. This is equivalent to using the Nextmv CLI and
running `nextmv app push`.

```python
import os

from nextmv import cloud

client = cloud.Client(api_key=os.getenv("NEXTMV_API_KEY"))
app = cloud.Application(client=client, id="<YOUR-APP-ID>")
app.push()  # Use verbose=True for step-by-step output.
```

#### Run an application

Make a run and get the results.

```python
import os

from nextmv import cloud

input = {
    "defaults": {"vehicles": {"speed": 20}},
    "stops": [
        {
            "id": "Nijō Castle",
            "location": {"lon": 135.748134, "lat": 35.014239},
            "quantity": -1,
        },
        {
            "id": "Kyoto Imperial Palace",
            "location": {"lon": 135.762057, "lat": 35.025431},
            "quantity": -1,
        },
    ],
    "vehicles": [
        {
            "id": "v2",
            "capacity": 2,
            "start_location": {"lon": 135.728898, "lat": 35.039705},
        },
    ],
}

client = cloud.Client(api_key=os.getenv("NEXTMV_API_KEY"))
app = cloud.Application(client=client, id="<YOUR-APP-ID>")
result = app.new_run_with_result(
    input=input,
    instance_id="latest",
    run_options={"solve.duration": "1s"},
    polling_options=cloud.PollingOptions(),  # Customize the polling options.
)
print(result.to_dict())
```

[signup]: https://cloud.nextmv.io
[docs]: https://nextmv.io/docs
[api-key]: https://cloud.nextmv.io/team/api-keys
[cloud]: #cloud
[working-with-a-decision-model]: #working-with-a-decision-model

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "nextmv",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "Nextmv <tech@nextmv.io>",
    "keywords": "decision engineering, decision science, decisions, nextmv, operations research, optimization, shift scheduling, solver, vehicle routing problem",
    "author": null,
    "author_email": "Nextmv <tech@nextmv.io>",
    "download_url": "https://files.pythonhosted.org/packages/b0/95/0abbdd7603e89ecd530e6026b49ad77fe044c856a347142da3a4327c83a3/nextmv-0.13.1.tar.gz",
    "platform": null,
    "description": "# Nextmv Python SDK\n\nThis is the Python SDK for the Nextmv Platform.\n\n## Installation\n\nRequires Python `>=3.8`. Install using `pip`:\n\n```bash\npip install nextmv\n```\n\n## Usage\n\nThe Nextmv Python SDK is used to interact with various parts of the Nextmv\nPlatform:\n\n- [Working with a Decision Model][working-with-a-decision-model]: Get to know\n      the functionality for running decision models. These API functions work\n      the same way in any machine (local or hosted).\n- [Cloud][cloud]: Interact with the Nextmv Cloud API.\n\n### Working with a Decision Model\n\nTo run a model, you can use the various helper functionality provided by the\nSDK. Note that when you create an app that runs locally in your machine, it\nwill run in the same way in a Nextmv Cloud-hosted machine.\n\n#### Options\n\nUse options to capture parameters (i.e.: configurations) for the run:\n\n```python\nimport nextmv\n\noptions = nextmv.Options(\n    nextmv.Parameter(\"str_option\", str, \"default value\", \"A string option\", required=True),\n    nextmv.Parameter(\"int_option\", int, 1, \"An int option\", required=False),\n    nextmv.Parameter(\"float_option\", float, 1.0, \"A float option\", required=False),\n    nextmv.Parameter(\"bool_option\", bool, True, \"A bool option\", required=True),\n)\n\nprint(options.str_option)\nprint(options.int_option)\nprint(options.float_option)\nprint(options.bool_option)\nprint(options.to_dict())\n```\n\nBy using options, you are able to pass in the values of the parameters with CLI\narguments or environment variables.\n\n<!-- markdownlint-disable -->\n\n```bash\n$ python main.py --help\nusage: main.py [options]\n\nOptions for main.py. Use command-line arguments (highest precedence) or environment variables.\n\noptiTo exclude the `markdownlint` rule start and end block, you can use the\nfollowing syntax in your markdown file:STR_OPTION\n        [env var: STR_OPTION] (required) (default: default value) (type: str): A string option\n  -int_optRemember to replace `Your markdown content here` with your actual markdown\ncontent.(type: int): An int option\n  -float_option FLOAT_OPTION, --float_option FLOAT_OPTION\n        [env var: FLOAT_OPTION] (default: 1.0) (type: float): A float option\n  -bool_option BOOL_OPTION, --bool_option BOOL_OPTION\n        [env var: BOOL_OPTION] (required) (default: True) (type: bool): A bool option\n```\n\n<!-- markdownlint-enable -->\n\n#### Input\n\nCapture the input data for the run.\n\n- Work with `JSON`inputs.\n\n    ```python\n    import nextmv\n\n    # Read JSON from stdin.\n    json_input_1 = nextmv.load_local()\n    print(json_input_1.data)\n\n    # Can also specify JSON format directly, and read from a file.\n    json_input_2 = nextmv.load_local(input_format=nextmv.InputFormat.JSON, path=\"input.json\")\n    print(json_input_2.data)\n    ```\n\n- Work with plain, `utf-8` encoded, text inputs.\n\n    ```python\n    import nextmv\n\n    # Read text from stdin.\n    text_input_1 = nextmv.load_local(input_format=nextmv.InputFormat.TEXT)\n    print(text_input_1.data)\n\n    # Can also read from a file.\n    text_input_2 = nextmv.load_local(input_format=nextmv.InputFormat.TEXT, path=\"input.txt\")\n    print(text_input_2.data)\n    ```\n\n<!-- markdownlint-disable -->\n\n- Work with multiple `CSV` files.\n\n    ```python\n    import nextmv\n\n    # Read multiple CSV files from a dir named \"input\".\n    csv_archive_input_1 = nextmv.load_local(input_format=nextmv.InputFormat.CSV_ARCHIVE)\n    print(csv_archive_input_1.data)\n\n    # Read multiple CSV files from a custom dir.\n    csv_archive_input_2 = nextmv.load_local(input_format=nextmv.InputFormat.CSV_ARCHIVE, path=\"custom_dir\")\n    print(csv_archive_input_2.data)\n    ```\n\n<!-- markdownlint-enable -->\n\n#### Logging\n\nThe Nextmv platform captures logs via `stderr`. Use the provided functionality\nto record logs.\n\n```python\nimport sys\n\nimport nextmv\n\nprint(\"0. I do nothing\")\n\nnextmv.redirect_stdout()\n\nnextmv.log(\"1. I log a message to stderr\")\n\nprint(\"2. I print a message to stdout\")\n\nnextmv.reset_stdout()\n\nprint(\"3. I print another message to stdout\")\n\nprint(\"4. I print yet another message to stderr without the logger\", file=sys.stderr)\n\nnextmv.log(\"5. I log a message to stderr using the nextmv module directly\")\n\nprint(\"6. I print a message to stdout, again\")\n```\n\nAfter executing it, here are the messages printed to the different streams.\n\n- `stdout`\n\n    ```txt\n    1. I do nothing\n    2. I print another message to stdout\n    3. I print a message to stdout, again\n    ```\n\n- `stderr`\n\n    ```txt\n    1. I log a message to stderr\n    2. I print a message to stdout\n    3. I print yet another message to stderr without the logger\n    4. I log a message to stderr using the nextmv module directly\n    ```\n\n#### Output\n\nWrite the output data after a run is completed.\n\n- Work with `JSON` outputs.\n\n    ```python\n    import nextmv\n\n    output = nextmv.Output(\n        solution={\"foo\": \"bar\"},\n        statistics=nextmv.Statistics(\n            result=nextmv.ResultStatistics(\n                duration=1.0,\n                value=2.0,\n                custom={\"custom\": \"result_value\"},\n            ),\n            run=nextmv.RunStatistics(\n                duration=3.0,\n                iterations=4,\n                custom={\"custom\": \"run_value\"},\n            ),\n        ),\n    )\n\n    # Write to stdout.\n    nextmv.write_local(output)\n\n    # Write to a file.\n    nextmv.write_local(output, path=\"output.json\")\n    ```\n\n- Work with multple `CSV` files.\n\n    ```python\n    import nextmv\n\n    output = nextmv.Output(\n        output_format=nextmv.OutputFormat.CSV_ARCHIVE,\n        solution={\n            \"output\": [\n                {\"name\": \"Alice\", \"age\": 30},\n                {\"name\": \"Bob\", \"age\": 40},\n            ],\n        },\n        statistics=nextmv.Statistics(\n            result=nextmv.ResultStatistics(\n                duration=1.0,\n                value=2.0,\n                custom={\"custom\": \"result_value\"},\n            ),\n            run=nextmv.RunStatistics(\n                duration=3.0,\n                iterations=4,\n                custom={\"custom\": \"run_value\"},\n            ),\n        ),\n    )\n\n    # Write multiple CSV fiules to a dir named \"output\".\n    nextmv.write_local(output)\n\n    # Write multiple CSV files to a custom dir.\n    nextmv.write_local(output, \"custom_dir\")\n    ```\n\n### Cloud\n\nBefore starting:\n\n1. [Sign up][signup] for a Nextmv account.\n2. Get your API key. Go to [Team > API Key][api-key].\n\nVisit the [docs][docs] for more information. Make sure that you have your API\nkey set as an environment variable:\n\n```bash\nexport NEXTMV_API_KEY=\"<YOUR-API-KEY>\"\n```\n\nAdditionally, you must have a valid app in Nextmv Cloud.\n\n#### Push an application\n\nPlace the following script in the root of your app directory and run it to push\nyour app to the Nextmv Cloud. This is equivalent to using the Nextmv CLI and\nrunning `nextmv app push`.\n\n```python\nimport os\n\nfrom nextmv import cloud\n\nclient = cloud.Client(api_key=os.getenv(\"NEXTMV_API_KEY\"))\napp = cloud.Application(client=client, id=\"<YOUR-APP-ID>\")\napp.push()  # Use verbose=True for step-by-step output.\n```\n\n#### Run an application\n\nMake a run and get the results.\n\n```python\nimport os\n\nfrom nextmv import cloud\n\ninput = {\n    \"defaults\": {\"vehicles\": {\"speed\": 20}},\n    \"stops\": [\n        {\n            \"id\": \"Nij\u014d Castle\",\n            \"location\": {\"lon\": 135.748134, \"lat\": 35.014239},\n            \"quantity\": -1,\n        },\n        {\n            \"id\": \"Kyoto Imperial Palace\",\n            \"location\": {\"lon\": 135.762057, \"lat\": 35.025431},\n            \"quantity\": -1,\n        },\n    ],\n    \"vehicles\": [\n        {\n            \"id\": \"v2\",\n            \"capacity\": 2,\n            \"start_location\": {\"lon\": 135.728898, \"lat\": 35.039705},\n        },\n    ],\n}\n\nclient = cloud.Client(api_key=os.getenv(\"NEXTMV_API_KEY\"))\napp = cloud.Application(client=client, id=\"<YOUR-APP-ID>\")\nresult = app.new_run_with_result(\n    input=input,\n    instance_id=\"latest\",\n    run_options={\"solve.duration\": \"1s\"},\n    polling_options=cloud.PollingOptions(),  # Customize the polling options.\n)\nprint(result.to_dict())\n```\n\n[signup]: https://cloud.nextmv.io\n[docs]: https://nextmv.io/docs\n[api-key]: https://cloud.nextmv.io/team/api-keys\n[cloud]: #cloud\n[working-with-a-decision-model]: #working-with-a-decision-model\n",
    "bugtrack_url": null,
    "license": "Apache License Version 2.0, January 2004 http://www.apache.org/licenses/  TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION  1. Definitions.  \"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.  \"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.  \"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.  \"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.  \"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.  \"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.  \"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).  \"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.  \"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"  \"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.  2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.  3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.  4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:  (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and  (b) You must cause any modified files to carry prominent notices stating that You changed the files; and  (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and  (d) If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.  You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.  5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.  6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.  7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.  8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.  9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.  END OF TERMS AND CONDITIONS  APPENDIX: How to apply the Apache License to your work.  To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \"[]\" replaced with your own identifying information. (Don't include the brackets!)  The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \"printed page\" as the copyright notice for easier identification within third-party archives.  Copyright 2022-2023 nextmv.io inc.  Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.",
    "summary": "The Python SDK for Nextmv",
    "version": "0.13.1",
    "project_urls": {
        "Documentation": "https://www.nextmv.io/docs",
        "Homepage": "https://www.nextmv.io",
        "Repository": "https://github.com/nextmv-io/nextmv-py"
    },
    "split_keywords": [
        "decision engineering",
        " decision science",
        " decisions",
        " nextmv",
        " operations research",
        " optimization",
        " shift scheduling",
        " solver",
        " vehicle routing problem"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9166675ede24e9840397b4dc5ac030b65b8fa1324da6585b16217470ace50ce9",
                "md5": "91189fb7bc701829f43bb8828ba7503c",
                "sha256": "32162f2f1f4492072f96104a928348da0303a98fe41c33d6aab07cdfce511d12"
            },
            "downloads": -1,
            "filename": "nextmv-0.13.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "91189fb7bc701829f43bb8828ba7503c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 40968,
            "upload_time": "2024-10-17T05:34:08",
            "upload_time_iso_8601": "2024-10-17T05:34:08.481587Z",
            "url": "https://files.pythonhosted.org/packages/91/66/675ede24e9840397b4dc5ac030b65b8fa1324da6585b16217470ace50ce9/nextmv-0.13.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b0950abbdd7603e89ecd530e6026b49ad77fe044c856a347142da3a4327c83a3",
                "md5": "c42a601bdf792db6c3305198673d8632",
                "sha256": "4223ee4d36644a51d57af9a21be367d24592b599f8102cd85733ee06dfaa8af3"
            },
            "downloads": -1,
            "filename": "nextmv-0.13.1.tar.gz",
            "has_sig": false,
            "md5_digest": "c42a601bdf792db6c3305198673d8632",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 39897,
            "upload_time": "2024-10-17T05:34:09",
            "upload_time_iso_8601": "2024-10-17T05:34:09.626048Z",
            "url": "https://files.pythonhosted.org/packages/b0/95/0abbdd7603e89ecd530e6026b49ad77fe044c856a347142da3a4327c83a3/nextmv-0.13.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-17 05:34:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "nextmv-io",
    "github_project": "nextmv-py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "nextmv"
}
        
Elapsed time: 0.94007s