Skip to main content

The official Python client library for Mindleap Starter

Project description

Mindleap Starter Python Client

This is the official Python client library for Mindleap Starter.

Read the full documentation here

Mindleap is a knowledge graph system that allows you to ingest, transform, explore and analyze:

  • any type of structured or unstructured data
  • from laptop to planet scale

Mindleap Starter is a limited version, for smaller scale knowledge graphs.

Mindleap Starter is free for non-commercial use, making it the ideal alternative to introduce yourself to the world of knowledge graphs.

As you progress into commercial use, Mindleap Starter requires a paid license.

You can use this Python library in conjunction with the Mindleap Starter Web Application to interact with the Mindleap Starter system.

Want to integrate Mindleap in your organization?

Start small:

Integrate knowledge graphs in your business applications:

Integrate knowledge graphs in your organization:

  • Acquire the enterprise version of Mindleap
  • Use an orchestration framework, such as Apache NiFi or Camunda, to perform tasks in Mindleap via client libraries (Python/Java) or the Mindleap REST API

Development

  1. Install the mindleap-starter-python-client package:

    pip install mindleap-starter-python-client
    
  2. Set up your local environment:

  • Create a file named .env in the project root.

  • Fill in the Mindleap Starter host url (adjust the port, if necessary)

    MINDLEAP_STARTER_HOST_URL=http://localhost:8090
    

Happy coding!

Example

  1. Create a simple graph model, using a fluent builder pattern:

    from mindleap_starter_python_client.graph_model_service import *
    from mindleap_starter_python_client.services import ResponseStatus
    
    graph_model_service: GraphModelService = GraphModelService()
    
    _SIMPLE_MODEL_ID: UUID = UUID("00000000-0000-0000-0000-000000000001")
    _SIMPLE_MODEL_NAME: str = "Simple Model"
    
    def test_store_simple_graph_model() -> None:
        graph_model: GraphModel = (
            GraphModel()
            .with_id(_SIMPLE_MODEL_ID)
            .with_name(_SIMPLE_MODEL_NAME)
            .add_entity_model(
                EntityModel()
                .with_type_name("person")
                .with_type_label("Person")
                .with_icon_type(IconType.Person)
                .add_property_model(
                    PropertyModel()
                    .with_type_name("name")
                    .with_type_label("Name")
                    .with_value_type(PropertyValueType.String)
                )
                .with_labelling_property_types(["name"])
            )
        )
        response: GraphModelResponse = graph_model_service.store_graph_model(graph_model)
        assert response.status == ResponseStatus.SUCCESS
    
  2. Create an exploration, using the above graph model:

    from mindleap_starter_python_client.exploration_service import *
    from mindleap_starter_python_client.graph_model_service import GraphModelService
    from mindleap_starter_python_client.services import ResponseStatus
    
    graph_model_service: GraphModelService = GraphModelService()
    exploration_service: ExplorationService = ExplorationService()
    
    _EXPLORATION_1_ID: UUID = UUID("00000000-0000-0000-0000-000000000001")
    _EXPLORATION_1_NAME: str = "Exploration 1"
    _SIMPLE_MODEL_ID: UUID = UUID("00000000-0000-0000-0000-000000000001")
    
    def test_store_exploration() -> None:
        graph_model: GraphModel = graph_model_service.get_graph_model_by_id(_SIMPLE_MODEL_ID)
        exploration: Exploration = (
            Exploration()
            .with_id(_EXPLORATION_1_ID)
            .with_name(_EXPLORATION_1_NAME)
            .with_graph_model(graph_model)
            .add_entity(
                Entity()
                .with_entity_type("person")
                .add_property(
                    Property()
                    .with_property_type("name")
                    .with_property_value(StringPropertyValue("James"))
                )
            )
        )
        response: GenericResponse = exploration_service.store_exploration(exploration)
        assert response.status == ResponseStatus.SUCCESS
    

Contribution

If you're interested in contributing code to this project, check out the contribution guidelines.

License

The Mindleap Starter Python Client library is open source under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file mindleap_starter_python_client-1.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for mindleap_starter_python_client-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 385945841072bfa7faa2a5e607d70432b56e3c55c8b7ff36330d6c10f9ebd91c
MD5 fa93794f9463d8a3e20cb85c75a4ab8a
BLAKE2b-256 b2a7b7af150eb50754d832c766b2f13ad883f3a8f91e6c38e092a4ee91e24858

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page