Skip to content
/ system Public

Tools to help automate my software consulting business

Notifications You must be signed in to change notification settings

jmpinit/system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

System

Tools to help automate my software consulting business.

Command-line Tools

notion-db-to-sqlite

Uses the Notion API to retrieve a Database and then it converts it to a SQLite3 database in an opinionated way (i.e. lazy and specific to my needs).

Credentials may be specified in YAML config file like so:

notion:
  secret: yourapisecret

Create an internal Notion integration to get the secret.

You will also need a configuration file for your client that contains the database ID to read from:

client:
  database: thedatabaseid

You can find the database ID by looking at the URL generated by the "Share" button in Notion. Make sure you share the database with your integration as well.

Example Usage

notion-db-to-sqlite --config your_confg.yml --output foo.sqlite

Installing

npm install -g .

DB Format

A primary table called main is created for your database. Each column that is not a multiselect will correspond to a column in main. For each multiselect column an additional table will be created which has the same name as the column and contains rows corresponding to the entries in the multiselect for each row. Each multiselect row has a single TEXT value and the ID of the row in main that it is associated with.

invoicerator

Reads a SQLite3 database containing a time log and turns it into a PDF invoice based on HTML templates.

Example Usage

invoicerator --configs invoices.yml client-foo.yml --start 1/1/22 timelog.sqlite3

Configuration

Configuration is done with YAML files. The command accepts multiple separate config files which will be merged together. This is intended to allow general configuration to be specified in one file and project or client-specific configuration to be in separate files.

An example of general configuration:

user:
  name: "Alice"
  phone_number: 555-2368
  address:
    street: "14 North Moore Street"
    line2: ""
    city: "New York"
    state: "NY"
    zip_code: "10013"

financial:
  bank:
    name: "Bank of America"
    routingNumber: 021000322
    accountNumber: 92631043
  direct_deposit:
    receiving_institution: "Bank of America"
    aba_routing_number: 021000322
    notes:
      - note: "For international transfers, please note that most U.S. banks do not have a SWIFT or an IBAN number."

An example of a client configuration:

client:
  name: Acme Co
  rate: 7.25

Required Columns

  • Project
  • Date
  • Description
  • Minutes

Installing

npm install -g .

Libraries

tinylog

Minimal viable logging.

Development

The repo is set up using Yarn Workspaces to allow multiple packages to coexist in the same place and depend on each other. That means you can run yarn install from the root of the repo to install the dependencies for all the packages. (But heads-up, some packages may not use Node.js for the runtime.)