Skip to main content

portal

A clojure tool to navigate through your data.

cljdoc Clojars Project PyPI VS Code Extension Version Get help on Slack

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 docs.

Demo

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

London Clojurians Demo

More video presentations on Portal can be found here.

Usage

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

clj -Sdeps '{:deps {djblue/portal {:mvn/version "0.67.1"}}}'

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

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

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

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

or for a babashka >=0.2.4 repl, do:

bb -Sdeps '{:deps {djblue/portal {:mvn/version "0.67.1"}}}'

or for a lein project.clj, add:

{:profiles {:dev {:dependencies [[djblue/portal "0.67.1"]]}}}

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

{:portal {:dependencies [[djblue/portal "0.67.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, checkout this example project,

or for examples on how to integrate portal into an existing project, look through the examples directory.

[!NOTE] Portal can also be used without a runtime via the standalone version.

API

Try the portal api with the following commands:

;; 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 :intellij :emacs}
:editor Enable editor commands, but use separate UI #{:vs-code :intellij :emacs}
: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.

Download files

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

Source Distribution

djblue_portal-0.67.1.tar.gz (2.0 MB view details)

Uploaded Source

Built Distribution

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

djblue_portal-0.67.1-py3-none-any.whl (2.1 MB view details)

Uploaded Python 3

File details

Details for the file djblue_portal-0.67.1.tar.gz.

File metadata

  • Download URL: djblue_portal-0.67.1.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.14 Linux/6.17.0-1020-azure

File hashes

Hashes for djblue_portal-0.67.1.tar.gz
Algorithm Hash digest
SHA256 3a33310f93e4f6cc36cdf8d8c07f38b776a86e60e2ac2b98d4050d4c44081600
MD5 dbe84405ce106d6b958e242b4bae0e0f
BLAKE2b-256 9c217c6c48e6f9b696ca0a3ea6fa9203b95429cdc3d1db39692100cabf9bfd38

See more details on using hashes here.

File details

Details for the file djblue_portal-0.67.1-py3-none-any.whl.

File metadata

  • Download URL: djblue_portal-0.67.1-py3-none-any.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.14 Linux/6.17.0-1020-azure

File hashes

Hashes for djblue_portal-0.67.1-py3-none-any.whl
Algorithm Hash digest
SHA256 acae0ac37d792204bd9dc6e86ba47021669871e2770394852c9bbb9aa2ad13de
MD5 2eb9f72f61937c8a8b7973f31622dc7a
BLAKE2b-256 c3fa3ff3bc7b454a12111b7ea0ebf2bb393fd374d6f179f20e464371c6d66e34

See more details on using hashes here.

Release history Release notifications | RSS feed

0.67.2

2 files

This release

0.67.1 This release

2 files

0.67.0

2 files

0.66.0

2 files

0.65.0

2 files

0.64.1

2 files

0.64.0

2 files

0.63.1

2 files

0.63.0

2 files

0.62.2

2 files

0.62.1

2 files

0.62.0

2 files

0.61.0

2 files

0.60.2

2 files

0.60.1

2 files

0.60.0

2 files

0.59.2

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page