A Python client for interacting with the Mem API, including support for Mem's unique Markdown format.
- Create mems with custom content
- Upload mems from Markdown files
- Batch create mems
- Append content to existing mems
- Automatically convert standard Markdown to Mem's Markdown format
You can install the mem-client package via pip:
pip install mem-clientfrom mem_client import Client
api_token = "your_api_access_token_here"
client = Client(api_token)response = client.create_mem(content="Hello there! I am a new mem.")
print(response)response = client.create_mem(
content="Hello there! I am a new mem.",
is_read=True,
is_archived=True,
scheduled_for="2032-08-02T08:15:30-05:00",
created_at="1994-11-05T08:15:30-05:00"
)
print(response)response = client.create_mem_from_file(file_path="./path/to/filename.md")
print(response)batch_mems = [
{"content": "Hello there! I am a new mem."},
{"content": "I am another new mem!"}
]
response = client.batch_create_mems(batch_mems)
print(response)mem_id = "10000000-0000-4000-a000-000000000000"
response = client.append_to_mem(mem_id, content="This will be appended to the end of the mem!")
print(response)python -m mem_client.cli create-mem "Hello there! I am a new mem."python -m mem_client.cli create-mem "Hello there! I am a new mem." --is-read --is-archived --scheduled-for "2032-08-02T08:15:30-05:00" --created-at "1994-11-05T08:15:30-05:00"python -m mem_client.cli create-mem-from-file ./path/to/filename.mdpython -m mem_client.cli batch-create-mems ./path/to/mems.jsonpython -m mem_client.cli append-to-mem 10000000-0000-4000-a000-000000000000 "This will be appended to the end of the mem!"- Create a Mem
- Batch Create Mems
- Append to a Mem
- Authentication
- Error Handling
- Mem Markdown Format Information
The client raises appropriate exceptions for various error conditions, such as invalid requests, unauthorized access, and server errors. For more details, refer to the Error Handling documentation.
This project is licensed under the MIT License.
- Append content to existing mems
- Automatically convert standard Markdown to Mem's Markdown format
You can install the mem-client package via pip:
pip install mem-clientfrom mem_client import Client
api_token = "your_api_access_token_here"
client = Client(api_token)response = client.create_mem(content="Hello there! I am a new mem.")
print(response)response = client.create_mem(
content="Hello there! I am a new mem.",
is_read=True,
is_archived=True,
scheduled_for="2032-08-02T08:15:30-05:00",
created_at="1994-11-05T08:15:30-05:00"
)
print(response)response = client.create_mem_from_file(file_path="./path/to/filename.md")
print(response)batch_mems = [
{"content": "Hello there! I am a new mem."},
{"content": "I am another new mem!"}
]
response = client.batch_create_mems(batch_mems)
print(response)mem_id = "10000000-0000-4000-a000-000000000000"
response = client.append_to_mem(mem_id, content="This will be appended to the end of the mem!")
print(response)python -m mem_client.cli create-mem "Hello there! I am a new mem."python -m mem_client.cli create-mem "Hello there! I am a new mem." --is-read --is-archived --scheduled-for "2032-08-02T08:15:30-05:00" --created-at "1994-11-05T08:15:30-05:00"python -m mem_client.cli create-mem-from-file ./path/to/filename.mdpython -m mem_client.cli batch-create-mems ./path/to/mems.jsonpython -m mem_client.cli append-to-mem 10000000-0000-4000-a000-000000000000 "This will be appended to the end of the mem!"- Create a Mem
- Batch Create Mems
- Append to a Mem
- Authentication
- Error Handling
- Mem Markdown Format Information
The client raises appropriate exceptions for various error conditions, such as invalid requests, unauthorized access, and server errors. For more details, refer to the Error Handling documentation.
This project is licensed under the MIT License.