GithubHelp home page GithubHelp logo

notion-backup's Introduction

Notion Backup

This repo makes a backup of OpenOwnership's Notion workspace.

The code runs via a Github Action, which is scheduled to run at 4:05am every day, as well as whenever code is pushed to the repository.

Running the code locally

The code to run the backup lives in /notion/export_notion.py. To run it:

  1. Install requirements

    git clone [email protected]:openownership/notion-backup.git
    cd notion-backup
    python3 -m venv venv
    source venv/bin/activate
    pip install -r requirements.txt
    touch .env
  2. Set your credentials in the .env file:

    NOTION_SPACE_ID=1234-56789-abcdef
    [email protected]
    NOTION_PASSWORD=password
    GDRIVE_ROOT_FOLDER_ID=<get-the-folder-id-from-gdrive>
    GDRIVE_SERVICE_ACCOUNT=<get-the-service-account-info-from-1password>
  3. Run the python module: python notion

You can find the space id by logging into Notion as the tech+notion user and then inspecting one of the ajax requests that notion's front end makes in the chrome dev console. It's often found in the body of responses from Notion.

Note that this assumes you have a email/password user account, not one through Google SSO.

Github Action config

The Github Action is configured via secrets set up in the repo settings. These are then set as env vars for the python script to use.

notion-backup's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.