Skip to main content

python client for anytype api.

Project description

Welcome to Anytype PyClient

this project is create base on Anytype Api

Features

  • Authentication: use ApiKey only
  • 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

From PyPi (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)

Configuration

ANYTYPE_API_KEY: your api key
ANYTYPE_BASE_URL: your base url(default: http://127.0.0.1:31009)

License

see the License File

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.6.tar.gz (19.6 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.6-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: anytype_pyclient-0.0.6.tar.gz
  • Upload date:
  • Size: 19.6 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.6.tar.gz
Algorithm Hash digest
SHA256 2051f3fd17c4cbe2ca479a771186405455eb9f6a3693a886a97cdad9fd1d5d22
MD5 56289d2f507f6d600b9f27a85f4501f6
BLAKE2b-256 0e06fd8bc29a578cf2a6f2693d98eb7e8abcd62d68f9ba4c375771960a2f4c9c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for anytype_pyclient-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 0a894810cab8a65b90c15ea17d5e164ba7212da01f8662f25fb34b33ff3958f2
MD5 91736e64b732089bccf3763f61cabf8b
BLAKE2b-256 000314c2fd391b6651854256044de8455d982f4a97e3fab265414f8ba729a4e7

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