dnv-net-runtime


Namednv-net-runtime JSON
Version 1.0.0 PyPI version JSON
download
home_pageNone
SummaryThis package contains the .NET Runtime for console-based applications, allowing seamless integration with the .NET Common Language Runtime (CLR) by leveraging the Python.NET package.
upload_time2024-05-27 10:14:04
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMIT License Copyright (c) 2024 DNV 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: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 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.
keywords dotnet dotnetruntime netruntime net.runtime
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # .NET Runtime: Integrating .NET with Python

This package is an indispensable resource for those planning to create console-based applications utilizing .NET assemblies from Python. It offers the .NET Runtime (Version 8.0.4), which works with the .NET Common Language Runtime (CLR) using the Python.NET package. With this integration, developers can concentrate on their development tasks without worrying about compatibility issues, allowing them to create smooth and efficient applications. This package is a valuable tool for creating high-quality console-based applications using .NET assemblies and Python.

## Usage/Examples

```python
# Python script to filter and print even numbers from a .NET List

# Ensure to import 'dnv.net.runtime' before any other import statements
import dnv.net.runtime
import clr

# Add references to required .NET assemblies
clr.AddReference("System")
clr.AddReference("System.Core")
clr.AddReference("System.Collections")

from System import Action, Array, Predicate
from System.Collections.Generic import List
from System.Linq import Enumerable

# Create a .NET Array of integers from 1 to 10
numbers = Array[int]([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])

# Convert the array to a .NET List
listOfNumbers = List[int](numbers)

# Define a Predicate that checks if a number is even
predicate = Predicate[int](lambda x: x % 2 == 0)

# Use the FindAll method of the List to filter out the even numbers based on the Predicate
evenNumbers: List[int] = listOfNumbers.FindAll(predicate)

# Define an Action that prints a number
action = Action[int](lambda x: print(x))

# Use the ForEach method of the List to print each even number
evenNumbers.ForEach(action)
```

```python
# Web Scraping Bing Search Results with Python and .NET HttpClient

# Ensure to import 'dnv.net.runtime' before any other import statements
import dnv.net.runtime
import clr
import re

# Add references to required .NET assemblies
clr.AddReference("System.Net.Http")

from System.Net.Http import HttpClient

# Create an HttpClient instance
client = HttpClient()

# Specify the URL
url = "https://www.bing.com/search?q=DNV"

# Send the GET request
response = client.GetAsync(url).Result

# Ensure the request was successful
response.EnsureSuccessStatusCode()

# Read the response content as a string
responseBody = response.Content.ReadAsStringAsync().Result

# Define a regular expression to extract the titles and URLs of the search results
regex = r'<h2.*?><a href="(.*?)" h=".*?">(.*?)</a></h2>'

# Find all matches of the regular expression in the response body
matches = re.findall(regex, responseBody)

# Print the titles and URLs of the search results
for match in matches:
    url, title = match
    print(f'Title: {title}')
    print(f'URL: {url}')
    print()
```

## License

[MIT](https://choosealicense.com/licenses/mit/)

## Support

If you encounter any issues, have questions, or want to provide feedback, please get in touch with our support team at software.support@dnv.com.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "dnv-net-runtime",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "dotnet, dotnetruntime, netruntime, net.runtime",
    "author": null,
    "author_email": "DNV <onecompute@dnv.com>",
    "download_url": null,
    "platform": null,
    "description": "# .NET Runtime: Integrating .NET with Python\r\n\r\nThis package is an indispensable resource for those planning to create console-based applications utilizing .NET assemblies from Python. It offers the .NET Runtime (Version 8.0.4), which works with the .NET Common Language Runtime (CLR) using the Python.NET package. With this integration, developers can concentrate on their development tasks without worrying about compatibility issues, allowing them to create smooth and efficient applications. This package is a valuable tool for creating high-quality console-based applications using .NET assemblies and Python.\r\n\r\n## Usage/Examples\r\n\r\n```python\r\n# Python script to filter and print even numbers from a .NET List\r\n\r\n# Ensure to import 'dnv.net.runtime' before any other import statements\r\nimport dnv.net.runtime\r\nimport clr\r\n\r\n# Add references to required .NET assemblies\r\nclr.AddReference(\"System\")\r\nclr.AddReference(\"System.Core\")\r\nclr.AddReference(\"System.Collections\")\r\n\r\nfrom System import Action, Array, Predicate\r\nfrom System.Collections.Generic import List\r\nfrom System.Linq import Enumerable\r\n\r\n# Create a .NET Array of integers from 1 to 10\r\nnumbers = Array[int]([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])\r\n\r\n# Convert the array to a .NET List\r\nlistOfNumbers = List[int](numbers)\r\n\r\n# Define a Predicate that checks if a number is even\r\npredicate = Predicate[int](lambda x: x % 2 == 0)\r\n\r\n# Use the FindAll method of the List to filter out the even numbers based on the Predicate\r\nevenNumbers: List[int] = listOfNumbers.FindAll(predicate)\r\n\r\n# Define an Action that prints a number\r\naction = Action[int](lambda x: print(x))\r\n\r\n# Use the ForEach method of the List to print each even number\r\nevenNumbers.ForEach(action)\r\n```\r\n\r\n```python\r\n# Web Scraping Bing Search Results with Python and .NET HttpClient\r\n\r\n# Ensure to import 'dnv.net.runtime' before any other import statements\r\nimport dnv.net.runtime\r\nimport clr\r\nimport re\r\n\r\n# Add references to required .NET assemblies\r\nclr.AddReference(\"System.Net.Http\")\r\n\r\nfrom System.Net.Http import HttpClient\r\n\r\n# Create an HttpClient instance\r\nclient = HttpClient()\r\n\r\n# Specify the URL\r\nurl = \"https://www.bing.com/search?q=DNV\"\r\n\r\n# Send the GET request\r\nresponse = client.GetAsync(url).Result\r\n\r\n# Ensure the request was successful\r\nresponse.EnsureSuccessStatusCode()\r\n\r\n# Read the response content as a string\r\nresponseBody = response.Content.ReadAsStringAsync().Result\r\n\r\n# Define a regular expression to extract the titles and URLs of the search results\r\nregex = r'<h2.*?><a href=\"(.*?)\" h=\".*?\">(.*?)</a></h2>'\r\n\r\n# Find all matches of the regular expression in the response body\r\nmatches = re.findall(regex, responseBody)\r\n\r\n# Print the titles and URLs of the search results\r\nfor match in matches:\r\n    url, title = match\r\n    print(f'Title: {title}')\r\n    print(f'URL: {url}')\r\n    print()\r\n```\r\n\r\n## License\r\n\r\n[MIT](https://choosealicense.com/licenses/mit/)\r\n\r\n## Support\r\n\r\nIf you encounter any issues, have questions, or want to provide feedback, please get in touch with our support team at software.support@dnv.com.\r\n",
    "bugtrack_url": null,
    "license": "MIT License Copyright (c) 2024 DNV 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: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 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. ",
    "summary": "This package contains the .NET Runtime for console-based applications, allowing seamless integration with the .NET Common Language Runtime (CLR) by leveraging the Python.NET package.",
    "version": "1.0.0",
    "project_urls": null,
    "split_keywords": [
        "dotnet",
        " dotnetruntime",
        " netruntime",
        " net.runtime"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "69dfb388999ffa83bc3f795f6c7e31afdd9e450d92f954ecbf38449a883df8f5",
                "md5": "e3c02297e68f16b2c83bafa17becac96",
                "sha256": "86d2c4079143d1aba77d8f57be5f89d3f43daddde3fceace40a48dee227bcbd2"
            },
            "downloads": -1,
            "filename": "dnv_net_runtime-1.0.0-py3-none-manylinux1_x86_64.whl",
            "has_sig": false,
            "md5_digest": "e3c02297e68f16b2c83bafa17becac96",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 31300455,
            "upload_time": "2024-05-27T10:14:04",
            "upload_time_iso_8601": "2024-05-27T10:14:04.347465Z",
            "url": "https://files.pythonhosted.org/packages/69/df/b388999ffa83bc3f795f6c7e31afdd9e450d92f954ecbf38449a883df8f5/dnv_net_runtime-1.0.0-py3-none-manylinux1_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a0248f885fbb271a0a4f2bb670d6f4465ed41e2190ab59ba91964fe5753fc96a",
                "md5": "062822a5fc100a7b8d2111842a9dc18f",
                "sha256": "f3a0b5b601b34902fa4e76b272c41d2df5da910ace266ae098a137fa1fdd5149"
            },
            "downloads": -1,
            "filename": "dnv_net_runtime-1.0.0-py3-none-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "062822a5fc100a7b8d2111842a9dc18f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 33144138,
            "upload_time": "2024-05-27T10:14:15",
            "upload_time_iso_8601": "2024-05-27T10:14:15.936440Z",
            "url": "https://files.pythonhosted.org/packages/a0/24/8f885fbb271a0a4f2bb670d6f4465ed41e2190ab59ba91964fe5753fc96a/dnv_net_runtime-1.0.0-py3-none-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-27 10:14:04",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "dnv-net-runtime"
}
        
Elapsed time: 5.05767s