Skip to main content

python library for the novem data visualisation platform

Project description

novem - data visualisation for coders

A wrapper library for the novem.no data visualisation platform. Create charts, documents, e-mails and dashboards through one simple API.

NB: novem is currently in closed alpha, if you want to try it out please reach out to hello@novem.no

Exampels

Create a linechart from a dataframe using pandas data reader

from pandas_datareader import data
from novem import Plot

line = Plot("aapl_price_hist", type="line", name="Apple price history")

# Only get the adjusted close.
aapl = data.DataReader("AAPL",
                       start="2015-1-1",
                       end="2021-12-31",
                       data_source="yahoo")["Adj Close"]

# send data to the plot
aapl.pipe(line)

# url to view plot
print(line.url)

Getting started

To get started with novem you will have to register an account. Please reach out to us!

Once you have a username and password you can setup your environment using:

  python -m novem --init

In addition to invoking the novem module as shown above, the novem package also includes an extensive command-line interface (cli). Check out CLI.md in this repository or novem.io for more details.

Creating a plot

Novem represents plots as a Plot class that can be imported from the main novem package from novem import Plot.

The Plot class takes a single mandatory positional argument, the name of the plot.

  • If the plot name is new, the instantiation of the class will create the plot.
  • If the plot name already exist, then the new object will operate on the existing plot.

In addition to the name, there are two broad categories of options for a plot: data and config.

  • The data contains the actual information to visualise (usually in the form of numeric csv)
  • Config, which contains information about the visual such as:
    • Type (bar, line, donut, map etc)
    • Titles/captions/names/colors/legends/axis etc

There are two ways to interact with the plots, one can either supply all the necessary options as named arguments when creating the plot, or use the property accessors to modify them one by one (this is more helpful when working with the plot interactively). Below is an example of both approaches.

from novem import Plot

# everything in the constructor
barchart = Plot(<name>, \
  type="bar", \
  title="barchart title", \
  caption = "caption"
)

# property approach
barchart = Plot("plot_name")
barchart.type = "bar"
barchart.title = "barchart title"
barchart.caption = "caption"

In addition to setting individual properties, the Plot object is also callable. This means that the resulting plot can be used as a function, either by being provided data as an argument, or used as part of a pipe chain.

from novem import Plot
import pandas as pd
import numpy as np

# construct some random sample data
df = pd.DataFrame(np.random.randn(100, 4), columns=list("ABCD")).cumsum()

line = Plot("new_line", type="line")

# alternative one, setting data explicitly to a csv string
line.data = df.to_csv()

# or let the plot invoke the to_csv
line.data = df

# alternative two, calling Plot with a csv string
line(df.to_csv())

# alternative three calling the Plot with an object that has a to_csv function
line(df)

# or
df.pipe(line)

NB: All novem plot operations are live. This means that as soon as you write to or modify any aspects of the plot object, those changes are reflected on the novem server and anyone watching the plot in real time.

Contribution and development

The novem python library and platform is under active development, contributions or issues are most welcome.

For guidelines on how to contribute, please check out the CONTRIBUTING.md file in this repository.

LICENSE

This python library is licensed under the MIT license, see the LICENSE file for details.

Project details


Download files

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

Source Distribution

novem-0.5.13.tar.gz (99.2 kB view details)

Uploaded Source

Built Distribution

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

novem-0.5.13-py3-none-any.whl (122.7 kB view details)

Uploaded Python 3

File details

Details for the file novem-0.5.13.tar.gz.

File metadata

  • Download URL: novem-0.5.13.tar.gz
  • Upload date:
  • Size: 99.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for novem-0.5.13.tar.gz
Algorithm Hash digest
SHA256 20d28a1db1405565d7d0bf9c6b254e670fc7322ca067140095ada1ad4c4b6af3
MD5 de2f5cd18edf9d0989f8d7b086ad2b8c
BLAKE2b-256 e26fe6d6e61d942838118bfaa9805f18fdb2a5c1c17c696682111dfb5a4c0805

See more details on using hashes here.

Provenance

The following attestation bundles were made for novem-0.5.13.tar.gz:

Publisher: python-publish.yml on novem-code/novem-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file novem-0.5.13-py3-none-any.whl.

File metadata

  • Download URL: novem-0.5.13-py3-none-any.whl
  • Upload date:
  • Size: 122.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for novem-0.5.13-py3-none-any.whl
Algorithm Hash digest
SHA256 f9c2b3d15d9a3e1c4386933647e9469238667318a1574c768b0c1bf5ab587626
MD5 74a63c6291a2f6f6d4fca6ad1a9ce900
BLAKE2b-256 ceb1d346cf572c54338f48a74f23bc37021605f7e0c7f1173e8a03ec7523f614

See more details on using hashes here.

Provenance

The following attestation bundles were made for novem-0.5.13-py3-none-any.whl:

Publisher: python-publish.yml on novem-code/novem-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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