Sveve


NameSveve JSON
Version 1.0.0 PyPI version JSON
download
home_page
SummaryA (limited) Python wrapper for Sveve's SMS sending API
upload_time2024-01-17 08:15:39
maintainer
docs_urlNone
author
requires_python
license
keywords
VCS
bugtrack_url
requirements requests pydantic pytest pytest-xdist requests_mock scriv build twine
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # sveve
A (limited) Python wrapper for Sveve's API

Based on [API documentation](https://sveve.no/apidok/send).

I am in no way affiliated with Sveve and accept no liability for damages caused as a result of using this code.

## Usage

The client returns a pydantic class that matches the data structure in the API documentation unless a fatal error occurs, in which case it raises a `SveveError` with a descriptive error message.

### Initialising client
```python
from sveve.client import SveveClient, SveveError
client = SveveClient(user="usr", password="123", default_sender="funbit")
```

### Sending an SMS
```python
try:
  # Sending to one recipient using client's default_sender
  client.send_sms(to="12345678", msg="Hello world!")
except SveveError:
  print("Something went wrong...")

# Alternatively with multiple recipients
recipients = ["12345001", "12345002", "12345003"]
client.send_sms(to=recipients, msg="Hello world!")
# Or using a custom sender name
client.send_sms(to="12345678", msg="Hello world!", sender="Your Name")
```

### Checking remaining balance
```python
try:
  balance = client.remaining_sms()
except SveveError:
  print("Something went wrong...")
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "Sveve",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "",
    "author_email": "Alex Simpson <alex.simpson@funbit.no>",
    "download_url": "https://files.pythonhosted.org/packages/b6/1c/895340b792e580ee2822f087e5df8e2b1c036d17764364d3c6ddeb314af1/Sveve-1.0.0.tar.gz",
    "platform": null,
    "description": "# sveve\nA (limited) Python wrapper for Sveve's API\n\nBased on [API documentation](https://sveve.no/apidok/send).\n\nI am in no way affiliated with Sveve and accept no liability for damages caused as a result of using this code.\n\n## Usage\n\nThe client returns a pydantic class that matches the data structure in the API documentation unless a fatal error occurs, in which case it raises a `SveveError` with a descriptive error message.\n\n### Initialising client\n```python\nfrom sveve.client import SveveClient, SveveError\nclient = SveveClient(user=\"usr\", password=\"123\", default_sender=\"funbit\")\n```\n\n### Sending an SMS\n```python\ntry:\n  # Sending to one recipient using client's default_sender\n  client.send_sms(to=\"12345678\", msg=\"Hello world!\")\nexcept SveveError:\n  print(\"Something went wrong...\")\n\n# Alternatively with multiple recipients\nrecipients = [\"12345001\", \"12345002\", \"12345003\"]\nclient.send_sms(to=recipients, msg=\"Hello world!\")\n# Or using a custom sender name\nclient.send_sms(to=\"12345678\", msg=\"Hello world!\", sender=\"Your Name\")\n```\n\n### Checking remaining balance\n```python\ntry:\n  balance = client.remaining_sms()\nexcept SveveError:\n  print(\"Something went wrong...\")\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A (limited) Python wrapper for Sveve's SMS sending API",
    "version": "1.0.0",
    "project_urls": {
        "repository": "https://github.com/alexalligator/sveve"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1ecbfab86212dccbeef1e5a5f1ef0c5d46c1e45b6c06738c8e03c93290dbfbe1",
                "md5": "9955d45c770b417b79023be71b4a5f78",
                "sha256": "3ec358088784e62362b4f99c97bcf7cfb3b3b40af4dbb0fa8d332bbd7fafbb99"
            },
            "downloads": -1,
            "filename": "Sveve-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9955d45c770b417b79023be71b4a5f78",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4551,
            "upload_time": "2024-01-17T08:15:38",
            "upload_time_iso_8601": "2024-01-17T08:15:38.199321Z",
            "url": "https://files.pythonhosted.org/packages/1e/cb/fab86212dccbeef1e5a5f1ef0c5d46c1e45b6c06738c8e03c93290dbfbe1/Sveve-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b61c895340b792e580ee2822f087e5df8e2b1c036d17764364d3c6ddeb314af1",
                "md5": "d8f97fb85418589fdf19cf63ef87ab1d",
                "sha256": "e068aeb1dec947fae7ccefc4bde3412405c32b6a1992dcc0c3cf457fb821bf35"
            },
            "downloads": -1,
            "filename": "Sveve-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "d8f97fb85418589fdf19cf63ef87ab1d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5558,
            "upload_time": "2024-01-17T08:15:39",
            "upload_time_iso_8601": "2024-01-17T08:15:39.736325Z",
            "url": "https://files.pythonhosted.org/packages/b6/1c/895340b792e580ee2822f087e5df8e2b1c036d17764364d3c6ddeb314af1/Sveve-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-17 08:15:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "alexalligator",
    "github_project": "sveve",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "requests",
            "specs": [
                [
                    ">=",
                    "2"
                ],
                [
                    "<",
                    "3"
                ]
            ]
        },
        {
            "name": "pydantic",
            "specs": [
                [
                    ">=",
                    "2"
                ],
                [
                    "<",
                    "3"
                ]
            ]
        },
        {
            "name": "pytest",
            "specs": []
        },
        {
            "name": "pytest-xdist",
            "specs": []
        },
        {
            "name": "requests_mock",
            "specs": []
        },
        {
            "name": "scriv",
            "specs": []
        },
        {
            "name": "build",
            "specs": []
        },
        {
            "name": "twine",
            "specs": []
        }
    ],
    "lcname": "sveve"
}
        
Elapsed time: 0.24144s