Skip to main content

python client for anytype api.

Project description

Welcome to Anytype PyClient

Features

  • Authentication: use ApiKey to auth locally
  • Spaces: create or update spaces
  • Objects: crud for objects
  • Search: search space or global
  • Types: crud for types
  • Views: manage list(query, collection) views
  • Members: retrive members
  • Properties: CRUD for properties
  • Tags: CRUD for tags
  • Templates: retrive templates

QuickStart

when published

pip install anytype-pyclient

Examples

  1. Space
from anytype import (Anytype, Space, Object, Type, EmojiIcon)
myAny = Anytype()
#create space
spaceBody=SpaceCreate(description=get_random_desc(),name=get_random_letter(10))
newSpace = myAny.createSpace(spaceBody)
#list spaces
allSpaces = myAny.listSpaces()
  1. Type
typeBody=TypeCreate(icon=EmojiIcon(emoji="📝"),
                        key="test_type",
                        layout="basic",
                        name="TestType",
                        plural_name="TestType",
                        properties=[PropertyCreate(format="text", key="prop_text", name="PropText"),
                                    PropertyCreate(format="number", key="prop_number", name="PropNumber"),
                                    PropertyCreate(format="select", key="prop_select", name="PropSelect"),
                                    PropertyCreate(format="multi_select", key="prop_multi_select", name="PropMultiSelect"),
                                    PropertyCreate(format="date", key="prop_date", name="PropDate"),
                                    PropertyCreate(format="files", key="prop_files", name="PropFiles"),
                                    PropertyCreate(format="checkbox", key="prop_checkbox", name="PropCheckbox"),
                                    PropertyCreate(format="url", key="prop_url", name="PropUrl"),
                                    PropertyCreate(format="email", key="prop_email", name="PropEmail"),
                                    PropertyCreate(format="phone", key="prop_phone", name="PropPhone"),
                                    PropertyCreate(format="objects", key="prop_objects", name="PropObjects")
                                    ])
    newType=mySpace.createType(body=typeBody)
  1. Object
objBody=ObjectCreate(body="textAAAA", 
                     icon=EmojiIcon(emoji="📝"),
                     name="obj_" + get_random_letter(10),
                     properties=[TextProp(key="prop_text", text="nameOk"),
                     NumberProp(key="prop_number", number=100),
                     SelectProp(key="prop_select", select="no1"),
                                     MultiSelectProp(key="prop_multi_select", multi_select=["ok1","ok2"]),
                     DateProp(key="prop_date", date="2025-10-13T12:34:56Z"),
                     CheckboxProp(key="prop_checkbox", checkbox=True),
                     URLProp(key="prop_url", url="www.baidu.com"),
                     EmailProp(key="prop_email", email="abc@gmail.com"),
                     PhoneProp(key="prop_phone", phone="+811235489")
                     ],
                     type_key="test_type"
                    )
# ·add text to body
objBody.addHeader(1,"Title")
objBody.addHeader(2, "Header")
objBody.addHeader(3, "SubHeader")
objBody.addDotListBlock()
objBody.addText("textfsgre")
objBody.addSplitLine()
objBody.addCheckbox("done", False)
objBody.addCodeblock("python", "y=x+1")
newObj=mySpace.createObject(body=objBody)

Configure

ANYTYPE_API_KEY=<api_key>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anytype_pyclient-0.0.2.tar.gz (19.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anytype_pyclient-0.0.2-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file anytype_pyclient-0.0.2.tar.gz.

File metadata

  • Download URL: anytype_pyclient-0.0.2.tar.gz
  • Upload date:
  • Size: 19.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for anytype_pyclient-0.0.2.tar.gz
Algorithm Hash digest
SHA256 6652df94c62d3209f86e684a807519638b78c671bb9f15aa67109c10fca3fdbe
MD5 26e18f1084d04bc14cb0b6af083fc8ae
BLAKE2b-256 3c1ab431747e620c5d21d875336112ad0e8df998ca28e598a4dc2be234603578

See more details on using hashes here.

File details

Details for the file anytype_pyclient-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for anytype_pyclient-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b08f87f6befca7273c8230edc9d7a817c519aef72ce8b618cfca4cdbe0e88e13
MD5 d33841ae33e262f2d1034203916aea95
BLAKE2b-256 abfe43f847061348331d676f130ddba4cb6aa22ca14263877b82c834322600e7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page