sindit


Namesindit JSON
Version 0.0.5 PyPI version JSON
download
home_pagehttps://github.com/SINTEF-9012/SINDIT20
SummarySINTEF Digital Twin Framework
upload_time2025-08-20 09:49:31
maintainerNone
docs_urlNone
authorAn Lam
requires_python<3.13,>=3.11
licenseMIT
keywords digital-twin framework sintef
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
    <a href="https://kubikk-ekkolodd.sintef.cloud/dashboard?id=SINDIT">
        <img src="https://kubikk-ekkolodd.sintef.cloud/api/project_badges/measure?project=SINDIT&metric=alert_status&token=sqb_daa44a05f36e549bc45f72c29dcb10b1b04bb781" alt="Quality Gate Status">
    </a>
    <a href="https://kubikk-ekkolodd.sintef.cloud/dashboard?id=SINDIT">
        <img src="https://kubikk-ekkolodd.sintef.cloud/api/project_badges/measure?project=SINDIT&metric=coverage&token=sqb_daa44a05f36e549bc45f72c29dcb10b1b04bb781" alt="Coverage">
    </a>
    <img src="https://img.shields.io/badge/code%20style-black-black" alt="Code Style Black">
    <img src="https://img.shields.io/badge/python-3.11-blue" alt="Python Version">
    <a href="https://pypi.org/project/sindit/">
        <img src="https://img.shields.io/pypi/v/sindit.svg" alt="PyPI version">
    </a>
</div>

<div align="center">
    <img src="https://raw.githubusercontent.com/SINTEF-9012/SINDIT20/refs/heads/main/docs/img/sindit_logo.png" alt="SINDIT Logo" width="350">
</div>

## Run backend using Docker Compose
To start the backend run (add the --build flag to build images before starting containers (build from scratch)):
```bash
docker-compose up
docker-compose up --build
```

This will build the GraphDB docker image and the FastAPI docker image.

The GraphDB instance will be available at: `localhost:7200`

The FastAPI documentation will be exposed at: `http://0.0.0.0:9017`

## Run backend locally
Desription of how to start the backend locally outside docker.
The backend consists of a GraphDB database and a FastAPI server.

### GraphDB
To start GraphDB, run these scripts from the GraphDB folder:
```bash
bash graphdb_install.sh
bash graphdb_preload.sh
bash graphdb_start.sh
```

To test your graphbd connection run from your base folder (/sindit):
```bash
poetry run python run_test.py
```

Go to localhost:7200 to configure graphdb

### API uvicorn server
To start the FastAPI server, run:
```bash
poetry run python run_sindit.py
```


### Run using vscode launcher

```bash
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python Debugger: Current File",
            "type": "debugpy",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "cwd": "/Users/gorans/projects/monorepo/projects/sindit",
            "justMyCode": false,
            "envFile": "/Users/gorans/projects/monorepo/projects/sindit/environment_and_configuration/dev_environment_backend.env",

        }
    ]
}
```
## Using the API

### Authentication
The API requires a valid authentication token for most endpoints. Follow these steps to authenticate and use the API:

1. **Generate a Token**:
   - Use the `/token` endpoint to generate an access token.
   - Example `curl` command:
     ```bash
     curl -X POST "http://127.0.0.1:9017/token" \
     -H "Content-Type: application/x-www-form-urlencoded" \
     -d "username=new_user&password=new_password"
     ```
   - Replace `new_user` and `new_password` with the credentials provided below.

2. **Use the Token**:
   - Include the token in the `Authorization` header for all subsequent API calls:
     ```bash
     curl -X GET "http://127.0.0.1:9017/endpoint" \
     -H "Authorization: Bearer your_generated_token_here"
     ```

3. **Access API Documentation**:
   - The FastAPI documentation is available at: `http://127.0.0.1:9017/docs`

---

### Generate New Username and Password
To add a new user, update the `fake_users_db` in `authentication_endpoints.py` with the following credentials:

```python
fake_users_db = {
    "new_user": {
        "username": "new_user",
        "full_name": "New User",
        "email": "new_user@example.com",
        "hashed_password": "$2b$12$eW5j9GdY3.EciS3oKQxJjOyIpoUNiFZxrON4SXt3wVrgSbE1gDMba",  # Password: new_password
        "disabled": False,
    }
}
```

To generate a new hashed password, use the  Python snippet in `password_hash.py`.
Replace `"new_password"` with your desired password.

---


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/SINTEF-9012/SINDIT20",
    "name": "sindit",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.13,>=3.11",
    "maintainer_email": null,
    "keywords": "digital-twin, framework, sintef",
    "author": "An Lam",
    "author_email": "an.lam@sintef.no",
    "download_url": "https://files.pythonhosted.org/packages/e6/ad/65760f17b26105a9d267af6730c9cf01ef996057d63e7bd5681e6d269ed9/sindit-0.0.5.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n    <a href=\"https://kubikk-ekkolodd.sintef.cloud/dashboard?id=SINDIT\">\n        <img src=\"https://kubikk-ekkolodd.sintef.cloud/api/project_badges/measure?project=SINDIT&metric=alert_status&token=sqb_daa44a05f36e549bc45f72c29dcb10b1b04bb781\" alt=\"Quality Gate Status\">\n    </a>\n    <a href=\"https://kubikk-ekkolodd.sintef.cloud/dashboard?id=SINDIT\">\n        <img src=\"https://kubikk-ekkolodd.sintef.cloud/api/project_badges/measure?project=SINDIT&metric=coverage&token=sqb_daa44a05f36e549bc45f72c29dcb10b1b04bb781\" alt=\"Coverage\">\n    </a>\n    <img src=\"https://img.shields.io/badge/code%20style-black-black\" alt=\"Code Style Black\">\n    <img src=\"https://img.shields.io/badge/python-3.11-blue\" alt=\"Python Version\">\n    <a href=\"https://pypi.org/project/sindit/\">\n        <img src=\"https://img.shields.io/pypi/v/sindit.svg\" alt=\"PyPI version\">\n    </a>\n</div>\n\n<div align=\"center\">\n    <img src=\"https://raw.githubusercontent.com/SINTEF-9012/SINDIT20/refs/heads/main/docs/img/sindit_logo.png\" alt=\"SINDIT Logo\" width=\"350\">\n</div>\n\n## Run backend using Docker Compose\nTo start the backend run (add the --build flag to build images before starting containers (build from scratch)):\n```bash\ndocker-compose up\ndocker-compose up --build\n```\n\nThis will build the GraphDB docker image and the FastAPI docker image.\n\nThe GraphDB instance will be available at: `localhost:7200`\n\nThe FastAPI documentation will be exposed at: `http://0.0.0.0:9017`\n\n## Run backend locally\nDesription of how to start the backend locally outside docker.\nThe backend consists of a GraphDB database and a FastAPI server.\n\n### GraphDB\nTo start GraphDB, run these scripts from the GraphDB folder:\n```bash\nbash graphdb_install.sh\nbash graphdb_preload.sh\nbash graphdb_start.sh\n```\n\nTo test your graphbd connection run from your base folder (/sindit):\n```bash\npoetry run python run_test.py\n```\n\nGo to localhost:7200 to configure graphdb\n\n### API uvicorn server\nTo start the FastAPI server, run:\n```bash\npoetry run python run_sindit.py\n```\n\n\n### Run using vscode launcher\n\n```bash\n{\n    // Use IntelliSense to learn about possible attributes.\n    // Hover to view descriptions of existing attributes.\n    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\n    \"version\": \"0.2.0\",\n    \"configurations\": [\n        {\n            \"name\": \"Python Debugger: Current File\",\n            \"type\": \"debugpy\",\n            \"request\": \"launch\",\n            \"program\": \"${file}\",\n            \"console\": \"integratedTerminal\",\n            \"cwd\": \"/Users/gorans/projects/monorepo/projects/sindit\",\n            \"justMyCode\": false,\n            \"envFile\": \"/Users/gorans/projects/monorepo/projects/sindit/environment_and_configuration/dev_environment_backend.env\",\n\n        }\n    ]\n}\n```\n## Using the API\n\n### Authentication\nThe API requires a valid authentication token for most endpoints. Follow these steps to authenticate and use the API:\n\n1. **Generate a Token**:\n   - Use the `/token` endpoint to generate an access token.\n   - Example `curl` command:\n     ```bash\n     curl -X POST \"http://127.0.0.1:9017/token\" \\\n     -H \"Content-Type: application/x-www-form-urlencoded\" \\\n     -d \"username=new_user&password=new_password\"\n     ```\n   - Replace `new_user` and `new_password` with the credentials provided below.\n\n2. **Use the Token**:\n   - Include the token in the `Authorization` header for all subsequent API calls:\n     ```bash\n     curl -X GET \"http://127.0.0.1:9017/endpoint\" \\\n     -H \"Authorization: Bearer your_generated_token_here\"\n     ```\n\n3. **Access API Documentation**:\n   - The FastAPI documentation is available at: `http://127.0.0.1:9017/docs`\n\n---\n\n### Generate New Username and Password\nTo add a new user, update the `fake_users_db` in `authentication_endpoints.py` with the following credentials:\n\n```python\nfake_users_db = {\n    \"new_user\": {\n        \"username\": \"new_user\",\n        \"full_name\": \"New User\",\n        \"email\": \"new_user@example.com\",\n        \"hashed_password\": \"$2b$12$eW5j9GdY3.EciS3oKQxJjOyIpoUNiFZxrON4SXt3wVrgSbE1gDMba\",  # Password: new_password\n        \"disabled\": False,\n    }\n}\n```\n\nTo generate a new hashed password, use the  Python snippet in `password_hash.py`.\nReplace `\"new_password\"` with your desired password.\n\n---\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "SINTEF Digital Twin Framework",
    "version": "0.0.5",
    "project_urls": {
        "Homepage": "https://github.com/SINTEF-9012/SINDIT20",
        "Repository": "https://github.com/SINTEF-9012/SINDIT20"
    },
    "split_keywords": [
        "digital-twin",
        " framework",
        " sintef"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "62f3ce5953b0a988b10ec0fec8243b87c24bc014e5a04c7685d7dec6765fe28f",
                "md5": "3a13c20c07ee0b1ca574fc1f2a6bc315",
                "sha256": "d57241a36f8e4a54d4a3ecae290a0a0f0a2844a843f48a9d131e0c8e5c4d878d"
            },
            "downloads": -1,
            "filename": "sindit-0.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3a13c20c07ee0b1ca574fc1f2a6bc315",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.13,>=3.11",
            "size": 2204598,
            "upload_time": "2025-08-20T09:49:30",
            "upload_time_iso_8601": "2025-08-20T09:49:30.264515Z",
            "url": "https://files.pythonhosted.org/packages/62/f3/ce5953b0a988b10ec0fec8243b87c24bc014e5a04c7685d7dec6765fe28f/sindit-0.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "e6ad65760f17b26105a9d267af6730c9cf01ef996057d63e7bd5681e6d269ed9",
                "md5": "974bc36b2fd1acd9ac209d46ce2728b6",
                "sha256": "8866c771ec3e396f1000ded0ac409f9fff8a98aeef1dfaf6bc9df497310ca8a8"
            },
            "downloads": -1,
            "filename": "sindit-0.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "974bc36b2fd1acd9ac209d46ce2728b6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.13,>=3.11",
            "size": 2185545,
            "upload_time": "2025-08-20T09:49:31",
            "upload_time_iso_8601": "2025-08-20T09:49:31.927540Z",
            "url": "https://files.pythonhosted.org/packages/e6/ad/65760f17b26105a9d267af6730c9cf01ef996057d63e7bd5681e6d269ed9/sindit-0.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-20 09:49:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "SINTEF-9012",
    "github_project": "SINDIT20",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "sindit"
}
        
Elapsed time: 0.46087s