python-amcards


Namepython-amcards JSON
Version 1.3.6 PyPI version JSON
download
home_pagehttps://github.com/simonesestili/python-amcards
SummaryA wrapper for the AMcards API.
upload_time2024-08-15 21:21:43
maintainerNone
docs_urlNone
authorSimone Sestili
requires_pythonNone
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Getting Started | See the full docs at `Read the Docs <https://python-amcards.readthedocs.io/en/latest/>`_
==========================================================================================================
.. image:: https://i.ibb.co/tCrVfj6/readthedocs.png
    :target: https://python-amcards.readthedocs.io/en/latest/

Installation
------------
To install python-amcards, simply run this command in your terminal:

.. code-block::

    $ pip install python-amcards

Usage
-----
All interactions with the AMcards API are made through the `AMcardsClient <https://python-amcards.readthedocs.io/en/latest/amcards.html#amcards.amcards.AMcardsClient>`_ class.

First, create an `AMcardsClient <https://python-amcards.readthedocs.io/en/latest/amcards.html#amcards.amcards.AMcardsClient>`_ as follows:

.. code-block::

    >>> from amcards import AMcardsClient
    >>> client = AMcardsClient('youraccesstoken')

Here ``'youraccesstoken'`` will be replaced with a string containing your AMcards access token. You can generate one `here <https://amcards.com/user/generate-access-token/>`_.

Now we can perform all operations supported by the `client <https://python-amcards.readthedocs.io/en/latest/amcards.html#amcards.amcards.AMcardsClient>`_.

Let's try using ``send_card`` to send a card to a single recipient:

.. code-block::

        >>> res = client.send_card(
        ...     template_id='123',
        ...     initiator='myintegration123',
        ...     shipping_address={
        ...         'first_name': 'Ralph',
        ...         'last_name': 'Mullins',
        ...         'address_line_1': '2285 Reppert Road',
        ...         'city': 'Southfield',
        ...         'state': 'MI',
        ...         'postal_code': '48075',
        ...         'country': 'US'
        ...     }
        ... )
        >>> res.card_id
        1522873
        >>> res.total_cost
        442
        >>> res.message
        'Card created successfully!'
        >>> res.user_email
        'example@example.com'
        >>> res.shipping_address
        {'last_name': 'Mullins', 'address_line_1': '2285 Reppert Road', 'first_name': 'Ralph', 'country': 'US', 'state': 'MI', 'postal_code': '48075', 'city': 'Southfield'}

The `AMcardsClient <https://python-amcards.readthedocs.io/en/latest/amcards.html#amcards.amcards.AMcardsClient>`_ supports many more operations, for full documentation see `Read the Docs <https://python-amcards.readthedocs.io/en/latest/>`_.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/simonesestili/python-amcards",
    "name": "python-amcards",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "Simone Sestili",
    "author_email": "simone.sestili@amcards.com",
    "download_url": "https://files.pythonhosted.org/packages/0d/ff/cc75acdac7a8f095e14f33663fc32012bdde60240ea76f6de9ac802d8b2a/python_amcards-1.3.6.tar.gz",
    "platform": null,
    "description": "Getting Started | See the full docs at `Read the Docs <https://python-amcards.readthedocs.io/en/latest/>`_\n==========================================================================================================\n.. image:: https://i.ibb.co/tCrVfj6/readthedocs.png\n    :target: https://python-amcards.readthedocs.io/en/latest/\n\nInstallation\n------------\nTo install python-amcards, simply run this command in your terminal:\n\n.. code-block::\n\n    $ pip install python-amcards\n\nUsage\n-----\nAll interactions with the AMcards API are made through the `AMcardsClient <https://python-amcards.readthedocs.io/en/latest/amcards.html#amcards.amcards.AMcardsClient>`_ class.\n\nFirst, create an `AMcardsClient <https://python-amcards.readthedocs.io/en/latest/amcards.html#amcards.amcards.AMcardsClient>`_ as follows:\n\n.. code-block::\n\n    >>> from amcards import AMcardsClient\n    >>> client = AMcardsClient('youraccesstoken')\n\nHere ``'youraccesstoken'`` will be replaced with a string containing your AMcards access token. You can generate one `here <https://amcards.com/user/generate-access-token/>`_.\n\nNow we can perform all operations supported by the `client <https://python-amcards.readthedocs.io/en/latest/amcards.html#amcards.amcards.AMcardsClient>`_.\n\nLet's try using ``send_card`` to send a card to a single recipient:\n\n.. code-block::\n\n        >>> res = client.send_card(\n        ...     template_id='123',\n        ...     initiator='myintegration123',\n        ...     shipping_address={\n        ...         'first_name': 'Ralph',\n        ...         'last_name': 'Mullins',\n        ...         'address_line_1': '2285 Reppert Road',\n        ...         'city': 'Southfield',\n        ...         'state': 'MI',\n        ...         'postal_code': '48075',\n        ...         'country': 'US'\n        ...     }\n        ... )\n        >>> res.card_id\n        1522873\n        >>> res.total_cost\n        442\n        >>> res.message\n        'Card created successfully!'\n        >>> res.user_email\n        'example@example.com'\n        >>> res.shipping_address\n        {'last_name': 'Mullins', 'address_line_1': '2285 Reppert Road', 'first_name': 'Ralph', 'country': 'US', 'state': 'MI', 'postal_code': '48075', 'city': 'Southfield'}\n\nThe `AMcardsClient <https://python-amcards.readthedocs.io/en/latest/amcards.html#amcards.amcards.AMcardsClient>`_ supports many more operations, for full documentation see `Read the Docs <https://python-amcards.readthedocs.io/en/latest/>`_.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A wrapper for the AMcards API.",
    "version": "1.3.6",
    "project_urls": {
        "Homepage": "https://github.com/simonesestili/python-amcards"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5a9e21ae47126cdf306abafd298d7453c14d6eed87db4d71651f021aec1fe6c4",
                "md5": "2a27b71cbe0c83ce2b31bdd99f5fc890",
                "sha256": "7f6551e1eacb096d5baf26a068dd64770ec2225401a5ebc557b1c2f6cf8e7752"
            },
            "downloads": -1,
            "filename": "python_amcards-1.3.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2a27b71cbe0c83ce2b31bdd99f5fc890",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 21575,
            "upload_time": "2024-08-15T21:21:42",
            "upload_time_iso_8601": "2024-08-15T21:21:42.057454Z",
            "url": "https://files.pythonhosted.org/packages/5a/9e/21ae47126cdf306abafd298d7453c14d6eed87db4d71651f021aec1fe6c4/python_amcards-1.3.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0dffcc75acdac7a8f095e14f33663fc32012bdde60240ea76f6de9ac802d8b2a",
                "md5": "1871f71688c6be84447540d1dc291c14",
                "sha256": "2beb93afc53146741fe879e58871de119b9257ef6f28c6c443509cd261600ec1"
            },
            "downloads": -1,
            "filename": "python_amcards-1.3.6.tar.gz",
            "has_sig": false,
            "md5_digest": "1871f71688c6be84447540d1dc291c14",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 20969,
            "upload_time": "2024-08-15T21:21:43",
            "upload_time_iso_8601": "2024-08-15T21:21:43.493435Z",
            "url": "https://files.pythonhosted.org/packages/0d/ff/cc75acdac7a8f095e14f33663fc32012bdde60240ea76f6de9ac802d8b2a/python_amcards-1.3.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-15 21:21:43",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "simonesestili",
    "github_project": "python-amcards",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "python-amcards"
}
        
Elapsed time: 1.54685s