{ "info": { "author": "Engie", "author_email": "colin.bounouar@engie.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: Microsoft :: Windows :: Windows 7", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# Access REST APIs from Microsoft Excel using User Defined Functions (UDF) #\n\nPyxelRest allow you to query [Swagger 2.0/OpenAPI](https://www.openapis.org) REST APIs using Microsoft Excel User Defined Functions.\n\n1. [Usage](#Usage)\n2. [Installation](#Installation)\n3. [Configuration](#Configuration)\n\n## Usage ##\n\nOnce installed, open Microsoft Excel and UDFs from configured services will be available.\n\n![Selecting UDF](addin/AutoLoadPyxelRestAddIn/resources/screenshot_udfs_category.PNG)\n\n![Filling in UDF parameters](addin/AutoLoadPyxelRestAddIn/resources/screenshot_udf_arguments.PNG)\n\nUDFs are automatically updated on Microsoft Excel start and on Configuration update.\n\nUpdating UDFs without restarting Microsoft Excel or updating configuration can be done thanks to the ``Update Functions`` button within ``PyxelRest`` tab.\n\n![Microsoft Excel add-in](addin/AutoLoadPyxelRestAddIn/resources/screenshot_pyxelrest_auto_load_ribbon.PNG)\n\nPyxelRest itself can automatically stay up to date. \nThe updater make sure that the python module, the Microsoft Excel add-in and the services configuration stays up to date.\n\n![Update steps](addin/AutoLoadPyxelRestAddIn/resources/update_gui.gif)\n\n## Installation ##\n\n### Pre requisites ###\n\n* [Python >= 2.7](https://www.python.org/downloads/) must be installed.\n* [Microsoft Excel >= 2010](https://products.office.com/en-us/excel) must be installed.\n* [Microsoft .NET Framework >= 4.5.2](http://go.microsoft.com/fwlink/?linkid=328856) must be installed.\n\n### User installation (using PIP) ###\n\n1. Within Microsoft Excel, `Trust access to the VBA project object model` should be enabled.\n> File > Options > Trust Center > Trust Center Settings > Macro Settings\n2. Microsoft Excel must be closed while executing the following command:\n\n```bash\npip install pyxelrest\n```\n\n#### User add-in installation ####\n\nOne python module is installed, a script is available to install the Microsoft Excel add-in.\n\nThe add-in is not installed at the same time as the module because:\n * It may prompt the user for installation.\n * pyxelrest can be used as a python module without the need for the add-in.\n\nConsidering %scripts_dir% as the directory containing python scripts (Scripts folder within your virtual environment).\n\nInstall Microsoft Excel add-in by executing the following command:\n\n```bash\npython %scripts_dir%\\pyxelrest_install_addin.py\n```\n\nThe following options are available when launching this script:\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n DescriptionPossible values
--add_in_directoryDirectory containing PyxelRest Microsoft Excel auto load add-in.Default to ..\\pyxelrest_addin relatively to the scripts directory.
--scripts_directoryDirectory containing installed Python scripts.Default to the folder containing this script.
--path_to_up_to_date_configurationPath to up to date configuration file(s). This path will be used in case of auto update to keep services configuration up to date.Can be file, folder paths or an URL to a file.
\n\n### User uninstall (using PIP) ###\n\n1. Go to `Control Panel/Programs and Features` and uninstall AutoLoadPyxelRestAddIn.\n2. Execute the following command:\n\n pip uninstall pyxelrest\n3. Remove `%APPDATA%\\pyxelrest` folder.\n4. Remove `%APPDATA%\\Microsoft\\Excel\\XLSTART\\pyxelrest.xlam` file.\n\n### Developer Installation (using PIP) ###\n\n1. Within Microsoft Excel, `Trust access to the VBA project object model` should be enabled.\n> File > Options > Trust Center > Trust Center Settings > Macro Settings\n2. Build the add-in C# solution:\nIn order to do so, you need to add a test certificate.\n> Project > AutoLoadPyxelRestAddIn > Signing\n3. Microsoft Excel must be closed while executing the following script from within pyxelrest root folder:\n\n developer_install.bat\n\n### Optional Dependencies ###\n\n- Support for ``application/msgpackpandas`` encoded data.\n - Pandas encoded msgpack will be used if ``pandas`` and ``msgpack-python`` modules are available.\n - ``pandas_msgpack`` extra requires can be used to install those dependencies.\n\n- Support for faster JSON handling.\n - JSON responses deserialization (when rely_on_definitions is set to True) will rely on ``ujson`` in case ``ujson`` module is available.\n - ``ujson`` extra requires can be used to install those dependencies.\n\n- Support for NTLM authentication (with user credentials provided),\n - ``requests_ntlm`` module is required in case auth=ntlm is set in ``security_details`` property and custom credentials are provided.\n - ``ntlm`` extra requires can be used to install those dependencies.\n\n- Support for automatic NTLM authentication.\n - ``requests_negotiate_sspi`` module is required in case auth=ntlm is set in ``security_details`` property and logged in user credentials should be used.\n - ``ntlm`` extra requires can be used to install those dependencies.\n\n- Support for in-memory caching.\n - ``cachetool`` module is required to be able to use in-memory caching.\n - ``cachetool`` extra requires can be used to install those dependencies.\n\n## Configuration ##\n\n### Services Configuration ###\n\nServices configuration can be done within Microsoft Excel thanks to the `Configure Services` button within `PyxelRest` tab.\n\n![Microsoft Excel add-in](addin/AutoLoadPyxelRestAddIn/resources/screenshot_pyxelrest_auto_load_ribbon.PNG)\n\n![Configuration screen](addin/AutoLoadPyxelRestAddIn/resources/screenshot_configure_services.PNG)\n\n![Advanced configuration screen](addin/AutoLoadPyxelRestAddIn/resources/screenshot_configure_service.PNG)\n\nConfiguration can also be manually updated thanks to `%APPDATA%\\pyxelrest\\configuration\\services.yml` file.\n\nFile is following [YAML](http://yaml.org/start.html) formatting.\n\nEach section name will be used as the UDFs category.\n\nEach UDF will be prefixed by the section name (only [a-zA-Z0-9_] characters will be kept).\n\nThe following options are available for each section:\n\nValues can be environment variables if provided in the form %MY_ENV_VARIABLE% (for MY_ENV_VARIABLE environment variable).\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n DescriptionMandatoryPossible values
open_apiDictionary describing the OpenAPI definition. Refer to OpenAPI section for more information.Mandatory
descriptionA small description of this service. To be displayed within Microsoft Excel add-in services configuration screen.Optional
proxiesProxies that should be used to reach service. This is a dictionary where keys are the scheme (http or https) and/or no_proxy. If the key is a scheme then the value should be the proxy URL. Otherwise the value should be the URL for which proxies should be ignored. For more details refer to http://docs.python-requests.org/en/master/user/advanced/#proxiesOptional
methodsList of services methods to be exposed as UDFs. Retrieve all standards HTTP methods by default (get, post, put, delete, patch, options, head).Optionalget, post, put, delete, patch, options, head
oauth2Dictionary containing OAuth2 related settings. Refer to OAuth 2 section for more information.Optional
api_keyUser API Key.Optional
basicDictionary containing Basic authentication related settings. Refer to Basic section for more information.Optional
ntlmDictionary containing NTLM related settings. Refer to NTLM section for more information.Optional
udfDictionary containing user defined function related settings. Refer to User Defined Function section for more information.Optional
max_retriesMaximum number of time a request should be retried before considered as failed. 5 by default.OptionalAny positive integer value
headersDictionary containing headers were key is the name of the header that should be sent with every request sent to this service.Optional
connect_timeoutMaximum amount of time, in seconds, to wait when trying to reach the service. Wait for 1 second by default. For more details refer to http://docs.python-requests.org/en/master/user/advanced/#timeoutsOptionalany float value
read_timeoutMaximum amount of time, in seconds, to wait when requesting a service. Infinite wait by default. For more details refer to http://docs.python-requests.org/en/master/user/advanced/#timeoutsOptionalany float value
skip_update_forList of section names that should not be auto-updated.Optional
python_modulesList of extra python module names that should be installed.Optional
cachingDictionary containing caching related settings. Refer to Caching section for more information.Optional
resultDictionary containing result related settings. Refer to Result section for more information.Optional
udf_name_prefixPrefix to be used in front of UDf name.Optional{service_name}_
\n\n#### OpenAPI ####\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n DescriptionMandatoryPossible values
definitionURL to the OpenAPI definition. http, https and file scheme are supported. For more details on what is a URL, please refer to https://en.wikipedia.org/wiki/URL. If you would like to point to a static file such as C:\\swagger.json, the value should be file://C:/swagger.jsonMandatory
definition_read_timeoutMaximum amount of time, in seconds, to wait when requesting an OpenAPI definition. Wait for 5 seconds by default. For more details refer to http://docs.python-requests.org/en/master/user/advanced/#timeoutsOptionalany float value
definition_retrieval_authsList all authentication that should be used when retrieving the OpenAPI definition. Use no authentication by default.Optionaloauth2_implicit, oauth2_access_code, oauth2_password, oauth2_application, api_key, basic, ntlm
excluded_tagsList of tags within OpenAPI definition that should not be retrieved. If not specified, no filtering is applied. For more details refer to https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.mdOptional
selected_tagsList of tags within OpenAPI definition that should be retrieved (if not within excluded tags already). If not specified, no filtering is applied. For more details refer to https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.mdOptional
excluded_operation_idsList of operation_id (or regular expressions) within OpenAPI definition that should not be retrieved. If not specified, no filtering is applied. For more details refer to https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.mdOptional
selected_operation_idsList of operation_id (or regular expressions) within OpenAPI definition that should be retrieved (if not within excluded operation_ids already). If not specified, no filtering is applied. For more details refer to https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.mdOptional
excluded_parametersList of parameter names (or regular expressions) within OpenAPI definition that should not be exposed. If not specified, no filtering is applied. For more details refer to https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.mdOptional
selected_parametersList of parameter names (or regular expressions) within OpenAPI definition that should be exposed (if not within excluded parameters already). If not specified, no filtering is applied. For more details refer to https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.mdOptional
rely_on_definitionsRely on OpenAPI definitions to re-order fields received in JSON response. Deactivated by default.Optionaltrue or false
service_hostService host in case your service is behind a reverse proxy.Optional
\n\n#### User Defined Function ####\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n DescriptionMandatoryPossible values
return_typesList of user defined function return types. vba_compatible if you want your UDF to return the final result immediately. It means that you will have to specify all the cells that will contains the result. Use sync_auto_expand so that UDF call will be a synchronous call auto expanding the result. async_auto_expand (asynchronous call auto expanding the result) by default.Optionalasync_auto_expand, sync_auto_expand or vba_compatible.
shift_resultShift auto expand result by one column to the right. True by default.Optionaltrue or false.
\n\n#### OAuth 2 ####\n\nDepending on the flow, every parameter described in [requests-auth documentation](https://github.com/Colin-b/requests_auth/blob/master/README.md) can be provided.\n\nNote that token_url and authorization_url are extracted from OpenAPI documentation, thus they do not need to be provided.\n\n#### Basic ####\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n DescriptionMandatory
usernameUser name.Mandatory
passwordUser password.Mandatory
\n\n#### NTLM ####\n\nRequiring requests_ntlm or requests_negotiate_sspi python modules.\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n DescriptionMandatory
usernameUser name. Should be of the form domain\\\\user. Default value is the logged in user name.Optional
passwordUser password. Default value is the logged in user password.Optional
\n\n#### Caching ####\n\nRequiring cachetools python module.\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n DescriptionMandatory
result_caching_timeNumber of seconds during which a GET request will return previous result. Always send a new request by default.Optional
max_nb_resultsMaximum number of results to store in cache. 100 by default.Optional
\n\n#### Result ####\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n DescriptionMandatory
flattenFlatten received JSON to a 2D array. Default to True.Optional
raise_exceptionRaise received exceptions to client. False by default.Optional
\n\n\n#### PyxelRest Service Configuration ####\n\nYou can also use the \"pyxelrest\" service name to activate [Postman](https://www.getpostman.com)-like UDFs.\n\n![Configuration screen](addin/AutoLoadPyxelRestAddIn/resources/screenshot_configure_services_pyxelrest.PNG)\n\n![Advanced configuration screen](addin/AutoLoadPyxelRestAddIn/resources/screenshot_configure_service_pyxelrest.PNG)\n\n![Selecting UDF](addin/AutoLoadPyxelRestAddIn/resources/screenshot_udfs_pyxelrest_category.PNG)\n\nIt can be configured the same way than a usual service, except that open_api section is not used anymore.\n\n### Logging Configuration ###\n\nPyxelRest logging configuration can be updated thanks to `%APPDATA%\\pyxelrest\\configuration\\logging.yml` file.\n\nPyxelRest auto-update logging configuration can be updated thanks to `%APPDATA%\\pyxelrest\\configuration\\auto_update_logging.yml` file.\n\nMicrosoft Excel Auto-Load add-in logging configuration can be updated thanks to `%APPDATA%\\pyxelrest\\configuration\\addin.config` file.\n\nDefault log files can be found in your `%APPDATA%\\pyxelrest\\logs` folder.\n\nThis folder can easily be accessed thanks to the `Open Logs` button within `PyxelRest` tab.\n\n![Microsoft Excel add-in](addin/AutoLoadPyxelRestAddIn/resources/screenshot_pyxelrest_auto_load_ribbon.PNG)\n\n### Microsoft Excel Auto-Load add-in Configuration ###\n\nAuto check for update can be activated/deactivated within Microsoft Excel thanks to the `Check for update on close` button within `PyxelRest` tab.\n\n![Microsoft Excel add-in](addin/AutoLoadPyxelRestAddIn/resources/screenshot_pyxelrest_auto_load_ribbon.PNG)\n\nConfiguration can also be manually updated thanks to `%APPDATA%\\pyxelrest\\configuration\\addin.config` file.\n\nThe following application settings are available:\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n DescriptionMandatoryPossible values
PathToPythonPath to the python.exe (including) executable that should be used to launch the update script.MandatoryInstallation script is already setting this value properly.
PathToUpdateScriptPath to the Python script used to update PyxelRest.MandatoryInstallation script is already setting this value properly.
AutoCheckForUpdatesActivate or Deactivate automatic check for PyxelRest update on Microsoft Excel closing.OptionalTrue (default), False
GenerateUDFAtStartupActivate or Deactivate generation of user defined functions at Microsoft Excel startup.OptionalTrue (default), False
PathToXlWingsConfigurationPath to the XlWings configuration file used to configure XlWings for PyxelRest.MandatoryInstallation script is already setting this value properly.
PathToUpToDateConfigurationsPath to the file or directory containing up to date services configuration.OptionalInstallation script is already setting this value properly.
\n\n## Using as a module ##\n\nYou can use pyxelrest as a python module as well.\n\n```python\nimport pyxelrest\n\nconfiguration = {'petstore': {'open_api': {'definition': 'http://petstore.swagger.io/v2/swagger.json'}}}\npyxelrest.load(configuration)\n\nimport pyxelrest.user_defined_functions as udfs\n\n# UDFs are available as python functions within user_defined_functions and can be used as such\n```\n\n### Generating user defined functions ###\n\nWhen `pyxelrest.GENERATE_UDF_ON_IMPORT` is set to `True` (default behavior), \nUDFs are generated based on a configuration file by loading (e.g. on first import) pyxelrest.pyxelrestgenerator.py.\n\nYou can manually regenerate UDFs by calling `pyxelrest.load()` and providing your custom configuration.\n\nAll UDFs can be found within pyxelrest.user_defined_functions.py.\n\n## Frequently Asked Question ##\n\n### Microsoft Excel Wizard does not show any parameter ###\n\n![Microsoft Excel Wizard bug](addin/AutoLoadPyxelRestAddIn/resources/screenshot_udf_wizard_parameters_limit.PNG)\n\nMicrosoft Excel function wizard is not able to handle functions with a long definition.\n\nThe total length of parameter names (and commas to separate them) should not exceed 253 characters,\n\nIn case it does (your UDF has a lot of parameters or parameters with long names), then Microsoft Excel is unable to display them all in the function wizard.\n\nTo overcome this Microsoft Excel limitation you can try the following:\n * Exclude some parameters (refer to Open API configuration section for more information).\n * Remove some parameters in your service.\n * Reduce the length of your service parameter names.\n\n### Microsoft Excel Wizard only list some functions ###\n\nMicrosoft Excel function wizard is not able to list more than a certain amount of functions per category.\n\nHowever all functions can be directly accessed in cells.\n\nTo overcome this Microsoft Excel limitation you can try the following:\n * Exclude some functions in your service (refer to Open API configuration section for more information).\n\n### No command specified in the configuration, cannot autostart server ###\n\nThis error will happen in case you manually specified in your xlwings.bas file to use debug server but did not uncomment the main function starting the server on pyxelrest module side.\n\n### Microsoft Excel Add-In cannot be installed ###\n\nCheck that all requirements are met:\n * [Microsoft .NET Framework >= 4.5.2](http://go.microsoft.com/fwlink/?linkid=328856) must be installed.\n * [Microsoft Visual Studio 2010 Tools for Office Runtime](https://www.microsoft.com/en-us/download/details.aspx?id=48217) must be installed.\n\nIn case you encounter an issue like `Could not load file or assembly 'Microsoft.Office.BusinessApplications.Fba...` anyway, you then need to remove `C:\\Program Files\\Common Files\\Microsoft Shared\\VSTO\\10.0\\VSTOInstaller.exe.config` file.\n\nIn case you encounter an issue like `...An application with the same identity is already installed...`, you then need to manually remove all folders within `%USERPROFILE%\\AppData\\Local\\Apps\\2.0` and restart your computer.\n\n### Dates with a year higher than 3000 are not converted to local timezone ###\n\nDue to timestamp limitation, dates after 3000-12-31 and date time after 3001-01-01T07:59:59+00:00 cannot be converted to local timezone.\n\n### Python process exited before it was possible to create the interface object ###\n\nYou need to check log files to identify the underlying issue.\n\n### pyxelrest.xlam is not available ###\n\nThe add-in might be disabled. Check File/Option/addin/Manage: Disabled Items", "description_content_type": "", "docs_url": null, "download_url": "http://www.engie.com", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://guru.trading.gdfsuez.net/bitbucket/projects/GEMS/repos/pyxelrest", "keywords": "excel,openapi,swagger,rest,udf,service", "license": "", "maintainer": "Engie", "maintainer_email": "colin.bounouar@engie.com", "name": "pyxelrest", "package_url": "https://pypi.org/project/pyxelrest/", "platform": "Windows", "project_url": "https://pypi.org/project/pyxelrest/", "project_urls": { "Download": "http://www.engie.com", "Homepage": "http://guru.trading.gdfsuez.net/bitbucket/projects/GEMS/repos/pyxelrest" }, "release_url": "https://pypi.org/project/pyxelrest/0.69.0/", "requires_dist": null, "requires_python": ">=2.7", "summary": "Access REST APIs from Excel using User Defined Functions (UDF)", "version": "0.69.0" }, "last_serial": 4571451, "releases": { "0.69.0": [ { "comment_text": "", "digests": { "md5": "985ffcb25b6a4766583dc78ef3aa9754", "sha256": "a1276e9eca1c1e23ad169044ed59218f8fd137ab04ab3217411933c27fe97207" }, "downloads": -1, "filename": "pyxelrest-0.69.0.tar.gz", "has_sig": false, "md5_digest": "985ffcb25b6a4766583dc78ef3aa9754", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 776748, "upload_time": "2018-12-07T10:45:24", "url": "https://files.pythonhosted.org/packages/33/8d/05126117472c2eb016752d06e3cbf16f4aa30ed2812ad9045ccf49cff9cf/pyxelrest-0.69.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "985ffcb25b6a4766583dc78ef3aa9754", "sha256": "a1276e9eca1c1e23ad169044ed59218f8fd137ab04ab3217411933c27fe97207" }, "downloads": -1, "filename": "pyxelrest-0.69.0.tar.gz", "has_sig": false, "md5_digest": "985ffcb25b6a4766583dc78ef3aa9754", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 776748, "upload_time": "2018-12-07T10:45:24", "url": "https://files.pythonhosted.org/packages/33/8d/05126117472c2eb016752d06e3cbf16f4aa30ed2812ad9045ccf49cff9cf/pyxelrest-0.69.0.tar.gz" } ] }