Saravanan666/pypi-org huggingface dataset:
Package: notion-exporter
notion-exporter: Export Notion pages to MarkdownThis python package allows you to easily export your Notion pages to Markdown by providing a Notion API token.Given that the Notion API is subject to somerate limits,
this tool will automatically retry failed requests and wait for the rate limit to reset before retrying. This is
especially useful when exporting a large number of pages. Furthermore, this package usesasyncioto make requests in
parallel, which can significantly speed up the export process.Installationpipinstallnotion-exporterUsagefromnotion_exporterimportNotionExporterexporter=NotionExporter(notion_token="<your-token>")exported_pages=exporter.export_pages(page_ids=["<list-of-page-ids>"])# exported_pages will be a dictionary where the keys are the page ids and# the values are the page content in markdown formatTheNotionExporterclass takes the following arguments:notion_token: Your Notion API token. You can find information on how to get an API token inNotion's documentationexport_child_pages: Whether to recursively export all child pages of the provided page ids. Defaults toFalse.extract_page_metadata: Whether to extract metadata from the page and add it as a frontmatter to the markdown.
Extracted metadata includes title, author, path, URL, last editor, and last editing time of
the page. Defaults toFalse.exclude_title_containing: If specified, pages with titles containing this string will be excluded. This might be
useful for example to exclude pages that are archived. Defaults toNone.TheNotionExporter.export_pagesmethod takes the following arguments:page_ids: A list of page ids to export. Ifexport_child_pagesisTrue, all child pages of these pages will be
exported as well.database_ids: A list of database ids to export. Ifexport_child_pagesisTrue, all pages in these databases
will be exported as well.ids_to_exclude: A list of page ids to exclude when recursively exporting child pages. If an excluded page is
encountered, its child pages will not be exported either.
Package: notionfier
Notionfier: Import Markdown Pages to Notion.soFork ofhttps://github.com/Arsenal591/notionfierupdated dependenciespublished to PyPireformatted, updated python versionImport markdown files to Notion.so using itsofficial API.Requirments: Python >= 3.11.FeaturesAll markdown basic syntax.Some markdown extended syntax:Tables.Code blocks.Footnotes.Definition lists.Strikethrough.Task lists.Automatic URL Linking.UsageFirstly, follow theinstructionto create an notion integration and share a page with the integration.CLInotionfier import -t={{YOUR NOTION TOKEN}} -pid={{PAGE ID}} -f={{FILE PATH}}ProgrammaticallyfromnotionfierimportNotionPageBuildertoken="TOKEN"builder=NotionPageBuilder(token)parent_page_id="123"name="Import Markdown File"content="##Markdown!!!"# For syncbuilder.create_page(parent_page_id,name,content)# For asyncawaitbuilder.acreate_page(parent_page_id,name,content)TODOsHighlighting.MathJax.Support local image files.Handle deeply (> 3 levels) nested children properly.Deal with Notion API'srequest limits.More tests on markdown extensions.LICENSEMIT License
Package: notionflow
notionflowWIPNotionflow is a library for experiment management in machine learning on notion.InstallationpipinstallnotionflowQuick startexportNOTION_TOKEN=<yournotiontoken>exportNOTION_PARENT_PAGE_ID=<parentpageid>importnotionflowasnfnf.create_database("database1",{"param1":"number"},{"recall":"number"})withnf.start_page(page_name="page1")aspage:nf.log_param("param1",1.0)nf.log_metric("recall",0.5)withnf.start_page(page_name="page2")aspage:nf.log_param("param1",2.0)nf.log_metric("recall",0.1)
Package: notion-formulas
Notion FormulasNotion Formulas is a Python library designed for composing and manipulating complex formulas for Notion programmatically. Enhance your Notion workspace by leveraging the power of Python to create and manage formulas.InstallationTo get started with Notion Formulas, you can install the package usingpip:pipinstallnotion-formulasUsagefromnotion_formulasimportNumber,propx:Number=prop("x")y:Number=prop("y")print(x+y)# Prints `prop("x") + prop("y")`APIThe complete Notion Formulas API maintains consistency with the original names, with the following adjustments:Camel casing is converted to snake case (e.g.,replaceAll()becomesreplace_all()).Functions matching python keywords are modified with a trailing underscore: (i.g.if()becomesif_()).Constants are uppercased (i.g.ebecomesE).Data typesThe api is fully typed and defines following data types for expressions:Boolean,Number,String, andDate, allowing your formulas to be typed checked bymypy.ExamplesFor a comprehensive example, refer to the code that generates a Taskwarrior styleurgency scorefor a Notion task database inexamples/urgency.pyand the associated outputexamples/urgency.txt.ContributingContributions to Notion Formulas are welcome and appreciated. If you'd like to contribute, please follow these steps:Fork the repository.Create a new branch for your changes.Make your changes and update the tests as needed.Submit a pull request with your changes.For major changes, please open an issue first to discuss what you would like to change.LicenseNotion Formulas is released under theMITlicense, which allows for free and open use, modification, and distribution.
Package: notion-graph
Notion Graph ViewExportNotionpages to a Roam-Research like graph view.📜 UsageEnvironmentPython >= 3.9Installingpipinstallnotion-graphNotion API SetupCreate anotion internal integrationand generate anInternal Integration Token.👉Learn more about authorizationOpen one notion page on the browser, select "Add connections" and add your integration account.Find your basePage IDfrom the browser URL, for example:if page url is:https://www.notion.so/yourName/PageTitle-8a4b5ff100d648fb8d39d4bfa756ff3f,8a4b5ff100da48fb8d39d4bfa756ff3fis thePage IDQuickly Runningpython-mnotion_graph-p<PageID>-t<IntegrationToken>-o<filepathtoexport>For instance,python-mnotion_graph-p856391c93ae64bd1b7ebf699ca0cd861-tsecret_b8p7uLp3j3n95IDgofC9GviXP111Skx6NOt2d20U8e-o./graph_out.htmlgraph_out.htmlwould be generated at your specific path.Importing as a Python LibraryYou can also importnotion_graphas a library.For instance, draw your diagram in Jupyter Notebook.importnotion_graphasngmy_ng=ng.NotionGraph(bearer_token="secret_b8p7uLp3j3n95IDgofC9GviXP111Skx6NOt2d20U8e")network=my_ng.parse(page_id="856391c93ae64bd1b7ebf699ca0cd861")# `network` is a `pyvis.network.Network` object, see more attributes: https://pyvis.readthedocs.io/en/latest/documentation.htmlnetwork.repulsion(node_distance=200,spring_length=200)# this line is for jupeter notebook onlynetwork.prep_notebook()network.show("graph.html")Testing EnvironmentThe testing page isNotion-graph-view-demo. You can duplicate the page to your Notion account and run the project to test if everything goes well.Development GuideThis project's dependencies are managed byPDM.brewinstallpdm
pdminstallRunning the project by:pdmrunstart-p<page_id>-t<notion_token>-o./graph_out.html🔗 Supported Linksdatabasepageparagraph✔️✔️bulleted_list_item✔️✔️numbered_list_item✔️✔️to_do✔️✔️toggle✔️✔️child_page✔️✔️child_database✔️✔️embedcallout✔️✔️quote✔️✔️heading_1✔️✔️heading_2✔️✔️heading_3✔️✔️column✔️✔️column_list✔️✔️synced_blocklink_to_pagetable✔️✔️table_row✔️✔️
Package: notion-haystack
notion-haystack: Export Notion pages to Haystack DocumentsThis python package allows you to easily export your Notion pages to Haystack Documents by providing a Notion API token.Given that the Notion API is subject to somerate limits,
this component will automatically retry failed requests and wait for the rate limit to reset before retrying. This is
especially useful when exporting a large number of pages. Furthermore, this component usesasyncioto make requests in
parallel, which can significantly speed up the export process.Installationpipinstallnotion-haystackUsageTo use this package, you will need a Notion API token. You can follow the steps outlined in theNotion documentationto create a new Notion integration, connect it to your pages, and obtain your API token.To enable your Notion integration to work on specific pages and the child pages in Notion, make sure to enable it in the 'Connections' setting of the page.The following minimal example demonstrates how to export a list of pages to Haystack Documents:fromnotion_haystackimportNotionExporterexporter=NotionExporter(api_token="<your-token>")exported_pages=exporter.run(page_ids=["<list-of-page-ids>"])# exported_pages will be a list of Haystack Documents where each Document corresponds to a Notion pageThe following example shows how to use theNotionExporterinside an indexing pipeline:fromhaystackimportPipelinefromnotion_haystackimportNotionExporterfromhaystack.components.preprocessorsimportDocumentSplitterfromhaystack.components.writersimportDocumentWriterfromhaystack.document_storesimportInMemoryDocumentStoredocument_store=InMemoryDocumentStore()exporter=NotionExporter(api_token='YOUR_NOTION_API_KEY')splitter=DocumentSplitter()writer=DocumentWriter(document_store=document_store)indexing_pipeline=Pipeline()indexing_pipeline.add_component(instance=exporter,name="exporter")indexing_pipeline.add_component(instance=splitter,name="splitter")indexing_pipeline.add_component(instance=writer,name="writer")indexing_pipeline.connect("exporter.documents","splitter.documents")indexing_pipeline.connect("splitter","writer")indexing_pipeline.run(data={"exporter":{"page_ids":["your_page_id"]}})# The pages will now be indexed in the document storeTheNotionExporterclass takes the following arguments:api_token: Your Notion API token. You can find information on how to get an API token inNotion's documentationexport_child_pages: Whether to recursively export all child pages of the provided page ids. Defaults toFalse.extract_page_metadata: Whether to extract metadata from the page and add it as a frontmatter to the markdown.
Extracted metadata includes title, author, path, URL, last editor, and last editing time of
the page. Defaults toFalse.exclude_title_containing: If specified, pages with titles containing this string will be excluded. This might be
useful for example to exclude pages that are archived. Defaults toNone.TheNotionExporter.runmethod takes the following arguments:page_ids: A list of page ids to export. Ifexport_child_pagesisTrue, all child pages of these pages will be
exported as well.
Package: notionist
NotionistLife is divided into before and after meeting NotionThis is Notion collection extraction repository for people who use Notion.I sawnotion-py, unofficial python API for Notion.so made byjamalex, and appreciatedjamalex. Thanks tonotion-py, I'm using Notion better. However, there is no table extraction function. I want to use my table contents in python without extracting zip file. Therefore, I made this repository. At first, this repo was for me, but now I want to share this repo for notion users.Please contact me if you want to join this repo.Quick StartYou can install this module enteringpip install notionistin your command or bash.pip install notionistHow to Use1. Get token_v2First of all, you needtoken_v2to use this module. You can find you token_v2 in your cookies after enterting your id and passward to Notion as follows.F12 (User Defined Key) > Application > Cookies > https://www.notion.so > token_v22. Make a table in notionWhen you make a table in notion, you can copy your table link as follows (If you work in web, you can use url).TODO:Only particular types such as Number, Text, Multi-select, and Select can be extracted from notion. I will try others as soon as possible.3. Using CollectionExtractfromnotionistimportcollection_apitoken_v2='YOUR token_v2'extraction=collection_api.CollectionExtract(token_v2=token_v2)url='https://www.notion.so/tootouch/ae60f9946dc54de78fbd4850ccf48b40?v=9d07e70306b2498eb82805b83f882140'extraction.table_extract(url)TagsnumbertextName0A1apple1B2banana2C3orangeTODOExtract other types in tablePlotting based on table data in Notion page
Package: notion-kit
Table of Contentsnotion_kitUsageInstallQuicky startObjectFunctionsTipsRequirementsReferenceLicensenotion_kitIs for easier usenotion-sdk-py.Because Notion_sdk_py Usage documentation is less, cumbersome to use, and too many dictionary operations.In order to make it easier to use Notion API, a lot of functions that may not be used have been created. :)UsageInstallpypipipinstallnotion-kitGithubpipinstallgit+https://github.com/bluewhitep/notion_kit.gitRefer to the./examplesfold for details on usageQuicky startFollowing the instruction for get token:Notion AuthorizationUse the token.[Recommend: Use environment variable]token=os.environ["NOTION_TOKEN"]Initalize notion_kitfromnotion_kitimportkitasnkitnotion_client=nkit.Client(token=token)Get id from notion urlnotion_url="<Notion url>"notion_id=nkit.get_id(url=notion_url)Get datapage=nkit.Page.get_data(notion_id)# ordatabase=nkit.Database.get_data(notion_id)ObjectNotion_kit use class object operationsobject to dictdata_dict=data_object.Dict# ordata_dict=data_object.asdict()Special cases:PropertyTypeobject can use.full_dict()to get{Property_name: Property_type_value}dict.data_dict=data_object.full_dict()PropertyTypeobject can use.label_dict()to get short info dict.data_dict=data_object.label_dict()# short info dict:# {'name': Property_name,#  'type': Property_type,#  'id': Property_id# }FunctionsDatabase⭕️ Create a new database⭕️ Retrieve databse [Get page list in database]⭕️ Query database [Get database data]⭕️ Create / Update property❌ Delete database [Notion api not support]Page⭕️ Create page in database / page⭕️ Retrieve (get page data)⭕️ Update property [ ** Page in Database]⭕️ Block [add / update / delete block]❌ Delete page [Notion api not support]Block⭕️ Create⭕️ Retrieve (get block data and block childrens)⭕️ Update (rename function from notion_sdk_py)⭕️ Delete blockUser⭕️ Get user list⭕️ Get user data by user_id⭕️ who am i: Get bot user dataTipsDatabase non-create propertiesstatuscan't be updated, because notion api not support it.By notion api document,title,rich_text,number,select,multi_select,date,people,files,checkbox,url,email,phone_number,formula,relation,rollup,created_time,created_by,last_edited_time,last_edited_bycan be updated.rollupcan't be updated on items.RequirementsThis package supports the following minimum versions:Python >= 3.10ReferenceNotion APInotion_sdk_pyLicenseMIT License
Package: notion-kit-flexible
Table of Contentsnotion_kitUsageInstallQuicky startObjectFunctionsTipsRequirementsReferenceLicensenotion_kitIs for easier usenotion-sdk-py.Because Notion_sdk_py Usage documentation is less, cumbersome to use, and too many dictionary operations.In order to make it easier to use Notion API, a lot of functions that may not be used have been created. :)UsageInstallpypipipinstallnotion-kitGithubpipinstallgit+https://github.com/bluewhitep/notion_kit.gitRefer to the./examplesfold for details on usageQuicky startFollowing the instruction for get token:Notion AuthorizationUse the token.[Recommend: Use environment variable]token=os.environ["NOTION_TOKEN"]Initalize notion_kitfromnotion_kitimportkitasnkitnotion_client=nkit.Client(token=token)Get id from notion urlnotion_url="<Notion url>"notion_id=nkit.get_id(url=notion_url)Get datapage=nkit.Page.get_data(notion_id)# ordatabase=nkit.Database.get_data(notion_id)ObjectNotion_kit use class object operationsobject to dictdata_dict=data_object.Dict# ordata_dict=data_object.asdict()Special cases:PropertyTypeobject can use.full_dict()to get{Property_name: Property_type_value}dict.data_dict=data_object.full_dict()PropertyTypeobject can use.label_dict()to get short info dict.data_dict=data_object.label_dict()# short info dict:# {'name': Property_name,#  'type': Property_type,#  'id': Property_id# }FunctionsDatabase⭕️ Create a new database⭕️ Retrieve databse [Get page list in database]⭕️ Query database [Get database data]⭕️ Create / Update property❌ Delete database [Notion api not support]Page⭕️ Create page in database / page⭕️ Retrieve (get page data)⭕️ Update property [ ** Page in Database]⭕️ Block [add / update / delete block]❌ Delete page [Notion api not support]Block⭕️ Create⭕️ Retrieve (get block data and block childrens)⭕️ Update (rename function from notion_sdk_py)⭕️ Delete blockUser⭕️ Get user list⭕️ Get user data by user_id⭕️ who am i: Get bot user dataTipsDatabase non-create propertiesstatuscan't be updated, because notion api not support it.By notion api document,title,rich_text,number,select,multi_select,date,people,files,checkbox,url,email,phone_number,formula,relation,rollup,created_time,created_by,last_edited_time,last_edited_bycan be updated.rollupcan't be updated on items.RequirementsThis package supports the following minimum versions:Python >= 3.10ReferenceNotion APInotion_sdk_pyLicenseMIT License
Package: notionlib
Copyright (c) 2022 Jérémie DECOCK (www.jdhp.org)Web site:http://www.jdhp.org/software_en.html#notionlibOnline documentation:http://notionlib.readthedocs.orgExamples:http://notionlib.readthedocs.org/gallery/Notebooks:https://github.com/jdhp/notion-lib-notebooksSource code:https://github.com/jdhp/notion-libIssue tracker:https://github.com/jdhp/notion-lib/issuesPython Client for Notion.so on PyPI:https://pypi.org/project/notionlibPython Client for Notion.so on Anaconda Cloud:https://anaconda.org/jdhp/notionlibDescriptionAn unofficial Python 3 client for Notion.so APINote:This project is still in beta stage, so the API is not finalized yet.DependenciesPython >= 3.0InstallationGnu/LinuxYou can install, upgrade, uninstall Python Client for Notion.so with these commands (in a
terminal):pip install --pre notionlib
pip install --upgrade notionlib
pip uninstall notionlibOr, if you have downloaded the Python Client for Notion.so source code:python3 setup.py installWindowsYou can install, upgrade, uninstall Python Client for Notion.so with these commands (in acommand prompt):py -m pip install --pre notionlib
py -m pip install --upgrade notionlib
py -m pip uninstall notionlibOr, if you have downloaded the Python Client for Notion.so source code:py setup.py installMacOSXYou can install, upgrade, uninstall Python Client for Notion.so with these commands (in a
terminal):pip install --pre notionlib
pip install --upgrade notionlib
pip uninstall notionlibOr, if you have downloaded the Python Client for Notion.so source code:python3 setup.py installDocumentationOnline documentation:http://notionlib.readthedocs.orgAPI documentation:http://notionlib.readthedocs.org/en/latest/api.htmlExample usageTODOBug reportsTo search for bugs or report them, please use the Python Client for Notion.so Bug Tracker at:https://github.com/jdhp/notion-lib/issuesLicenseThis project is provided under the terms and conditions of theMIT License.
Package: notion-log-exec
notion-log-execRun a command and report the result back to notionusage: notion-log-exec [--config config] [--log_failure_only]  [command_args [command_args ...]]


Runs a command and reports the result back to a collection row on Notion

positional arguments:
  command_args

optional arguments:
  -h, --help            show this help message and exit
  --config config, -c config
                        Path to a config file
  --log_failure_only    Append an entry to the log only when the command fails
Package: notion-md
notion2mduse offical notion api withnotion_clientConvert multiple notion pages to markdown files and try to keep the formatting usable.Usagedon't need download repo, get your Token and export your page:get Internal Integration TokenInhttps://www.notion.so/my-integrations, create your workspace integration and get token, likesecret_...download package with pip3pip3installnotion-mdset env variable or input in your terminal:exportNOTION_TOKEN=yourtokenexportNOTION_PAGES=yourmainpagelinkyou can select a seperate open page for downloading, and put others page links in this page(use Notion:/Linkcommand). Then get this page link,make sure you add the integration to your workspace and all your pages your would export.download files usenotion_mdcommand:notion-mdpages are saved tonotion2md_files dir, default only download files storaged in notion.surpportedexport markdown files forGridea-like blog side, supporting properties of notion database pages eg. Tags, Cover.normal block(header,list,code,quote,...)link page/sub pagetablecalloutinline_database(pages)image/youtube video/filefile download(files in notion)notesmulti-level list items,bookmarks, etc. make synchronous network requests, which take longer than other blocks.only download files in notion, external links will be ignored.for database, only download pages in the database.children blocks in callouts will be ignored, simple style is better.
Package: notion-nopy
Welcome to NoPy!NoPy is an unofficial OOP interface for theNotion API.InstallationTODO.Getting StartedCreate an instance of aNotionClientand pass in your integration token. Refer thedocsto find out how to set up the integration token and more.fromnopyimportNotionClientclient=NotionClient("your-notion-integration-token")db=client.retrieve_db("your-db-id")print(db.title)# The database title.print(db.description)# The database description.# Getting all the pages in the database.forpageindb.get_pages():print(page.title)# The page title.# Closing the client.client.close()NOTE: Instead of passing in the integration token, you could instead store the token in the environment variables with the keyNOTION_TOKEN.
Package: notion-params
Introduction ofnotion-paramsThis is a helper to build Notion API params, parse markdown text into Notion API blocks,
include a simple client support all APIs version '2022-02-22'.Page can be created using markdown:Table:Database:See more demos insample.py:python sample.py {page_id}where page_id is a notion page your token has permission to write. This sample code will create a sub page to show all the demos.Change log0.0.1 NotionParams and markdown parsecreate_pageupdate_pageappend_markdowntable_df,table_df_rowscreate_database,create_database_rowfind_child0.0.2 add a simple client, change doc of NotionParams methods to matchclient.py support all APIs version 2022-02-22add sample.py show demos in a sample page0.0.3 adddf_columns_add_prefix_for_databaseto enforce database columns order0.0.4table_df()add options pass to notion API control row/column headers0.0.5 bugfix0.0.6 support github style markdown table, seelsample.py
Package: notionpy
Notion.pyA terminal client of Notion.so in PythonDocumentation:https://waynerv.github.io/notionpyGitHub:https://github.com/waynerv/notionpyPyPI:https://pypi.org/project/notionpy/Free software: MITFeaturesTODOCreditsThis package was created withCookiecutterand thewaynerv/cookiecutter-pypackageproject template.
Package: notion-python
Notion API ClientThis is the python client for the Notion API.
Use this client to report on ingredients, and create new ingredients.Installpipinstallnotion-pythonUsageGet your API Token, and ingredient information from here:https://app.usenotion.com/api_control_panelimportnotion# create a clientclient=notion.NotionClient('YOUR_API_KEY')# make a reportclient.report(datetime.now(),20,ingredient_id='AN_INGREDIENT_KEY')# make many reportsclient.batch_report('AN_INGREDIENT_KEY',[{'date':datetime.now()-timedelta(days=1),'value':2},{'date':datetime.now(),'value':3},])# create a new ingredientclient.create_ingredient('Ingredient Name',[{'date':datetime.now()-timedelta(days=1),'value':2},{'date':datetime.now(),'value':3},])Error HandlingAll methods will raise a subclass ofnotion.NotionErrorin the event that
the request could not be made, or an error occurred.DevelopmentInstallgitclonehttps://github.com/notion-data/notion-python.gitcdnotion-pythonpipinstall-e.TestsenvNOTION_TOKEN=FOOBARNOTION_API_ROOT=https://app.usenotion.compython-munittestdiscoverpylint--output-formatparseable--disableC0111notiontests