Saravanan666/pypi-org huggingface dataset:
Package: notion-python-2
notion-pythonnotion-pythonis an API wrapper for Notion, written in Python.This library uses Oauth2 for authentication.Installingpip install notion-python-2UsageIf you don't have an access token:from notion.client import Client
client = Client(client_id, client_secret, redirect_uri)To obtain and set an access token, follow this instructions:Get authorization URLurl = client.authorization_url()Get access token using coderesponse = client.get_access_token(code)Set access tokenclient.set_token(access_token)Check more information about Notion Oauth:https://developers.notion.com/docs/authorizationIf you already have an access token:from notion.client import Client
client = Client(access_token=access_token)User- Get Current Useruser = client.get_current_user()- List usersusers = client.list_users(page_size=3)
# page_size: max 100 
# start_cursor: pagination variable, get this value from previous page 'next_cursor' parameter.Databases and Pages- List all objects# object_type options are: page or database
# page_size: max 100 
# start_cursor: pagination variable, get this value from previous page 'next_cursor' parameter.

databases_list = client.list_objects("database", page_size=5)- Get databasedatabase = client.get_database(database_id)- Query database pagesHow to build a filter object:https://developers.notion.com/reference/post-database-query-filterHow to build a sort object:https://developers.notion.com/reference/post-database-query-sortfilter_criteria = {"property": "Main Email", "email": {"equals": "example@mail.com"}}
# Where 'Main Email' is the field name and 'email' is the field type
pages = client.query_database_pages(
    database_id, 
    filters=filter_criteria, 
    sorts: dict = None, 
    start_cursor=None, 
    page_size=None
)- Create pageproperties_example = {
    "Project name": {
        "title": [
            {
                "text": {
                    "content": "First project built with this library"
                    }
            }
        ]
    },
}
cover_url = "https://upload.wikimedia.org/wikipedia/commons/1/1/example.jpg"
page = client.create_page(database_id, properties_example, cover_url=cover_url)- Update pageproperties_example = {
    "Project name": {
        "title": [
            {
                "text": {
                    "content": "Project field modified"
                    }
            }
        ]
    },
}
page = client.update_page(page_id, properties_example, cover_url=None)How to build a properties object:https://developers.notion.com/reference/page-property-values
Package: notion-python-client
Notion Python Client (NPC)IntroductionNPC (Notion Python Client) is a Python library that simplifies interactions with the Notion API. With this library, you can effortlessly integrate your Python applications with Notion, allowing you to create, retrieve, update, and manage Notion pages, databases, and more, all within your Python code.FeaturesSimple and Intuitive:NPC provides a user-friendly interface to interact with the Notion API. Whether you are a seasoned developer or new to Notion, you'll find it easy to get started.Diverse Functionality:You can perform a wide range of actions using NPC, such as creating new pages, updating page content, retrieving database entries, and much more.Authentication:NPC takes care of the authentication process, allowing you to focus on your application logic without worrying about the intricacies of the API's authentication flow.Customization:The library is designed to be flexible, making it easy to adapt to your specific project requirements. You can use it to integrate Notion with your websites, productivity tools, or automate your Notion workspace.InstallationYou can install NPC using pip:pipinstallnotion-python-clientGetting StartedAuthentication Setup: To use NPC, you need to create an integration in your Notion workspace and obtain an API token. Follow our authentication guide to set this up.Import NPC: Import the library into your Python script:fromnotion_python_clientimportNPCCreate a Notion Client: Initialize a Notion client with your API token:client=NPC("YOUR_API_TOKEN")Interact with Notion: You're ready to start using NPC to interact with Notion. Here's an example of creating a new page:pages=client.database_handler.get_pages("YOUR_DATABASE_ID")DocumentationFor detailed documentation, please visit theNPC Documentation.ExamplesExplore our examples directory for sample Python scripts that showcase various use cases of NPC. (Coming Soon)Thank you for choosing NPC for your Notion integration needs! We look forward to seeing what you build with it. Happy coding!
Package: notion-scheduler
notion_schedulerThis tool allows the creation of---drumroll---recurring tasks in Notion!This is done by defining a Notion database (which I will call the Scheduled database) that contains rules for recurring tasks.
This tool reads these definitions and creates each occurrence of those tasks in your actual tasks database (which I will call the Tasks database).DISCLAIMER: I am not responsible if this tool causes any data loss in your Notion database. Always back up your data!Installationpip3 install notion-scheduler
notion_scheduler -hYou can also run this from source by installing all the requirements (seerequirements.txt) and running./notion_scheduler.py -h.Tip: the--dry-run --log-level=verboseoption set can be really useful to see what will happen before applying changes.Fields required in the Scheduled databaseThe fields below are case insensitive.Name of fieldType of fieldDescriptionTitleTextThe title of the taskRecurrenceTextThe recurrence rule for the task (seerecurrentfor supported rules)Not onTextArecurrentrule that describes dates to excludeStart dateDateThe date from whichnotion_schedulershould start creating this taskInclude timeCheckboxWhether to include time in the created tasks (defined in the Recurrence field)DurationTextIf "Include time", how long should each created task last (seedurationsfor syntax)? Empty means no end time.ReminderTextAdurationsrule that describes when you should be reminded. Empty means no reminder.Date fieldText or SelectThe name of the date field of the Tasks databaseAny additional fields defined in the Scheduled database will be copied over to each created task, as defined in theproperties_to_syncconfiguration option (see below).ConfigurationThe configuration file is located at$XDG_CONFIG_HOME/notion_scheduler/config.yml.OptionsThe options below should be in YAML format in the configuration file.Name of optionTypeDescriptiontodo_collection_urlstrThe url of the Tasks database.scheduled_collection_urlstrThe url of the Scheduled database.token_v2strNotion v2 token. Get by inspecting your browser's cookies on a Notion page.properties_to_syncList[str]Additional properties to sync over from the Scheduled database.tags_propertystrThe Select field named by this option for which to add the tagscheduled_tagfor each created task.scheduled_tagstrThe tag to put intags_propertyfor each created task. Allowsnotion_schedulerto keep track of which tasks in the Tasks database it has generated, so that it can replace them with the updated ones on every run.rescheduled_tagstrIf you ever manually reschedule a scheduled task in the Tasks database, remove the tagscheduled_tagfrom the fieldtags_property, and add the tag defined by this option. This allows control over which tasksnotion_schedulerdeletes on re-run (see command-line options).status_propertyOptional[str]If this exists, set the Select field named by this option tostatus_before_todayif a created task is scheduled for before today, orstatus_after_todayif a created task is scheduled for on or after today.status_before_todaystrSeestatus_propertystatus_after_todaystrSeestatus_property
Package: notionsci
NotionSciCollection of scientific app/tool syncs forNotion APIThis cli is meant to allow syncing of scienfic/reasearch tools to notion. (Such as Zotero, ...)InstallationpipinstallnotionsciFeaturesZotero SynchronizationReferences Sync (One Way)Collections Sync (One Way)Useful Notion ToolsPage DuplicationWorkspace Trash CleaningQuick StartBefore getting started, configureNotion intergrationandZotero integration.Duplicate theZotero Library Templateand synchronize the Zotero Collections with:notionscisynczoterocollections<urloridoftheclonedlibrarytemplatepage>and the References with:notionscisynczoterorefs<urloridoftheclonedlibrarytemplatepage>Documentation
Package: notion-scraper
Titlenotion ScraperDescrptionWith notion Scraper you can scrape search results and extract the contents produced by the search result.In notion scraper it will scrape the data present of the website and give json data which contains the details of the contents on the website.JSON sample data{"Scraper_repeat_data_0":[{"description":"Advanced features for your org","item_link":"/enterprise","label":"Enterprise"},{"description":"Run your team on one tool","item_link":"/teams","label":"Small business"}Click Here for moreRun Scraperfromnotion_scraperimport*link="https://www.notion.so/mobile"data=run_notion_scraper(link)How it works?It takes URL of notion page with a search keyword to scrape the data.It generates the json data which contains the information of the notion search result.It gives the every detail present inside website in the form of json data.ExamplesBelow are some of the examples of URLs using which you can scrape:Example 1Example2Queries/ FeedbackIf you have some queries or feedback please contact us at followingTelegramEmail
Package: notion-sdk
Notion SDK for PythonA simple and easy to use Python client for theNotion APINotion SDKis a fully typed Python library to use the Notion API. It supports asyncio.
It uses the greathttpxas an HTTP client andpydanticfor data validation and typing. This client is meant to be a Python version of the referenceJavaScript SDK, so usage should be pretty similar between both.Installation$pipinstallnotion-sdkUsageImport and initialize a client using anintegration tokenor an OAuthaccess token.fromnotionimportNotionClientnotion=NotionClient(auth="YOUR_ACCESS_TOKEN")deffetch_databases()->None:response=notion.databases.list()fordatabaseinresponse.results:print(database.title)if__name__=="__main__":fetch_databases()More example are available in theexamplesfolder.Async UsageThis library supports asynchronous calls to Notion API.Each method returns aCoroutinethat have to be awaited to retreive the typed response.The same methods are available for sync or async but you have to use theNotionAsyncClientlike
in the following example:importasynciofromnotionimportNotionAsyncClientnotion=NotionAsyncClient(auth="YOUR_ACCESS_TOKEN")asyncdeffetch_databases()->None:response=awaitnotion.databases.list()fordatabaseinresponse.results:print(database.title)if__name__=="__main__":asyncio.run(fetch_databases())Clients optionsNotionClientandNotionAsyncClientsupport the following options on initialization.
These options are all keys in the single constructor parameter.OptionDefault valueTypeDescriptionauthNonestringBearer token for authentication. If left undefined, theauthparameter should be set on each request.timeout60intNumber of seconds to wait before emitting aRequestTimeoutErrorbase_url"https://api.notion.com/v1/"stringThe root URL for sending API requests. This can be changed to test with a mock server.user_agentnotion-sdk/VERSION (https://github.com/getsyncr/notion-sdk)stringA custom user agent send with every request.RequirementsThis package supports the following minimum versions:Python >=3.7httpx>=0.15.0pydantic>=1.7Earlier versions may still work, but we encourage people building new applications
to upgrade to the current stable.LicenseDistributed under the Apache License. SeeLICENSEfor more information.
Package: notionshell
notionshellAnother partially implemented notion command line clients.Not feature complete,partially implementedUses official notion libraryPatches welcome"Highish" level - not just a close wrapper around the apiStill fairly generalHopefully this is quite easy to extend.UsageList databases:notionshell database listGet page in a database:notionshell database pages $IDAutheticationFollow instructionshereto create an integration.Grant integration access to databases (see above)SetNOTION_API_KEYenvironment variable to integration tokenPrior worknotionsCould upload pages or block, was not using notion librarynotion-cliCould not list databases, was not using notion libraryclotionIn typescript, no stars on github at time of writingThere are various notion libraries for different languagesThere is an HTTP client that is quite usable.Upcoming workFeatures as I use themOne day I'll create something to sync emacs org-mode to notion
Package: notion-sync
notion-syncpip install notion-syncA tool to sync a notion collection to markdown filesSetting up NotionCreate a collection table viewAdd columns forPublish Date (type date)Status (type select, with Published as an option)Tags (type multi_select)Setting up you syncing directorycopyconfig-example.jsontoconfig.jsonset token_v2 to the value of your token_v2 token on a logged-in session of notionset sync_root to the url of a collection view page (the database-as-rows page)In the same directory as your config file, run:notion_sync
Package: notiontomd
notiontomdConvert notion page content to markdownUsageQuickstartpip install notiontomdfromnotiontomdimportNotionToMarkdowntoken=os.environ['token']page_id=os.environ['page_id']print(NotionToMarkdown(token,page_id).parse())FeatureSupport block:paragraphnumbered_list_itembulleted_list_itemimagecodeheading_1heading_2heading_3bookmarkquoteto_dounsupported (The current notion API does not support SimpleTable)child_databasedividercalloutvideo (thanks for@phuang07)
Package: notion-toolkit
Notion-DBNotion-DB is a powerful object-oriented client for the Notion API that allows you to easily access and work with notion Databases. Learn how to use it and create your own Notion integrations in minutes!Explore the docs »Report Bug·Request FeatureTable of ContentsAbout The ProjectGetting StartedUsageLicenseContactAbout The ProjectNotion-DB is a powerful object-oriented client for the Notion API that allows you to easily access and work with notion Databases. Learn how to use it and create your own Notion integrations in minutes!(back to top)Getting StartedThis is an example on how to get started with using the API client. To see more specific uses
please refer to theDocumentation. Also refer to the Notion API documentation for more information on the API itself.InstallationInstall the package using pippipinstallnotion-toolkitGet an API key athttps://www.notion.so/my-integrationsExample UsageAdding a row to an existing databaseUpdate Notion database properties with custom Schema objects(back to top)Package OverviewThe main classes are:Connector, Database, Row, and SchemaConnectorobjects are used to connect to the Notion API and work with the API.Schemaobjects are used to create new databases and rows. They are also used to update existing databases and rows. Schema objects only contain the structure of the database or row, not the data.Rowobjects contain values, and work with existing rows and create new ones. They are similar to Pandas series,Databaseobjects are used to work with existing databases and create new ones, as a collection of rows.Schema and Row objects contain PropertiesProperty Valuesmake up each entry in a Row object, and they contain values and properties for a row cell. The client supports all property types that are supported by the Notion API and makes it easy to automatically parse Python types.Schema Propertiesare used to create new databases and rows, or to validate row objects. They do not hold any values, but hold attributes about the column type in the database, such as the name, and format. The client supports all property types that are supported by the Notion API.For more examples, please refer to theDocumentation(back to top)ContributingPlease feel free to contribute in any way!LicenseDistributed under the GNU 3 License.(back to top)ContactMatt Prodani -mattp@nyu.eduRepository Link:https://github.com/mattprodani/notion-db(back to top)
Package: notion-tqdm
notion-tqdmProgress Bar displayed in Notion like tqdm for Python usingnotion-py.notion-tqdminherits fromtqdm, so it can be run in the same way as tqdm.Installationpip install notion-tqdmUsagePreparationGet Notion's Tokenfor referencehereDuplicate this pagein your own workspace andget the table link.
（Note that it is a table link, not a page link.）QuickStartfromnotion_tqdmimportnotion_tqdmfromtimeimportsleep# Configuretoken_v2='<token_v2>'table_url='<table_url>'notion_email='<notion_email>'# For multi-account usersnotion_tqdm.set_config(token_v2,table_url,email=notion_email,timezone='Asia/Tokyo')# Run Iterateforiinnotion_tqdm(range(100),desc='Processing'):sleep(1)print(i)A row representing the progress should be added to the table as shown below.Example: Running with the Other tqdmfromtqdm.autoimporttqdmastqdm_autofromtimeimportsleep# Nest tqdmtqdm=lambda*args,**kwags:tqdm_auto(notion_tqdm(*args,**kwags))foriintqdm(range(100)):sleep(1)print(i)Example: Set Custom PropertySet the common parameters before the iterative process.# After this setting, the value will be added to the column by default.# The `machine` column must be added to the table beforehand.notion_tqdm.set_common_props(machine='Jupyter1')Set the dynamic parameters during the iterative process.withnotion_tqdm(range(50),desc='process')aspbar:foriinpbar:# ... some process ...# The `precision`, `highparam` column must be# added to the table beforehand.pbar.update_props(precision=precision,highparam=highparam)Example: Add text to a page in table row.withnotion_tqdm(range(500),desc='add text test')aspbar:foriinpbar:sleep(1)pbar.add_text(f'text:{i}')Example: Timeline ViewWith Notion'stimeline view, you can visualize theexecution time of the progress.Devloptestpytest-sv--token_v2${{ TOKEN_V2}}--table_url${{ TABLE_URL}}--notion_email${{ NOTION_EMAIL}}dockerbuild-tnotion_tqdm_pytest.
dockerrun--rmnotion_tqdm_pytestpytest-sv--token_v2680db0e4a89e5f635034110db34cd05f19829070f58e38fedbd362061bfb5ec45a7a8af308e003e3970c166e4c4b8b088eca84a1db027d9a0183780f4396b927da1af88d6a7a577ba702ae6902dc--table_urlhttps://www.notion.so/syunyo/485de72f369e4a268c88649586954a0b?v=3eb3f42f6b3843799cfc36f627461daa--notion_emailsyunyooo@gmail.com僕も同じ感じです
・極としてはマルチモーダルに移行していくので、学生が今後NLPしかやりたくないというスタンスであれば基本追わなくてよさそう
・一方で野村さんや吉本さんなど、プロダクトからAILabに行く人は結構いる認識で、そのパターンの人達が当初どういうスタンスで入ってきていたのかは気になってますなるほどです！吉本さん売り込みもしてたんですね笑
プロダクト→AILab のパターンが減るのではと少し懸念してたんですけど、事例的に問題なさそうなので、XXだけやりたい思考の人はSクラスでも積極的に追わなくていいのかなと思いました元々いろんな事やりたいっすとい
Package: notion-tree
notion-treeHierarchic operations with Notion API, thanks tonotion-py.RequirementsPython ≥ 3.6aureplop/notion-py, fork ofhttps://github.com/jamalex/notion-py, with importFile featureInstallation# Required as PyPI does not accept package with dependency links$pipinstallgit+https://github.com/aureplop/notion-py.git@feat-import-file#egg=notion-999
$pipinstallnotion-treeUsage# Obtain the `token_v2` value by inspecting your browser cookies on a logged-in session on Notion.so
$ NOTION_TOKEN=...
$ python -m notiontree.hierarchy --dir path/to/local/root --root-parent-url https://www.notion.so/id/to/parent/of/local/rootAssuming you had this hierarchy on Notion:workspace
└── parent-root  # URL: https://www.notion.so/id/to/parent/of/local/rootAnd that you have this local structure:path/to/local
└── root
    ├── index.md
    ├── dir1
    │   ├── index.md
    │   └── page1.md
    └── dir2
        └── page2.mdAfter running the command above, you will get this structure on your Notion workspace:workspace
└── parent-root           # URL: https://www.notion.so/id/to/parent/of/local/root
    └── root              # Includes links to dir1 and dir2 + content of root/index.md
        ├── dir1          # Includes links to dir1/page1.md + content of root/dir1/index.md
        │   └── page1.md
        └── dir2          # Includes links to dir2/page2.md
            └── page2.mdTodosSplit 'notiontree/hierarchy.py' to multiple modules.Use 'click' for CLI.Document --github-wiki-root in README.Create stub pages in another page than 'root' to be able to import root index.html w/o removing other stub pages.Accept other filenames for index files (currently limited to 'index.md').Improve link resolver configuration.
Package: notion-util
Notion Utilこのプロジェクトは、Notion.soの非公式Python APIクライアントです。
NotionページのMarkdown変換やNotion Databaseのcsv変換が可能です。インストールこのパッケージをインストールするには、以下のコマンドを実行してください。pipinstallnotion-util使い方exportNOTION_SECRET=secret_xxxxxxxxxxxxfromnotion.utilimportget_page_markdown# notion page urlurl="https://www.notion.so/xxxx"# ページのブロックを取得markdown_content=get_page_markdown(url,recursive=False)print(markdown_content)fromnotion.utilimportcreate_notion_page,markdown_to_notion_blocks,append_blocks_to_page# ここで、NotionのデータベースIDと新しいページのタイトルを指定するdatabase_id=os.getenv("DATABASE_ID")page_title="New Page From Markdown"# Notionのプロパティを設定properties={"URL":{"url":"http://example.com"}}# 新しいページを作成res=create_notion_page(database_id,page_title,properties)# Markdownファイルを読み込むwithopen("README.md","r")asmd_file:# MarkdownをNotionブロックに変換blocks=markdown_to_notion_blocks(md_file.read())# Notionページにブロックを追加append_blocks_to_page(res["id"],blocks)
Package: notip
NOTIP: Non-parametric True Discovery Proportion control for brain imagingThis repository contains the code to reproduce all experiments of the Notip paper (https://arxiv.org/abs/2204.10572). The scripts directory contains a script per figure.
Note that the first time you run one of those scripts, the fMRI data fetching from Neurovault will take place, which takes a significant amount of time. This only needs to be done once.Installing dependenciespython -m pip install -r requirements.txtReproducing figuresTo reproduce any figure, i.e. figure 2, run:python figure_2.pyThis will display the corresponding figure as well as save it in ../figuresParallelizationTo speed up any script using parallelization on CPU cores, use:python figure_2.py 6With any number of CPU cores instead of 6.
Package: noti.py
noti.pySimple Python-based notification script to post to a matrix server via the Matrix client/server APIThis is not an interactive chat bot.  The use case is to have scripts send alerts to a single alert channel.DocumentationFull documentation is available atnotipy.readthedocs.ioHow to installVia PyPiAs of version 0.0.6, noti.py has been published to PyPi, so installing (should
be) as easy aspip install noti_pyThis will also create anotipy"entrypoint" to use as the binary to run.Via gitclone the repoinstall the requirementspip install -r requirements.txtcp example-config.yaml <config_dir>config.yamlEdit the config.yaml to your local needsThen just use./noti.py --helpto figure out what options you can specify<config_dir> referenced in step 3 above will be checked in the following order
or preference. (current directory)~/.config/noti_py/etc/noti_pyIf you want it in another location completely, specify the--configoption to
override.How do I use this thing?start withnoti.py --helpto see a list of the commands you can use.  Generally you are going to need to do the following things:Create a user on your server for this script to connect asConnect to a room by either:Creating a new roomnoti.py createorJoining a roomnoti.py joinif you've already invited the user from step 1 with a different userEdit the config.yaml to put in your access token and all your homeserver configuration.  If you don't know your token, you can get it by running./noti.py tokenAt this point you should be able to send a message with:./noti.py send "message to send"or if you are so inclined, you can pipe stdin to the script withecho "message to send"|./noti.py sendInspirationI tried to usemnotifywhich is written in go.  When I ranmake, it gave a segfault upon runningmnotify.  Rather than try to learn go, I decided to just try to do the same thing in python.ContributeFeel free to fork, make updates and submit a pull request for new things or to fix some horrible python atrocity I have commited ;)ChatYou can join me on matrix athttps://matrix.to/#/#noti.py:arachnitech.com