Skip to content

eranfrie/CheatSheet

Repository files navigation

CheatSheet

A productivity self-hosted tool to manage and browse cheatsheet and snippets (in a Markdown format).

This project is based on Bookmarker code base.

Privacy

Snippets are stored locally in a SQLite database. This is useful when you don't want to expose sensitive data (e.g., in your workplace) with third-party tools. Note that it is recommended to periodically back up the SQLite file.

Installation

Requirements:
  1. Python 3.7 or higher
Linux / macOS:
  1. Create a directory named venv
  2. Run:
python -m venv <route/to/venv-directory>
source <route/to/venv-directory>/bin/activate
pip install -r requirements.txt

Running the application

  1. Activate the virtual environment: source venv/bin/activate
  2. Run python src/main.py
  3. From the browser: http://localhost:8000

Tests

This project is well tested with unittests and end-to-end tests. The code coverage is 98%.

The build.py script runs the following static code analysis and test suites:

  • pycodestyle (pep8)
  • pylint
  • Unit tests
  • End-to-end tests

To run build.py:

  1. Activate the virtual environment: source venv/bin/activate
  2. Install dev dependencies: pip install -r requirements_dev.txt
  3. Run: PYTHONPATH=src python build.py

To check coverage:

  1. PYTHONPATH=src coverage run --concurrency=multiprocessing build.py
  2. coverage combine
  3. coverage html
  4. Open htmlcov/index.html in your browser