Home

Awesome

Who am I ?

Hey I am Lupin, an Open Source Telegram Python Chat Bot build to supercharge your LogSeq with great features like Interstitial Journaling | Flashcards | Brainmaps | PDF / Web Annotations | {TODO; DOING; LATER} | Bookmarks | Images upload and more

Getting Started

There are two methods to deploy Lupin. You can install it manaully or your can use Docker. Either method will require that you place information in a config.ini file.

Manually via Python and PIP:

Assuming you are already using LogSeq & are familar with Python.

Lupin requires Python version >= 3.x

  1. Clone me git clone https://github.com/akhater/Lupin
  2. Create a telegram bot
  3. Install Python Telegram Bot library using pip install python-telegram-bot or pip3 install python-telegram-bot
  4. Install PyGithub library using pip install pyGitHub or pip3 install pyGitHub
  5. Install the requests library using pip install requests or pip3 install requests
  6. Generate a Github token from https://github.com/settings/tokens
  7. Rename config.sample.ini to config.ini
  8. Change values in config.ini to fit your environment
  9. Run the bot using python main.py or python3 main.py

Docker

The container is based off the official python 3 images.

The only requirement is that you have Docker installed.

Before pulling the container please follow these steps:

  1. Create a telegram bot: https://core.telegram.org/bots#creating-a-new-bot
  2. Generate a Github personal token from https://github.com/settings/tokens
  3. Download config.sample.ini and save it asconfig.ini
  4. Change values in config.ini to fit your environment

Note: That if you do not change the time zone (TZ) your timestamp will reflect Eastern US Time (America/New_York). You can see a list of time zones here that way you can have the timestamp reflect a time zone of your choosing.

You can run an instance of Lupin where your config.ini is located by typing this in your terminal:

docker run -d \
--name lupin \
--mount type=bind,source=$(pwd)/config.ini,target=/app/config.ini \
-e TZ=America/New_York \
--restart unless-stopped \
digitalknk/lupin

You could also create a docker-compose.yaml file and copy/paste the text from below or download it from the repo, save it where your config.ini is located. You can then deploy Lupin by typing this in your terminal docker-compose up -d in the same directory.

version: "3.2"
services:
  lupin:
    container_name: lupin
    image: digitalknk/lupin
    volumes:
      - type: bind
        source: ./config.ini
        target: /app/config.ini
    environment:
      TZ: America/New_York
    restart: unless-stopped

When a new update to the container is released, you can update your pulled image by running one of these depending your deployment strategy where your config.ini is located:

If you used the docker run command:

docker stop lupin
docker rm lupin
docker run -d \
--name lupin \
--mount type=bind,source=$(pwd)/config.ini,target=/app/config.ini \
-e TZ=America/New_York \
--restart unless-stopped \
digitalknk/lupin

If a docker-compose.yaml is used:

docker-compose stop
docker-compose rm -f
docker-compose pull   
docker-compose up -d

Features

Spaced Repetition

Supported format for flaschards is

## #flashcardtag
### Question 1
#### answer line 1
#### answer line 2
### Question 2
#### Answer 2

Flashcard tag is customizable Algorithm used is SuperMemo2 Triggers are /tsr import --> scan - import - update your flashcards /tsr x -> retrieve x flashcards from you pending pool /tsr -> retrieve the default number of cards set in your config .ini file Below entry in config.ini specifies you default number of flashcards

[TimeSpacedRepetion]
flashcardDailyGoal=10

Theme Switcher

Before being able to use this feature you need to name your various themes in the format ThemeName.custom.css and place them in the /logseq folder

Commands summary

CommandDescription
/startJust a greeting
/uptimereturns Lupin Uptime
/verreturns Lupin running Version
/helphelp command (WIP)
/anno URLImport hypothesis annotations from URL
/importFCImports your Flashcards into Lupin
/srs importalias of /importFC
/srs xstarts a round of SRS for x flashcards
/getMM pageTitleGenerates a dynamic MindMap for pageTitle
/pullNowPulls all pages from your Git for fast access
/themescalls the theme changer
/encryptAllEncrypts all your pages with AGE keys
/decryptAllDecrypts all your pages back to clear text

Screenshots

Imported Hypothesis notes into LogSeq

Credits

License

MIT License