Package: novem
novem - data visualisation for codersA 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 tohello@novem.noExampelsCreate a linechart from a dataframe using pandas data readerfrompandas_datareaderimportdatafromnovemimportPlotline=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 plotaapl.pipe(line)# url to view plotprint(line.url)Getting startedTo get started with novem you'll have to register an account, currently this
can be done by reaching out to the novem developers onhello@novem.no.Once you have a username and password you can setup your environment using:python-mnovem--initIn additon 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
repostiory ornovem.nofor more details.Creating a plotNovem represents plots as a Plot class that can be imported from the main novem
packagefrom 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:Thedatacontains 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 etcThere are two ways to interact with the plots, one can either supply all
the neccessary options as named arguments when creating the plot, or use the
property accessors to modfity them one by one (this is more helpful when working
with the plot in an interactive way). Below is an example of the two
approaches.fromnovemimportPlot# everything in the constructorbarchart=Plot(<name>,\type="bar",\title="barchart title",\caption="caption")# property approachbarchart=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.fromnovemimportPlotimportpandasaspdimportnumpyasnp# construct some random sample datadf=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 stringline.data=df.to_csv()# or let the plot invoke the to_csvline.data=df# alternative two, calling Plot with a csv stringline(df.to_csv())# alternative three calling the Plot with an object that has a to_csv functionline(df)# ordf.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 developmentThe 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.LICENSEThis python library is licensed under the MIT license, see the LICENSE file for
details