npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

conjuror

v0.2.10

Published

A magical CSV data parsing and outputing wizard or witch

Downloads

27

Readme

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!

Flag | Short Flag | Behavior ------------ | ------------- | ------------- --help | -h | shows list of commands --input | -i | selects data.json schema file to open up --formats | -f | allows you to choose different output formats (cli, csv, html, pdf) --output | -o | specify Name of File to be output --date | -d | filters by numerous date styles 'February, Feb, 02 read below --search | -s | searches for a string like magic contained within a longer string I love doing magic tricks --trim | -t | filters by an item like 'client' (currently hardcoded value) --price | -p | Override the calculated price with a fixed price --currency | -c | what currency the thing is in --extra | -e | Text that appears in extra field of template (overrides field in config). --details | -l | Affects visibility of the data_details field in a template (show, hide) --message | -m | Shows up as a data_message in a template --generated | -g | Allows 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