Giter Site home page Giter Site logo

py2notion's Introduction

Notion Formulas

Build MIT License Version Python Version

Notion 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.

Installation

To get started with Notion Formulas, you can install the package using pip:

pip install notion-formulas

Usage

from notion_formulas import Number, prop

x: Number = prop("x")
y: Number = prop("y")

print(x + y)  # Prints `prop("x") + prop("y")`

API

The complete Notion Formulas API maintains consistency with the original names, with the following adjustments:

  • Camel casing is converted to snake case (e.g., replaceAll() becomes replace_all()).
  • Functions matching python keywords are modified with a trailing underscore: (i.g. if() becomes if_()).
  • Constants are uppercased (i.g. e becomes E).

Data types

The api is fully typed and defines following data types for expressions: Boolean, Number, String, and Date, allowing your formulas to be typed checked by mypy.

Examples

For a comprehensive example, refer to the code that generates a Taskwarrior style urgency score for a Notion task database in examples/urgency.py and the associated output examples/urgency.txt.

Contributing

Contributions to Notion Formulas are welcome and appreciated. If you'd like to contribute, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your changes.
  3. Make your changes and update the tests as needed.
  4. Submit a pull request with your changes.

For major changes, please open an issue first to discuss what you would like to change.

License

Notion Formulas is released under the MIT license, which allows for free and open use, modification, and distribution.

py2notion's People

Contributors

wtolson 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.