{"id":3118,"library":"mypy-boto3-neptune","title":"mypy-boto3-neptune Type Annotations","description":"mypy-boto3-neptune provides comprehensive type annotations for the AWS Neptune service within the `boto3` library, ensuring type safety and enhanced developer experience in environments like mypy, VSCode, and PyCharm. It is currently at version 1.42.57 and is part of a frequently updated ecosystem, with releases often tied to new `boto3` versions and updates to the `mypy-boto3-builder` tool.","status":"active","version":"1.42.57","language":"python","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["type hinting","boto3","aws","neptune","mypy","stubs"],"install":[{"cmd":"pip install mypy-boto3-neptune","lang":"bash","label":"Install service-specific stubs"},{"cmd":"pip install 'boto3-stubs[neptune]'","lang":"bash","label":"Install via boto3-stubs extras"}],"dependencies":[{"reason":"Provides runtime functionality; mypy-boto3-neptune provides type hints for this library.","package":"boto3","optional":false},{"reason":"The tool used to generate these type annotations; relevant if generating stubs locally or understanding versioning.","package":"mypy-boto3-builder","optional":true}],"imports":[{"wrong":"from mypy_boto3_neptune import NeptuneClient","symbol":"NeptuneClient","correct":"from mypy_boto3_neptune import NeptuneClient"}],"quickstart":{"code":"import boto3\nfrom typing import TYPE_CHECKING\n\nif TYPE_CHECKING:\n    from mypy_boto3_neptune.client import NeptuneClient\n\ndef get_neptune_client() -> NeptuneClient:\n    \"\"\"Gets a typed Neptune client.\"\"\"\n    # boto3 automatically picks up credentials from environment variables or ~/.aws/credentials\n    client: NeptuneClient = boto3.client(\"neptune\")\n    return client\n\nif __name__ == \"__main__\":\n    neptune_client = get_neptune_client()\n    # Example usage (uncomment to run, requires AWS credentials)\n    # try:\n    #     response = neptune_client.describe_db_instances()\n    #     print(\"Neptune DB Instances:\")\n    #     for db_instance in response.get(\"DBInstances\", []):\n    #         print(f\"- {db_instance['DBInstanceIdentifier']}\")\n    # except Exception as e:\n    #     print(f\"Error describing DB instances: {e}\")\n    print(f\"Successfully retrieved Neptune client: {neptune_client.__class__.__name__}\")\n","lang":"python","description":"This quickstart demonstrates how to obtain a type-hinted AWS Neptune client using `boto3` and `mypy-boto3-neptune`. The `TYPE_CHECKING` block ensures that the type import is only used during static analysis, avoiding runtime dependencies. The client will automatically use AWS credentials configured in your environment."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or later. If you need Python 3.8 support, pin `mypy-boto3-builder` to `<8.12.0` and ensure your `mypy-boto3-neptune` version is compatible with an older builder.","message":"Starting with `mypy-boto3-builder` version 8.12.0 (which generates these stubs), Python 3.8 is no longer supported. Projects must use Python 3.9 or newer.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.12.0 (affects all generated stubs)"},{"fix":"Update your type checker (e.g., `mypy`) to a recent version. If encountering issues, verify package installation and type checker configuration.","message":"The `mypy-boto3-builder` (from version 8.12.0) migrated to PEP 561 package format, which may change how some environments or older type checkers discover and interpret the stubs. Ensure your type checker is up-to-date.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.12.0 (affects all generated stubs)"},{"fix":"Always use explicit type annotations, e.g., `client: NeptuneClient = boto3.client(\"neptune\")`, as shown in the quickstart.","message":"For optimal autocomplete and type checking in some IDEs (like older VSCode or PyCharm without the `mypy` plugin configured optimally), explicit type annotations for `boto3.client()` and `boto3.resource()` calls are highly recommended or even necessary.","severity":"gotcha","affected_versions":"All versions"},{"fix":"To fix this, set all type-imported variables to `object` in the `else` block of your `TYPE_CHECKING` guard: `if TYPE_CHECKING: from mypy_boto3_neptune.client import NeptuneClient else: NeptuneClient = object`.","message":"Pylint might report `undefined variable` warnings when using `TYPE_CHECKING` guards. This is a known compatibility issue.","severity":"gotcha","affected_versions":"All versions with Pylint"},{"fix":"Review your code for direct imports of TypeDefs and update their names according to the new conventions as needed.","message":"In `mypy-boto3-builder` 8.9.0, there were breaking changes to the naming conventions of TypeDefs (e.g., shorter names for packed method arguments, `Extra` postfix moved to the end). This could affect users who directly import and use generated TypeDefs.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.9.0 (affects generated TypeDefs)"}],"env_vars":null,"search_vec":"'1.42.57':43 'annot':6,14 'aw':17,72 'boto3':3,9,22,58,66,71 'builder':67 'comprehens':12 'current':40 'develop':29 'ecosystem':51 'enhanc':28 'ensur':24 'environ':32 'experi':30 'frequent':49 'hint':70 'librari':23 'like':33 'mypi':2,8,34,65,74 'mypy-boto3-builder':64 'mypy-boto3-neptune':1,7 'neptun':4,10,18,73 'new':57 'often':54 'part':46 'provid':11 'pycharm':37 'releas':53 'safeti':26 'servic':19 'stub':75 'tie':55 'tool':68 'type':5,13,25,69 'updat':50,61 'version':42,59 'vscode':35 'within':20","created_at":"2026-04-11T09:21:49.471216+00:00","updated_at":"2026-04-16T17:05:48.138963+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n  File \"/tmp/tmp2dj1fete/venv/lib/python3.12/site-packages/mypy_boto3_neptune/__init__.py\", line 60, in <module>\n    from .client import NeptuneClient\n  File \"/tmp/tmp2dj1fete/venv/lib/python3.12/site-packages/mypy_boto3_neptu"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.43.28","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/youtype/mypy_boto3_builder","docs":"https://youtype.github.io/boto3_stubs_docs/mypy_boto3_neptune/","changelog":null,"pypi":"https://pypi.org/project/mypy-boto3-neptune/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["type-stubs","aws","database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-08-28","next_check":"2026-07-10","install_tag":null}}