lnhub_rest


Namelnhub_rest JSON
Version 0.10.17 PyPI version JSON
download
home_pageNone
SummaryRest API for the hub.
upload_time2023-08-30 12:34:51
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # lnhub-rest: Cross-instance management

Note: For more extensive documentation & testing, see [docs](docs).

## Summary

1. Installation
2. CLI
   1. Run server
   2. Run tests
   3. Launch Jupyter lab
   4. Migrate
3. Deployment
4. Usage
5. Release process

## 1. Installation

1. Clone this repository
2. Navigate to the repository and run:

   ```
   pip install .
   ```

## 2. Dependencies

1. Supabase CLI

   To use lnhub CLI on local environment you will first have to install and configure [Supabase CLI](https://supabase.com/docs/guides/cli).

2. Docker

   You must also have Docker installed to allow
   Supabase CLI to create and run the relevant containers

## 3. Local Development

The [lnhub](lnhub_rest/__main__.py) script serves as the entrypoint for all actions you need to run for local development.

:warning: It is important that you use this entrypoint as it properly configures the settings.

To ensure that the environment is properly configured you can do one of three things:

1. Set `LAMIN_ENV=local` prior to running `lnhub`. This will ensure that a local Supabase instance is started and that the connection strings are properly configured.
2. If you want to connect to an external Supabase (either in the cloud or managed by another process), you can customize `LAMIN_ENV=foobar` (or `prod` or `staging`) and place a corresponding .env file in the root folder. In this case it would be `lnhub-rest--foobar.env`.

   - The .env file must contain values for the following variables:

     ```
     POSTGRES_DSN
     SUPABASE_API_URL
     SUPABASE_ANON_KEY
     SUPABASE_SERVICE_KEY
     ```

### Run the server

```
LAMIN_ENV=local lnhub run
```

### Run tests

```
LAMIN_ENV=local lnhub test -s test_local
```

Any parameters after the `lnhub test` command are passed directly to `nox`

### Launch Jupyter lab

```
LAMIN_ENV=local lnhub jupyter
```

### Open an IPython shell

```
LAMIN_ENV=local lnhub shell
```

### Migrate

See [Migrations](docs/migrations.md)

## 3. Deployment

Push on the `staging` branch to deploy in staging.

Push on the `main` branch to deploy in production.

## 4. Usage

Access API documentation from these endpoints.

Locally:

```
http://localhost:8000/docs
```

On `staging` server :

```
https://lnhub-rest-cloud-run-staging-xv4y7p4gqa-uc.a.run.app/docs
```

On `production` server:

```
https://lnhub-rest-cloud-run-main-xv4y7p4gqa-uc.a.run.app/docs
```

## 5. Release process

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "lnhub_rest",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Lamin Labs <laminlabs@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/b6/cc/ae4ec95e0a959828edfd0a13a0434e4b673a7f87fae3c75359d8e17650e3/lnhub_rest-0.10.17.tar.gz",
    "platform": null,
    "description": "# lnhub-rest: Cross-instance management\n\nNote: For more extensive documentation & testing, see [docs](docs).\n\n## Summary\n\n1. Installation\n2. CLI\n   1. Run server\n   2. Run tests\n   3. Launch Jupyter lab\n   4. Migrate\n3. Deployment\n4. Usage\n5. Release process\n\n## 1. Installation\n\n1. Clone this repository\n2. Navigate to the repository and run:\n\n   ```\n   pip install .\n   ```\n\n## 2. Dependencies\n\n1. Supabase CLI\n\n   To use lnhub CLI on local environment you will first have to install and configure [Supabase CLI](https://supabase.com/docs/guides/cli).\n\n2. Docker\n\n   You must also have Docker installed to allow\n   Supabase CLI to create and run the relevant containers\n\n## 3. Local Development\n\nThe [lnhub](lnhub_rest/__main__.py) script serves as the entrypoint for all actions you need to run for local development.\n\n:warning: It is important that you use this entrypoint as it properly configures the settings.\n\nTo ensure that the environment is properly configured you can do one of three things:\n\n1. Set `LAMIN_ENV=local` prior to running `lnhub`. This will ensure that a local Supabase instance is started and that the connection strings are properly configured.\n2. If you want to connect to an external Supabase (either in the cloud or managed by another process), you can customize `LAMIN_ENV=foobar` (or `prod` or `staging`) and place a corresponding .env file in the root folder. In this case it would be `lnhub-rest--foobar.env`.\n\n   - The .env file must contain values for the following variables:\n\n     ```\n     POSTGRES_DSN\n     SUPABASE_API_URL\n     SUPABASE_ANON_KEY\n     SUPABASE_SERVICE_KEY\n     ```\n\n### Run the server\n\n```\nLAMIN_ENV=local lnhub run\n```\n\n### Run tests\n\n```\nLAMIN_ENV=local lnhub test -s test_local\n```\n\nAny parameters after the `lnhub test` command are passed directly to `nox`\n\n### Launch Jupyter lab\n\n```\nLAMIN_ENV=local lnhub jupyter\n```\n\n### Open an IPython shell\n\n```\nLAMIN_ENV=local lnhub shell\n```\n\n### Migrate\n\nSee [Migrations](docs/migrations.md)\n\n## 3. Deployment\n\nPush on the `staging` branch to deploy in staging.\n\nPush on the `main` branch to deploy in production.\n\n## 4. Usage\n\nAccess API documentation from these endpoints.\n\nLocally:\n\n```\nhttp://localhost:8000/docs\n```\n\nOn `staging` server :\n\n```\nhttps://lnhub-rest-cloud-run-staging-xv4y7p4gqa-uc.a.run.app/docs\n```\n\nOn `production` server:\n\n```\nhttps://lnhub-rest-cloud-run-main-xv4y7p4gqa-uc.a.run.app/docs\n```\n\n## 5. Release process\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Rest API for the hub.",
    "version": "0.10.17",
    "project_urls": {
        "Home": "https://github.com/laminlabs/lnhub-rest"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4e233afee49505ae0de8c35830b5e09f79494618b8a6fdc40aadf45185aa3ba8",
                "md5": "6954ffc8a81602e43c22c16796eb72c9",
                "sha256": "2388f2b59dc00dccc4151892dcce0fce4b6cfe52ff7861b9a634e2c387db3f7c"
            },
            "downloads": -1,
            "filename": "lnhub_rest-0.10.17-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6954ffc8a81602e43c22c16796eb72c9",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 58661,
            "upload_time": "2023-08-30T12:34:48",
            "upload_time_iso_8601": "2023-08-30T12:34:48.469547Z",
            "url": "https://files.pythonhosted.org/packages/4e/23/3afee49505ae0de8c35830b5e09f79494618b8a6fdc40aadf45185aa3ba8/lnhub_rest-0.10.17-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b6ccae4ec95e0a959828edfd0a13a0434e4b673a7f87fae3c75359d8e17650e3",
                "md5": "755d7dd7be8d570cc534d22bef501256",
                "sha256": "bd412da8d20e2fda7b459711de69b66245ea9480b055a6f09e4f6f9eb7f13a71"
            },
            "downloads": -1,
            "filename": "lnhub_rest-0.10.17.tar.gz",
            "has_sig": false,
            "md5_digest": "755d7dd7be8d570cc534d22bef501256",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 122329,
            "upload_time": "2023-08-30T12:34:51",
            "upload_time_iso_8601": "2023-08-30T12:34:51.677454Z",
            "url": "https://files.pythonhosted.org/packages/b6/cc/ae4ec95e0a959828edfd0a13a0434e4b673a7f87fae3c75359d8e17650e3/lnhub_rest-0.10.17.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-30 12:34:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "laminlabs",
    "github_project": "lnhub-rest",
    "github_not_found": true,
    "lcname": "lnhub_rest"
}
        
Elapsed time: 0.10647s