Skip to main content

A brief description of your package

Project description

Mem API Client

A Python client for interacting with the Mem API, including support for Mem's unique Markdown format.

Features

  • 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

Installation

You can install the mem-client package via pip:

pip install mem-client

Or via conda (once published):

conda install -c conda-forge mem-client

Usage

Initialization

from mem_client import Client

api_token = "your_api_access_token_here"
client = Client(api_token)

Create a Simple Mem

response = client.create_mem(content="Hello there! I am a new mem.")
print(response)

Create a Mem with Additional Parameters

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)

Create a Mem from a Markdown File

response = client.create_mem_from_file(file_path="./path/to/filename.md")
print(response)

Batch Create Mems

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)

Append to an Existing Mem

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)

Command Line Interface (CLI)

Create a Simple Mem

python -m mem_client.cli create-mem "Hello there! I am a new mem."

Create a Mem with Additional Parameters

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"

Create a Mem from a Markdown File

python -m mem_client.cli create-mem-from-file ./path/to/filename.md

Batch Create Mems

python -m mem_client.cli batch-create-mems ./path/to/mems.json

Append to an Existing Mem

python -m mem_client.cli append-to-mem 10000000-0000-4000-a000-000000000000 "This will be appended to the end of the mem!"

Documentation Links

Error Handling

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.

License

This project is licensed under the MIT License.

  • Append content to existing mems
  • Automatically convert standard Markdown to Mem's Markdown format

Installation

You can install the mem-client package via pip:

pip install mem-client

Or via conda (once published):

conda install -c conda-forge mem-client

Usage

Initialization

from mem_client import Client

api_token = "your_api_access_token_here"
client = Client(api_token)

Create a Simple Mem

response = client.create_mem(content="Hello there! I am a new mem.")
print(response)

Create a Mem with Additional Parameters

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)

Create a Mem from a Markdown File

response = client.create_mem_from_file(file_path="./path/to/filename.md")
print(response)

Batch Create Mems

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)

Append to an Existing Mem

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)

Command Line Interface (CLI)

Create a Simple Mem

python -m mem_client.cli create-mem "Hello there! I am a new mem."

Create a Mem with Additional Parameters

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"

Create a Mem from a Markdown File

python -m mem_client.cli create-mem-from-file ./path/to/filename.md

Batch Create Mems

python -m mem_client.cli batch-create-mems ./path/to/mems.json

Append to an Existing Mem

python -m mem_client.cli append-to-mem 10000000-0000-4000-a000-000000000000 "This will be appended to the end of the mem!"

Documentation Links

Error Handling

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.

License

This project is licensed under the MIT License.

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

mem_client-0.0.2.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

mem_client-0.0.2-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mem_client-0.0.2.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for mem_client-0.0.2.tar.gz
Algorithm Hash digest
SHA256 ebd51dfb9bfd68adb30e4207af20a0e0ffcd6fd80d535d5aff19bb3169b400b5
MD5 4d68aaf4ccbcfd8fd733a0f486b6aeb6
BLAKE2b-256 ea651b3137a2cefb1b4eecef80162a1f408575b4d77ef758f6f7a4f67756fe6a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mem_client-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for mem_client-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 65018e562b56feb36619d0b92c477f3a84c40bf6be57b7af6ac02f42219e6e89
MD5 cd5378b4e986050246d542a717119747
BLAKE2b-256 65e691a93a687b191c727b167e32927d3f08bbc8657468ce731a195dfdca2308

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