def get_contract_factory(self, name: ContractName) -> Contract:
        """
        Return the contract factory for a given contract type, generated from the data vailable
        in ``Package.manifest``. Contract factories are accessible from the package class.

        .. code:: python

           Owned = OwnedPackage.get_contract_factory('owned')

        In cases where a contract uses a library, the contract factory will have
        unlinked bytecode. The ``ethpm`` package ships with its own subclass of
        ``web3.contract.Contract``, ``ethpm.contract.LinkableContract`` with a few extra
        methods and properties related to bytecode linking.

        .. code:: python

           >>> math = owned_package.contract_factories.math
           >>> math.needs_bytecode_linking
           True
           >>> linked_math = math.link_bytecode({'MathLib': '0x1234...'})
           >>> linked_math.needs_bytecode_linking
           False
        """
        validate_contract_name(name)

        if "contract_types" not in self.manifest:
            raise InsufficientAssetsError(
                "This package does not contain any contract type data."
            )

        try:
            contract_data = self.manifest["contract_types"][name]
        except KeyError:
            raise InsufficientAssetsError(
                "This package does not contain any package data to generate "
                f"a contract factory for contract type: {name}. Available contract types include: "
                f"{ list(self.manifest['contract_types'].keys()) }."
            )

        validate_minimal_contract_factory_data(contract_data)
        contract_kwargs = generate_contract_factory_kwargs(contract_data)
        contract_factory = self.w3.eth.contract(**contract_kwargs)
        return contract_factory
def get_contract_factory ( self , name : ContractName ) -> Contract : validate_contract_name ( name ) if "contract_types" not in self . manifest : raise InsufficientAssetsError ( "This package does not contain any contract type data." ) try : contract_data = self . manifest [ "contract_types" ] [ name ] except KeyError : raise InsufficientAssetsError ( "This package does not contain any package data to generate " f"a contract factory for contract type: {name}. Available contract types include: " f"{ list(self.manifest['contract_types'].keys()) }." ) validate_minimal_contract_factory_data ( contract_data ) contract_kwargs = generate_contract_factory_kwargs ( contract_data ) contract_factory = self . w3 . eth . contract ( ** contract_kwargs ) return contract_factory
Return the contract factory for a given contract type, generated from the data vailable
        in ``Package.manifest``. Contract factories are accessible from the package class.

        .. code:: python

           Owned = OwnedPackage.get_contract_factory('owned')

        In cases where a contract uses a library, the contract factory will have
        unlinked bytecode. The ``ethpm`` package ships with its own subclass of
        ``web3.contract.Contract``, ``ethpm.contract.LinkableContract`` with a few extra
        methods and properties related to bytecode linking.

        .. code:: python

           >>> math = owned_package.contract_factories.math
           >>> math.needs_bytecode_linking
           True
           >>> linked_math = math.link_bytecode({'MathLib': '0x1234...'})
           >>> linked_math.needs_bytecode_linking
           False