Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

conjuror

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

conjuror

A magical CSV data parsing and outputing wizard or witch

  • 0.2.10
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9
increased by800%
Maintainers
1
Weekly downloads
 
Created
Source

The Magical Conjuror

NPM

Conjuror

Conjuror is magical wizard who knows how to do cool things with CSV data and dons an epic beard- kind of like Santa Claus, sans the whole naughty or nice bit. Conjuror is based on Data Packages, which are a nifty way to wrap simple CSV data in JSON, and was created by the OKFN.

Getting Started
  1. First install Conjuror npm install -g conjuror
  2. Then set it up by running setup script conjuror setup
  3. To use Conjuror to you will need to make copies of the following two data files:
  • data/_template.csv
  • data/_template.json

Rename these files something like clients.csv or receipts.csv or whatever suits your needs add modify the values of the JSON schema & CSV columns as you see it. Once the schema & CSV matches, you can start adding data items to the CSV such as:

date, time, description, client, location, rate
2015-02-07, 2, improved importing of files, conjuror, cafe, 0.00
2015-02-08, 2, updated commands & documentation, mailpile, home, 0.00

You can manually add items to the CSV, or you can use the rough implemenation of the time tracker tool by running a separate script called ctrack read more about this below.

Conjuror Commands

  • conjuror - shows a help screen with following commands
  • conjuror setup - setups up Conjuror on a new machine
  • conjuror view - renders filtered data to CLI for quick checks
  • conjuror track - add a new entry to an existing project
  • conjuror output - output a filtered report as PDF, HTML, and CSV
Flags (BROKEN AT THE MOMENT)

Normally the conjuror command should accept flags to be run as a normal shell command, but I broke that recently!

FlagShort FlagBehavior
--help-hshows list of commands
--input-iselects data.json schema file to open up
--formats-fallows you to choose different output formats (cli, csv, html, pdf)
--output-ospecify Name of File to be output
--date-dfilters by numerous date styles 'February, Feb, 02 read below
--search-ssearches for a string like magic contained within a longer string I love doing magic tricks
--trim-tfilters by an item like 'client' (currently hardcoded value)
--price-pOverride the calculated price with a fixed price
--currency-cwhat currency the thing is in
--extra-eText that appears in extra field of template (overrides field in config).
--details-lAffects visibility of the data_details field in a template (show, hide)
--message-mShows up as a data_message in a template
--generated-gAllows specifying custom invoice date

Run either of the follow two examples from terminal command line

Example (trim)

node conjuror.js --input data/clients.json --trim client-name

This command should have printed data to your command line that matches your trim parameter.

Example (output & date)

node conjuror.js -i data/clients.json -o "Feb Invoice" -t client-name --date=Feb

The following examples are formats of dates values you can pass using the --date flag

  • Month - February or Feb or 02 which picks month of current year
  • Exact - 2015-09-04 gets all values since date
  • Range - 2015-09-04:to:2015-11-15 selects between two exact values

The above example should have outputted an HTML rendering of your the entries parsed from your data. The output will be located in output/Feb Invoice.html

Note: regarding PDF export

To generate PDF outputs, you need to install wkhtmltopdf for your operating system on Debian that is done with sudo apt-get install wkhtmltopdf

Why The Magical Name & Terminology?

Well, there is that quote by Asimov about technology... there is also the Cyber Wizard Institute which you should check out... and I really wanted to use this icon of a magical bearded wizard.

Made in Berlin

Keywords

FAQs

Package last updated on 15 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc