Skip to main content

Python client for the Ploomes API

Project description

Ploomes API Python Client

This package provides a simple Python client for interacting with the Ploomes API, designed with rate-limiting and exponential backoff strategies for improved resilience.

Installation

You can install the package from PyPI:

pip install ploomes-api-client

Basic Usage

Contact Management

To manage contacts, first import the necessary classes and initialize them:

from ploomes_client import PloomesClient as Ploomes
from ploomes_client.collections.contacts import Contacts

Initialize PloomesClient and Contacts Class

ploomes = Ploomes(api_key='your_api_key_here')
contacts = Contacts(ploomes)

Creating a New Contact with Expanded Fields

Here is a synthetic example to demonstrate how to create a new contact with expanded Phones and OtherProperties:

# Define the payload for the new contact
payload = {
    "Name": "Jane Doe",
    "Email": "janedoe@example.com",
    "Phones": [
        {"PhoneNumber": "1234567890", "Type": "Mobile"}
    ],
    "OtherProperties": {"FavoriteColor": "Blue", "Occupation": "Engineer"}
}

# Create the contact
response_json = contacts.post_contact(payload, expand="Phones,OtherProperties")

In this example, the post_contact method sends a POST request to create a new contact in Ploomes. The payload dictionary contains the data for the new contact, including fields like Name, Email, Phones, and OtherProperties. We also use the expand parameter to expand the Phones and OtherProperties fields.

By default, the post_contact method will return a JSON-formatted string as the response.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Uploading to PyPI with Two-Factor Authentication

  1. Generate an API token for your PyPI account:

    • Go to the PyPI account settings page and log in.
    • Scroll down to the "API Tokens" section and click "Add API Token."
    • Provide a description for the token and click "Generate."
    • Copy the generated token.
  2. Upload your package using the API token:

    • Open your terminal.

    • Navigate to your package directory.

    • Build the distribution files:

      python setup.py sdist bdist_wheel
      
    • Upload the distribution files using the twine tool and the generated API token:

      twine upload --verbose dist/* -u __token__ -p <API_TOKEN>
      

    Replace <API_TOKEN> with the copied API token.

  3. Verify the upload:

    • Check the PyPI project page to ensure your new version is listed.

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

ploomes-api-client-0.2.146.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

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

ploomes_api_client-0.2.146-py3-none-any.whl (29.2 kB view details)

Uploaded Python 3

File details

Details for the file ploomes-api-client-0.2.146.tar.gz.

File metadata

  • Download URL: ploomes-api-client-0.2.146.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for ploomes-api-client-0.2.146.tar.gz
Algorithm Hash digest
SHA256 6282e7adb1315fc4adfbd5ede8e933b73bddd461c62c23c4b4a689a654c1f6fd
MD5 e5f7c09986183d5445615d40688a856f
BLAKE2b-256 0449d04c6d6e4af67a28c2d0531c1423ed0e760bf639e2234fa0d5e3de8f2782

See more details on using hashes here.

File details

Details for the file ploomes_api_client-0.2.146-py3-none-any.whl.

File metadata

File hashes

Hashes for ploomes_api_client-0.2.146-py3-none-any.whl
Algorithm Hash digest
SHA256 244b9466c9a5c3ed2046775bcc5bdf2e31feb3f2e9b4207360532f862eb36451
MD5 4544219bb7795b5547467378060fc3cd
BLAKE2b-256 90d2f650945ef3e4e22e4ff1394c50be551440a92a6b15cb21e668bea97509c6

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