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
- 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()
- 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)
- 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
Release history Release notifications | RSS feed
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.5.tar.gz
(19.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file anytype_pyclient-0.0.5.tar.gz.
File metadata
- Download URL: anytype_pyclient-0.0.5.tar.gz
- Upload date:
- Size: 19.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ecf09f8e44447ab32a1ccf8ddcf7dc636ef815b88b203f843600d87f9cf39bf4
|
|
| MD5 |
961d51d670b27b3ff43b7ac46562d777
|
|
| BLAKE2b-256 |
fcfb243bb9d6e9e241514d53aebbe57daf1ded4e03b4b933ddb69a98e55355c7
|
File details
Details for the file anytype_pyclient-0.0.5-py3-none-any.whl.
File metadata
- Download URL: anytype_pyclient-0.0.5-py3-none-any.whl
- Upload date:
- Size: 20.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0dd5cd3a236c88cf5780c60fdc47a9861103c13fee9f29f8e2105eaa2896fd9
|
|
| MD5 |
19902c47a8ca2870543a330db4316cd8
|
|
| BLAKE2b-256 |
20d08d331d24c087596d6c03b5ba5049604548c98cff4cd0cb4d2d79e09d20b9
|