Git Notion
==========
Syncs Github markdown files in your repository to Notion.
This utility is described in the following [blog post](https://www.swiftlane.com/blog/syncing-docs-from-code-repositories-to-notion/).
See example [Notion page](https://www.notion.so/git_notion-195c08d3d14140eb9a35ac00f9a0f078).
## Installation
```
pip install git-notion
```
or for local installation:
```bash
git clone https://github.com/Harbor-Systems/git-notion.git
cd git-notion
pip install -e .
```
## Configuring
`NOTION_TOKEN_V2` - Can be found in your [browser cookies](https://www.redgregory.com/notion/2020/6/15/9zuzav95gwzwewdu1dspweqbv481s5) for Notion's website.<br>
`NOTION_ROOT_PAGE` - URL for notion page. Repo docs will be a new page under this page.<br>
`NOTION_EXCLUDE_REGEX` - Regex for paths to ignore.<br>
`NOTION_INCLUDE_REGEX` - Regex for paths to include.<br>
`NOTION_CONFIG_PATH` - Path to the setup.cfg file.<br>
These environment variables can be set.
```bash
export NOTION_TOKEN_V2=<YOUR_TOKEN>
export NOTION_ROOT_PAGE="https://www.notion.so/..." # Can be in setup.cfg as well
export NOTION_IGNORE_REGEX="(?i)(vendor\/.*\.md|deleteme\.md)" # Can be in setup.cfg as well
export NOTION_INCLUDE_REGEX="(?i)(docs\/.*\.md|readme\.md)" # Can be in setup.cfg as well
export NOTION_CONFIG_PATH="docs/"
```
These parameters can be set in the `setup.cfg` for the repo.
```
[git-notion]
ignore_regex = models/.*
include_regex = docs/.*
notion_root_page = https://www.notion.so/...
```
## Running Locally
1. Set up a virtual environment
```shell
python3 -m pip install virtualenv # only do this the first time
```
2. Create a virtual environment
```shell
python3 -m virtualenv venv
```
3. Activate the virtual environment
```shell
source venv/bin/activate
```
4. Install the dependencies
```shell
python3 -m pip install -r requirements.in
```
5. Set any environment variables and run the command
```shell
export NOTION_TOKEN_V2=<...>
export NOTION_ROOT_PAGE="https://www.notion.so/..."
python3 git-notion-pretty/cli.py [options]
```
## Usage
```bash
# To upload your current directory
git-notion-pretty
# To upload to a different directory name
git-notion-pretty --dir-name="Application Docs"
# To use a flat structure instead of the nested structure
git-notion-pretty --page-structure=flat
# To use the file name instead searching for and using the H1 header on the first line
git-notion-pretty --use-file-name
```
## Pushing to PYPI
```bash
python3 -m bumpversion patch # Look-up bumpversion
rm -rf dist/
python3 setup.py sdist bdist_wheel
python3 -m twine upload dist/*
```
Raw data
{
"_id": null,
"home_page": "https://github.com/Harbor-Systems/git-notion",
"name": "git-notion-pretty",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.5",
"maintainer_email": "",
"keywords": "git_notion_pretty",
"author": "NarekA",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/d4/74/7a79b1ec5894112d9007166f7cec5a947f5106566ac65701db1aea2afda3/git_notion_pretty-1.0.3.tar.gz",
"platform": null,
"description": "Git Notion\n==========\n\nSyncs Github markdown files in your repository to Notion.\n\nThis utility is described in the following [blog post](https://www.swiftlane.com/blog/syncing-docs-from-code-repositories-to-notion/).\n\nSee example [Notion page](https://www.notion.so/git_notion-195c08d3d14140eb9a35ac00f9a0f078).\n\n## Installation\n```\npip install git-notion\n```\n\nor for local installation:\n\n```bash\ngit clone https://github.com/Harbor-Systems/git-notion.git\ncd git-notion\npip install -e .\n```\n\n## Configuring\n\n`NOTION_TOKEN_V2` - Can be found in your [browser cookies](https://www.redgregory.com/notion/2020/6/15/9zuzav95gwzwewdu1dspweqbv481s5) for Notion's website.<br>\n`NOTION_ROOT_PAGE` - URL for notion page. Repo docs will be a new page under this page.<br>\n`NOTION_EXCLUDE_REGEX` - Regex for paths to ignore.<br>\n`NOTION_INCLUDE_REGEX` - Regex for paths to include.<br>\n`NOTION_CONFIG_PATH` - Path to the setup.cfg file.<br>\n\nThese environment variables can be set.\n```bash\nexport NOTION_TOKEN_V2=<YOUR_TOKEN>\nexport NOTION_ROOT_PAGE=\"https://www.notion.so/...\" # Can be in setup.cfg as well\nexport NOTION_IGNORE_REGEX=\"(?i)(vendor\\/.*\\.md|deleteme\\.md)\" # Can be in setup.cfg as well\nexport NOTION_INCLUDE_REGEX=\"(?i)(docs\\/.*\\.md|readme\\.md)\" # Can be in setup.cfg as well\nexport NOTION_CONFIG_PATH=\"docs/\"\n```\n\nThese parameters can be set in the `setup.cfg` for the repo.\n```\n[git-notion]\nignore_regex = models/.*\ninclude_regex = docs/.*\nnotion_root_page = https://www.notion.so/...\n```\n\n## Running Locally\n\n1. Set up a virtual environment\n```shell\npython3 -m pip install virtualenv # only do this the first time\n```\n2. Create a virtual environment\n```shell\npython3 -m virtualenv venv\n```\n3. Activate the virtual environment\n```shell\nsource venv/bin/activate\n```\n4. Install the dependencies\n```shell\npython3 -m pip install -r requirements.in\n```\n5. Set any environment variables and run the command\n```shell\nexport NOTION_TOKEN_V2=<...>\nexport NOTION_ROOT_PAGE=\"https://www.notion.so/...\"\npython3 git-notion-pretty/cli.py [options]\n```\n\n## Usage\n\n```bash\n# To upload your current directory\ngit-notion-pretty\n\n# To upload to a different directory name\ngit-notion-pretty --dir-name=\"Application Docs\"\n\n# To use a flat structure instead of the nested structure\ngit-notion-pretty --page-structure=flat\n\n# To use the file name instead searching for and using the H1 header on the first line\ngit-notion-pretty --use-file-name\n```\n\n## Pushing to PYPI\n\n```bash\npython3 -m bumpversion patch # Look-up bumpversion\nrm -rf dist/\npython3 setup.py sdist bdist_wheel\npython3 -m twine upload dist/*\n```\n",
"bugtrack_url": null,
"license": "MIT license",
"summary": "Syncs GitHub Markdown files to Notion",
"version": "1.0.3",
"split_keywords": [
"git_notion_pretty"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1eb8a112460ea9decf3c981d9e7dad6b21510d6f349c9de3ddbdcda48a022648",
"md5": "b825c228bb853ebd1a92242474660ba6",
"sha256": "0a2999e68bfab473ff9d7e82607d615dc77a8c6e4f3a8c68af84b3623de2c2dd"
},
"downloads": -1,
"filename": "git_notion_pretty-1.0.3-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "b825c228bb853ebd1a92242474660ba6",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.5",
"size": 6400,
"upload_time": "2023-04-24T15:47:49",
"upload_time_iso_8601": "2023-04-24T15:47:49.434295Z",
"url": "https://files.pythonhosted.org/packages/1e/b8/a112460ea9decf3c981d9e7dad6b21510d6f349c9de3ddbdcda48a022648/git_notion_pretty-1.0.3-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d4747a79b1ec5894112d9007166f7cec5a947f5106566ac65701db1aea2afda3",
"md5": "6dad30e028ab9d133fad7b7156ed1513",
"sha256": "c421ab704e6c894ee8b1196b34cdca87713d906c383e1a253004941217f30b0c"
},
"downloads": -1,
"filename": "git_notion_pretty-1.0.3.tar.gz",
"has_sig": false,
"md5_digest": "6dad30e028ab9d133fad7b7156ed1513",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.5",
"size": 6304,
"upload_time": "2023-04-24T15:47:51",
"upload_time_iso_8601": "2023-04-24T15:47:51.757741Z",
"url": "https://files.pythonhosted.org/packages/d4/74/7a79b1ec5894112d9007166f7cec5a947f5106566ac65701db1aea2afda3/git_notion_pretty-1.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-24 15:47:51",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "Harbor-Systems",
"github_project": "git-notion",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "git-notion-pretty"
}