djblue.portal


Namedjblue.portal JSON
Version 0.60.1 PyPI version JSON
download
home_pagehttps://github.com/djblue/portal
SummaryA clojure tool to navigate through your data.
upload_time2025-08-03 23:04:39
maintainerNone
docs_urlNone
authordjblue
requires_python>=3.8
licenseMIT License Copyright (c) 2020 Chris Badahdah Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords clojure basilisp inspector portal datafy nav
VCS
bugtrack_url
requirements aiohappyeyeballs aiohttp aiosignal asyncio attrs basilisp frozenlist idna immutables multidict prompt_toolkit propcache poetry poetry-core pyrsistent typing_extensions wcwidth yarl
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # portal

A clojure tool to navigate through your data.

[![cljdoc][cljdoc-badge]][cljdoc]
[![Clojars Project][clojars-badge]][clojars]
[![PyPI][pypi-badge]][pypi]
[![VS Code Extension][vscode-badge]][vscode]
[![Version][intellij-badge]][intellij]
[![Get help on Slack][clojurians-badge]][clojurians]



<a target="_blank" href="https://djblue.github.io/portal/?content-type=application/edn&content-url=https://raw.githubusercontent.com/djblue/portal/gh-pages/docs.edn">
<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/1986211/196015562-238cf450-6467-451c-a985-04c7a9b49dba.png">
  <source media="(prefers-color-scheme: light)" srcset="https://user-images.githubusercontent.com/1986211/196015567-74ba9153-341a-4fd7-be47-2c26f0c88c2e.png">
  <img src="https://user-images.githubusercontent.com/1986211/196015562-238cf450-6467-451c-a985-04c7a9b49dba.png">
</picture>
</a>

The portal UI can be used to inspect values of various shapes and sizes. The UX
will probably evolve over time and user feedback is welcome!

For an in-depth explanation of the UI, you can jump to the [UI][ui-concepts]
docs.

## Demo

To get an overview of the Portal UI and workflow, checkout the following
recording of a [live demo][live-demo] I gave for [London
Clojurians][london-clojurians].

<a target="_blank" href="https://www.youtube.com/watch?v=Tj-iyDo3bq0">
<img src="https://img.youtube.com/vi/Tj-iyDo3bq0/hqdefault.jpg" alt="London Clojurians Demo" />
</a>

More video presentations on Portal can be found [here](./doc/videos.md).

## Usage

To start a repl with portal, run the **clojure >= 1.10.0** cli with:

```bash
clj -Sdeps '{:deps {djblue/portal {:mvn/version "0.60.1"}}}'
```

or for a **web** **clojurescript >= 1.10.773** repl, do:

```bash
clj -Sdeps '{:deps {djblue/portal {:mvn/version "0.60.1"}
                    org.clojure/clojurescript {:mvn/version "1.10.844"}}}' \
    -m cljs.main
```

or for a **node** **clojurescript >= 1.10.773** repl, do:

```bash
clj -Sdeps '{:deps {djblue/portal {:mvn/version "0.60.1"}
                    org.clojure/clojurescript {:mvn/version "1.10.844"}}}' \
    -m cljs.main -re node
```

or for a **babashka >=0.2.4** repl, do:

```bash
bb -Sdeps '{:deps {djblue/portal {:mvn/version "0.60.1"}}}'
```

or for a lein `project.clj`, add:

```clojure
{:profiles {:dev {:dependencies [[djblue/portal "0.60.1"]]}}}
```

or as a global profile, add to `~/.lein/profiles.clj`:

```clojure
{:portal {:dependencies [[djblue/portal "0.60.1"]]}}
```

> [!NOTE]
> If you add Portal to a profile other than `:dev`, when starting a REPL
> start it with `with-profiles +portal`. The `+` is important.

or for [**Clojure CLR**][clojure-clr], checkout this [example project](./examples/clr),

or for examples on how to integrate portal into an existing project, look
through the [examples](./examples) directory.

> [!NOTE]
> Portal can also be used without a runtime via the [standalone version](./doc/guides/standalone.md).

### API

Try the [portal api](./src/portal/api.cljc) with the following commands:

```clojure
;; for node and jvm
(require '[portal.api :as p])

;; for web
;; NOTE: you might need to enable popups for the portal ui to work in the
;; browser.
(require '[portal.web :as p])


(def p (p/open)) ; Open a new inspector

;; or with an extension installed, do:
(def p (p/open {:launcher :vs-code}))  ; jvm / node only
(def p (p/open {:launcher :intellij})) ; jvm / node only

(add-tap #'p/submit) ; Add portal as a tap> target

(tap> :hello) ; Start tapping out values

(p/clear) ; Clear all values

(tap> :world) ; Tap out more values

(prn @p) ; bring selected value back into repl

(remove-tap #'p/submit) ; Remove portal from tap> targetset

(p/close) ; Close the inspector when done

(p/docs) ; View docs locally via Portal - jvm / node only
```

> [!WARNING] 
> Portal will keep objects from being garbage collected until they are cleared
> from the UI.

### Options

Options for `portal.api/open`:

| Option          | Description                                 | Default             | Spec                                                                        |
|-----------------|---------------------------------------------|---------------------|-----------------------------------------------------------------------------|
| `:window-title` | Custom window title for UI                  | "portal"            | string?                                                                     |
| `:theme`        | Default theme for UI                        | :portal.colors/nord |                                                                             |
| `:value`        | Root value of UI                            | (atom (list))       |                                                                             |
| `:app`          | Launch UI in Chrome app window              | true                | boolean?                                                                    |
| `:launcher`     | Launch UI using this editor                 |                     | #{[:vs-code][vs-code-docs] [:intellij][intellij-docs] [:emacs][emacs-docs]} |
| `:editor`       | Enable editor commands, but use separate UI |                     | #{[:vs-code][vs-code-docs] [:intellij][intellij-docs] [:emacs][emacs-docs]} |
| `:port`         | Http server port for UI                     | 0                   | int?                                                                        |
| `:host`         | Http server host for UI                     | "localhost"         | string?                                                                     |


For more documentation, take a look through the [docs][docs].

[cljdoc]: https://cljdoc.org/d/djblue/portal/CURRENT
[cljdoc-badge]: https://cljdoc.org/badge/djblue/portal
[clojars]: https://clojars.org/djblue/portal
[clojars-badge]: https://img.shields.io/clojars/v/djblue/portal?color=380036
[vscode]: https://marketplace.visualstudio.com/items?itemName=djblue.portal
[vscode-badge]: https://img.shields.io/visual-studio-marketplace/v/djblue.portal?label=vs-code&color=007ACC&logo=vs
[intellij]: https://plugins.jetbrains.com/plugin/18467-portal
[intellij-badge]: https://img.shields.io/jetbrains/plugin/v/18467?label=intellij

[clojurians]: https://clojurians.slack.com/channels/portal
[clojurians-badge]: https://img.shields.io/badge/slack-clojurians%20%23portal-4A154B?color=63B132

[live-demo]: https://www.youtube.com/watch?v=Tj-iyDo3bq0
[london-clojurians]: https://www.youtube.com/channel/UC-pYfofTyvVDMwM4ttfFGqw
[docs]: https://cljdoc.org/d/djblue/portal/0.60.1/doc/ui-concepts
[ui-concepts]: https://cljdoc.org/d/djblue/portal/0.60.1/doc/ui-concepts

[vs-code-docs]: ./doc/editors/vs-code.md
[intellij-docs]: ./doc/editors/intellij.md
[emacs-docs]: ./doc/editors/emacs.md#xwidget-webkit-embed

[clojure-clr]: https://github.com/clojure/clojure-clr

[pypi-badge]: https://img.shields.io/pypi/v/djblue.portal?color=ffd343
[pypi]: https://pypi.org/project/djblue.portal/
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/djblue/portal",
    "name": "djblue.portal",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "clojure, basilisp, inspector, portal, datafy, nav",
    "author": "djblue",
    "author_email": "djblue@users.noreply.github.com",
    "download_url": "https://files.pythonhosted.org/packages/19/00/dfed300453c1bba177c1e565fded308d129bda5795ddb2063d868cd4d206/djblue_portal-0.60.1.tar.gz",
    "platform": null,
    "description": "# portal\n\nA clojure tool to navigate through your data.\n\n[![cljdoc][cljdoc-badge]][cljdoc]\n[![Clojars Project][clojars-badge]][clojars]\n[![PyPI][pypi-badge]][pypi]\n[![VS Code Extension][vscode-badge]][vscode]\n[![Version][intellij-badge]][intellij]\n[![Get help on Slack][clojurians-badge]][clojurians]\n\n\n\n<a target=\"_blank\" href=\"https://djblue.github.io/portal/?content-type=application/edn&content-url=https://raw.githubusercontent.com/djblue/portal/gh-pages/docs.edn\">\n<picture>\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://user-images.githubusercontent.com/1986211/196015562-238cf450-6467-451c-a985-04c7a9b49dba.png\">\n  <source media=\"(prefers-color-scheme: light)\" srcset=\"https://user-images.githubusercontent.com/1986211/196015567-74ba9153-341a-4fd7-be47-2c26f0c88c2e.png\">\n  <img src=\"https://user-images.githubusercontent.com/1986211/196015562-238cf450-6467-451c-a985-04c7a9b49dba.png\">\n</picture>\n</a>\n\nThe portal UI can be used to inspect values of various shapes and sizes. The UX\nwill probably evolve over time and user feedback is welcome!\n\nFor an in-depth explanation of the UI, you can jump to the [UI][ui-concepts]\ndocs.\n\n## Demo\n\nTo get an overview of the Portal UI and workflow, checkout the following\nrecording of a [live demo][live-demo] I gave for [London\nClojurians][london-clojurians].\n\n<a target=\"_blank\" href=\"https://www.youtube.com/watch?v=Tj-iyDo3bq0\">\n<img src=\"https://img.youtube.com/vi/Tj-iyDo3bq0/hqdefault.jpg\" alt=\"London Clojurians Demo\" />\n</a>\n\nMore video presentations on Portal can be found [here](./doc/videos.md).\n\n## Usage\n\nTo start a repl with portal, run the **clojure >= 1.10.0** cli with:\n\n```bash\nclj -Sdeps '{:deps {djblue/portal {:mvn/version \"0.60.1\"}}}'\n```\n\nor for a **web** **clojurescript >= 1.10.773** repl, do:\n\n```bash\nclj -Sdeps '{:deps {djblue/portal {:mvn/version \"0.60.1\"}\n                    org.clojure/clojurescript {:mvn/version \"1.10.844\"}}}' \\\n    -m cljs.main\n```\n\nor for a **node** **clojurescript >= 1.10.773** repl, do:\n\n```bash\nclj -Sdeps '{:deps {djblue/portal {:mvn/version \"0.60.1\"}\n                    org.clojure/clojurescript {:mvn/version \"1.10.844\"}}}' \\\n    -m cljs.main -re node\n```\n\nor for a **babashka >=0.2.4** repl, do:\n\n```bash\nbb -Sdeps '{:deps {djblue/portal {:mvn/version \"0.60.1\"}}}'\n```\n\nor for a lein `project.clj`, add:\n\n```clojure\n{:profiles {:dev {:dependencies [[djblue/portal \"0.60.1\"]]}}}\n```\n\nor as a global profile, add to `~/.lein/profiles.clj`:\n\n```clojure\n{:portal {:dependencies [[djblue/portal \"0.60.1\"]]}}\n```\n\n> [!NOTE]\n> If you add Portal to a profile other than `:dev`, when starting a REPL\n> start it with `with-profiles +portal`. The `+` is important.\n\nor for [**Clojure CLR**][clojure-clr], checkout this [example project](./examples/clr),\n\nor for examples on how to integrate portal into an existing project, look\nthrough the [examples](./examples) directory.\n\n> [!NOTE]\n> Portal can also be used without a runtime via the [standalone version](./doc/guides/standalone.md).\n\n### API\n\nTry the [portal api](./src/portal/api.cljc) with the following commands:\n\n```clojure\n;; for node and jvm\n(require '[portal.api :as p])\n\n;; for web\n;; NOTE: you might need to enable popups for the portal ui to work in the\n;; browser.\n(require '[portal.web :as p])\n\n\n(def p (p/open)) ; Open a new inspector\n\n;; or with an extension installed, do:\n(def p (p/open {:launcher :vs-code}))  ; jvm / node only\n(def p (p/open {:launcher :intellij})) ; jvm / node only\n\n(add-tap #'p/submit) ; Add portal as a tap> target\n\n(tap> :hello) ; Start tapping out values\n\n(p/clear) ; Clear all values\n\n(tap> :world) ; Tap out more values\n\n(prn @p) ; bring selected value back into repl\n\n(remove-tap #'p/submit) ; Remove portal from tap> targetset\n\n(p/close) ; Close the inspector when done\n\n(p/docs) ; View docs locally via Portal - jvm / node only\n```\n\n> [!WARNING] \n> Portal will keep objects from being garbage collected until they are cleared\n> from the UI.\n\n### Options\n\nOptions for `portal.api/open`:\n\n| Option          | Description                                 | Default             | Spec                                                                        |\n|-----------------|---------------------------------------------|---------------------|-----------------------------------------------------------------------------|\n| `:window-title` | Custom window title for UI                  | \"portal\"            | string?                                                                     |\n| `:theme`        | Default theme for UI                        | :portal.colors/nord |                                                                             |\n| `:value`        | Root value of UI                            | (atom (list))       |                                                                             |\n| `:app`          | Launch UI in Chrome app window              | true                | boolean?                                                                    |\n| `:launcher`     | Launch UI using this editor                 |                     | #{[:vs-code][vs-code-docs] [:intellij][intellij-docs] [:emacs][emacs-docs]} |\n| `:editor`       | Enable editor commands, but use separate UI |                     | #{[:vs-code][vs-code-docs] [:intellij][intellij-docs] [:emacs][emacs-docs]} |\n| `:port`         | Http server port for UI                     | 0                   | int?                                                                        |\n| `:host`         | Http server host for UI                     | \"localhost\"         | string?                                                                     |\n\n\nFor more documentation, take a look through the [docs][docs].\n\n[cljdoc]: https://cljdoc.org/d/djblue/portal/CURRENT\n[cljdoc-badge]: https://cljdoc.org/badge/djblue/portal\n[clojars]: https://clojars.org/djblue/portal\n[clojars-badge]: https://img.shields.io/clojars/v/djblue/portal?color=380036\n[vscode]: https://marketplace.visualstudio.com/items?itemName=djblue.portal\n[vscode-badge]: https://img.shields.io/visual-studio-marketplace/v/djblue.portal?label=vs-code&color=007ACC&logo=vs\n[intellij]: https://plugins.jetbrains.com/plugin/18467-portal\n[intellij-badge]: https://img.shields.io/jetbrains/plugin/v/18467?label=intellij\n\n[clojurians]: https://clojurians.slack.com/channels/portal\n[clojurians-badge]: https://img.shields.io/badge/slack-clojurians%20%23portal-4A154B?color=63B132\n\n[live-demo]: https://www.youtube.com/watch?v=Tj-iyDo3bq0\n[london-clojurians]: https://www.youtube.com/channel/UC-pYfofTyvVDMwM4ttfFGqw\n[docs]: https://cljdoc.org/d/djblue/portal/0.60.1/doc/ui-concepts\n[ui-concepts]: https://cljdoc.org/d/djblue/portal/0.60.1/doc/ui-concepts\n\n[vs-code-docs]: ./doc/editors/vs-code.md\n[intellij-docs]: ./doc/editors/intellij.md\n[emacs-docs]: ./doc/editors/emacs.md#xwidget-webkit-embed\n\n[clojure-clr]: https://github.com/clojure/clojure-clr\n\n[pypi-badge]: https://img.shields.io/pypi/v/djblue.portal?color=ffd343\n[pypi]: https://pypi.org/project/djblue.portal/",
    "bugtrack_url": null,
    "license": "MIT License\n\nCopyright (c) 2020 Chris Badahdah\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n",
    "summary": "A clojure tool to navigate through your data.",
    "version": "0.60.1",
    "project_urls": {
        "Changelog": "https://github.com/djblue/portal/blob/master/CHANGELOG.md",
        "Documentation": "https://cljdoc.org/d/djblue/portal/",
        "Homepage": "https://github.com/djblue/portal",
        "Issues": "https://github.com/djblue/portal/issues",
        "Standalone": "https://djblue.github.io/portal/"
    },
    "split_keywords": [
        "clojure",
        " basilisp",
        " inspector",
        " portal",
        " datafy",
        " nav"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c2ec0a98b34b3a646158b51a78411ff1679e79ebd845c75775a8202305a3fdbd",
                "md5": "1029e0078973003e217ca0a56a99a88d",
                "sha256": "f8996e8c5f1bc03d2ab6abfde6312db280877d2031b30b208966d4d551014deb"
            },
            "downloads": -1,
            "filename": "djblue_portal-0.60.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1029e0078973003e217ca0a56a99a88d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 1968471,
            "upload_time": "2025-08-03T23:04:37",
            "upload_time_iso_8601": "2025-08-03T23:04:37.942595Z",
            "url": "https://files.pythonhosted.org/packages/c2/ec/0a98b34b3a646158b51a78411ff1679e79ebd845c75775a8202305a3fdbd/djblue_portal-0.60.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1900dfed300453c1bba177c1e565fded308d129bda5795ddb2063d868cd4d206",
                "md5": "1a6cf7fd38f3ff0cdb41f0d1a44a5291",
                "sha256": "b5cd050f0279fc7205c66822f0ae56d6011b10f1416683eac8e21c634f35fbde"
            },
            "downloads": -1,
            "filename": "djblue_portal-0.60.1.tar.gz",
            "has_sig": false,
            "md5_digest": "1a6cf7fd38f3ff0cdb41f0d1a44a5291",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 1911402,
            "upload_time": "2025-08-03T23:04:39",
            "upload_time_iso_8601": "2025-08-03T23:04:39.611069Z",
            "url": "https://files.pythonhosted.org/packages/19/00/dfed300453c1bba177c1e565fded308d129bda5795ddb2063d868cd4d206/djblue_portal-0.60.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-03 23:04:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "djblue",
    "github_project": "portal",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "aiohappyeyeballs",
            "specs": [
                [
                    "==",
                    "2.4.4"
                ]
            ]
        },
        {
            "name": "aiohttp",
            "specs": [
                [
                    "==",
                    "3.11.11"
                ]
            ]
        },
        {
            "name": "aiosignal",
            "specs": [
                [
                    "==",
                    "1.3.2"
                ]
            ]
        },
        {
            "name": "asyncio",
            "specs": [
                [
                    "==",
                    "3.4.3"
                ]
            ]
        },
        {
            "name": "attrs",
            "specs": [
                [
                    "==",
                    "24.3.0"
                ]
            ]
        },
        {
            "name": "basilisp",
            "specs": [
                [
                    "==",
                    "0.4.0"
                ]
            ]
        },
        {
            "name": "frozenlist",
            "specs": [
                [
                    "==",
                    "1.5.0"
                ]
            ]
        },
        {
            "name": "idna",
            "specs": [
                [
                    "==",
                    "3.10"
                ]
            ]
        },
        {
            "name": "immutables",
            "specs": [
                [
                    "==",
                    "0.21"
                ]
            ]
        },
        {
            "name": "multidict",
            "specs": [
                [
                    "==",
                    "6.1.0"
                ]
            ]
        },
        {
            "name": "prompt_toolkit",
            "specs": [
                [
                    "==",
                    "3.0.48"
                ]
            ]
        },
        {
            "name": "propcache",
            "specs": [
                [
                    "==",
                    "0.2.1"
                ]
            ]
        },
        {
            "name": "poetry",
            "specs": [
                [
                    "==",
                    "2.1.3"
                ]
            ]
        },
        {
            "name": "poetry-core",
            "specs": [
                [
                    "==",
                    "2.1.3"
                ]
            ]
        },
        {
            "name": "pyrsistent",
            "specs": [
                [
                    "==",
                    "0.20.0"
                ]
            ]
        },
        {
            "name": "typing_extensions",
            "specs": [
                [
                    "==",
                    "4.12.2"
                ]
            ]
        },
        {
            "name": "wcwidth",
            "specs": [
                [
                    "==",
                    "0.2.13"
                ]
            ]
        },
        {
            "name": "yarl",
            "specs": [
                [
                    "==",
                    "1.18.3"
                ]
            ]
        }
    ],
    "lcname": "djblue.portal"
}
        
Elapsed time: 0.87430s