Skip to main content

A note-taking tool integrated with GitHub issues

Project description

Notehub

Using Github issues as general notes.

Requirements

User Setup

1. Install GitHub CLI

Install the GitHub CLI (gh) if you haven't already:

Windows: Download the MSI installer from https://cli.github.com/ (avoid MS Store version - use the official installer)

macOS:

brew install gh

Linux: See https://github.com/cli/cli/blob/trunk/docs/install_linux.md

2. Authenticate with GitHub CLI

For public GitHub:

gh auth login

Follow the prompts to authenticate.

For GitHub Enterprise:

gh auth login --hostname <your-enterprise-github-hostname>

Note: Notehub uses gh for all GitHub API authentication. Make sure this step completes successfully.

3. Install Notehub

pip install lm-notehub

4. Create Your Notehub Repository

Create a GitHub repository to store your notes as issues. The recommended name is notehub.default:

For public GitHub:

  • Go to https://github.com/new
  • Create a repository named notehub.default
  • Make it private (recommended for personal notes)

For GitHub Enterprise:

5. Configure Notehub Settings

Set your default configuration using git config:

For public GitHub (using default repo name):

git config --global notehub.host github.com
git config --global notehub.org <your-github-username>
git config --global notehub.repo notehub.default

For GitHub Enterprise:

git config --global notehub.host <your-enterprise-github-hostname>
git config --global notehub.org <your-org-or-username>
git config --global notehub.repo notehub.default

Example for enterprise:

git config --global notehub.host github.enterprise.com
git config --global notehub.org jsmith
git config --global notehub.repo notehub.default

Configure editor (Windows):

By default, gh (and thus notehub add) uses vi for editing. To use VS Code instead:

[System.Environment]::SetEnvironmentVariable('GIT_EDITOR', 'code --wait', 'User')

Restart your terminal after setting this. The --wait flag ensures VS Code blocks until you close the editor tab.

Optional: Token environment variables

While gh auth login handles authentication, you can also set token environment variables for additional flexibility:

  • GH_ENTERPRISE_TOKEN_2 - Preferred for enterprise
  • GH_ENTERPRISE_TOKEN - Alternative for enterprise
  • GITHUB_TOKEN - For public GitHub

These are checked in order and used to populate the environment when calling gh.

6. Verify Setup

Test that notehub can access your repository:

notehub status

You should see your configured host/org/repo. You're ready to start using notehub!

Development Setup

1. Install Python (Windows)

  • Install the python.org edition of Python3.x, stay away from MS Store
  • Installer should add to the PATH:
C:\Users\<username>\AppData\Local\Programs\Python\Python313\Scripts
C:\Users\<username>\AppData\Local\Programs\Python\Python313
C:\Users\<username>\AppData\Local\Programs\Python\Launcher

2. Install in Development Mode

Install notehub with development dependencies:

python -m pip install -e .[dev]

This installs:

  • pytest - Testing framework
  • pytest-cov - Code coverage
  • pytest-mock - Mocking utilities
  • pre-commit - Git hooks framework

Note: Don't use --user flag. On Windows, --user puts packages in AppData\Roaming instead of AppData\Local, but since you own the latter there's no reason to use --user.

3. Set Up Pre-commit Hooks

Install the git hooks:

pre-commit install

This will automatically run on every commit:

  • Trailing whitespace removal
  • End-of-file fixes
  • YAML validation
  • Large file checks
  • Merge conflict detection
  • Unit tests with 20% minimum coverage

4. Configure GitHub Token

For public GitHub: Set GITHUB_TOKEN environment variable with a personal access token.

Within the corp wall: Set GH_ENTERPRISE_TOKEN_2 environment variable (add to Windows environment variables).

5. Running Tests

Run all tests:

pytest

Run only unit tests:

pytest tests/unit/

Run with coverage report:

pytest --cov=src/notehub --cov-report=term-missing

6. Publishing to PyPI (Maintainers Only)

To publish a new version to PyPI, you need a PyPI API token. Set it as an environment variable:

Windows (PowerShell):

[System.Environment]::SetEnvironmentVariable('LM_NOTEHUB_PYPI_TOKEN', 'your_pypi_token_here', 'User')

Restart your terminal, then run the publish script:

bash build-and-publish.sh

This will build the distribution and upload it to PyPI.

Usage

After installation, the notehub command will be available:

notehub --help

Virtual Environments (Optional)

Many developers recommend using virtual environments (venv, conda, etc.) to isolate project dependencies. While this is a best practice for production and complex projects with conflicting dependencies, it adds complexity and can be skipped for simpler projects or solo development. If you want to use one:

python -m venv .venv
.venv\Scripts\activate  # Windows
source .venv/bin/activate  # Unix/macOS

Then proceed with the installation steps above.

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

lm_notehub-0.1.1.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

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

lm_notehub-0.1.1-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file lm_notehub-0.1.1.tar.gz.

File metadata

  • Download URL: lm_notehub-0.1.1.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for lm_notehub-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e60169a852530442742271aece3461c70ce9f7ab0fca842947242f13fb765d1a
MD5 f1fd082460cbf38f7aa42577b8e51252
BLAKE2b-256 546e067194f53e4da80de5e057a77e00e728326c7a729234052dc96438bef9b5

See more details on using hashes here.

File details

Details for the file lm_notehub-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: lm_notehub-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for lm_notehub-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9ae69a69b5992b2be1b731e65cee222e81ca39350c3e0a823e8583ccbad4d4d4
MD5 9c5190d0b1f081d3b624ea3500aa8d7d
BLAKE2b-256 564d69b09349e7d2869b88efc2d8538b20af9037208acd12e048e5bf8bdbd34d

See more details on using hashes here.

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