civipy


Namecivipy JSON
Version 0.0.6 PyPI version JSON
download
home_pageNone
SummaryCiviCRM v3/v4 REST API Python wrapper
upload_time2024-12-07 17:21:13
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseGPLv3
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## Getting Started
This is a brand-new project and code is subject to change at any time.

Install with `python3 -m pip install civipy`. If you are using a Python version
older than 3.11 and want to use `pyproject.toml` configuration, install with
`python3 -m pip install civipy[pyproject]`.

## Configuration

Configure your credentials in environment variables, a `.civipy` file, or in
`pyproject.toml` in a `tools.civipy` section. By default, CiviPy will read a `.civipy`
file anywhere in the current working directory up to your project root, or your
project's `pyproject.toml` file, or a `.civipy` file in the user's home folder.
Settings in environment variables will overwrite any file settings. Alternatively,
you can call `civipy.config.SETTINGS.init()` to set the configuration values.

| Setting                         | Environment Variable | `.civipy` File             | `pyproject.toml` File          |
|---------------------------------|----------------------|----------------------------|--------------------------------|
|                                 |                      |                            | `[tool.civipy]`                |
| Connection *(required)*         | `CIVI_REST_BASE`     | `rest_base=http://civi.py` | `rest-base = "http://civi.py"` |
| API Version                     | `CIVI_API_VERSION`   | `api_version=4`            | `api-version = "4"`            |
| Access Token *(required)*       | `CIVI_USER_KEY`      | `user_key=...`             | `user-key = "..."`             |
| Site Token *(required for v3)*  | `CIVI_SITE_KEY`      | `site_key=...`             | `site-key = "..."`             |
| Log File                        | `CIVI_LOG_FILE`      | `log_file=/tmp/civipy.log` | `log-file = "/tmp/civipy.log"` |
| Log Level                       | `CIVI_LOG_LEVEL`     | `log_level=WARNING`        | `log-level = "WARNING"`        |
| Config File                     | `CIVI_CONFIG`        |                            |                                |

### Connection
The Connection setting lets you specify the URL of your REST API, or the `cv` or
`drush` or `wp-cli` executable on your file system. If "http" is found in the setting,
the system will use http calls to the REST API. If the string "drush" is found, it
will use drush. If the string "wp" is found, it will use wp-cli. And if none of these
are found, it will attempt to call the cv command line API.

### API Version
Set to "3" to use the CiviCRM v3 API, or "4" (the default) to use the CiviCRM v4 API.

### Log File
To log to a file instead of the screen, set the Log File setting to the file path
you want to log to.

### Config File
You can specify in an environment variable either a directory to find a `.civipy`
configuration file in, or a file to read as a `.civipy` configuration file.

## Usage
There is a Django-style `.objects` attribute on each record model with `filter`, `values`,
`order_by`, and `all` methods for querying; and `create`, `delete`, and `update` methods
for making changes. Model instances also have `save` and `delete` methods.

```python
from civipy import CiviContact

contact = CiviContact.objects.filter(email_primary__email="ana@ananelson.com")[0]
contact.nick_name = "Ana"
contact.save()
```

Each CiviCRM Entity is represented by a subclass of CiviCRMBase; if you need an entity
that is not in the project, you can easily add it by subclassing CiviCRMBase and naming
it the entity name prepended with "Civi", e.g.

```python
import civipy

class CiviNewEntity(civipy.CiviCRMBase):
    pass
```

## Copyright & License
civipy Copyright © 2020 Ana Nelson

Licensed under the GPL v3

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

<https://www.gnu.org/licenses/gpl-3.0.txt>

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "civipy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Joe Carey <joecarey001@gmail.com>, Ana Nelson <ana@ananelson.com>",
    "download_url": "https://files.pythonhosted.org/packages/46/c0/f8f76484803aa4b12985ecb05e0c3fd65813ec45b32c7b2619187a24f4a3/civipy-0.0.6.tar.gz",
    "platform": null,
    "description": "## Getting Started\nThis is a brand-new project and code is subject to change at any time.\n\nInstall with `python3 -m pip install civipy`. If you are using a Python version\nolder than 3.11 and want to use `pyproject.toml` configuration, install with\n`python3 -m pip install civipy[pyproject]`.\n\n## Configuration\n\nConfigure your credentials in environment variables, a `.civipy` file, or in\n`pyproject.toml` in a `tools.civipy` section. By default, CiviPy will read a `.civipy`\nfile anywhere in the current working directory up to your project root, or your\nproject's `pyproject.toml` file, or a `.civipy` file in the user's home folder.\nSettings in environment variables will overwrite any file settings. Alternatively,\nyou can call `civipy.config.SETTINGS.init()` to set the configuration values.\n\n| Setting                         | Environment Variable | `.civipy` File             | `pyproject.toml` File          |\n|---------------------------------|----------------------|----------------------------|--------------------------------|\n|                                 |                      |                            | `[tool.civipy]`                |\n| Connection *(required)*         | `CIVI_REST_BASE`     | `rest_base=http://civi.py` | `rest-base = \"http://civi.py\"` |\n| API Version                     | `CIVI_API_VERSION`   | `api_version=4`            | `api-version = \"4\"`            |\n| Access Token *(required)*       | `CIVI_USER_KEY`      | `user_key=...`             | `user-key = \"...\"`             |\n| Site Token *(required for v3)*  | `CIVI_SITE_KEY`      | `site_key=...`             | `site-key = \"...\"`             |\n| Log File                        | `CIVI_LOG_FILE`      | `log_file=/tmp/civipy.log` | `log-file = \"/tmp/civipy.log\"` |\n| Log Level                       | `CIVI_LOG_LEVEL`     | `log_level=WARNING`        | `log-level = \"WARNING\"`        |\n| Config File                     | `CIVI_CONFIG`        |                            |                                |\n\n### Connection\nThe Connection setting lets you specify the URL of your REST API, or the `cv` or\n`drush` or `wp-cli` executable on your file system. If \"http\" is found in the setting,\nthe system will use http calls to the REST API. If the string \"drush\" is found, it\nwill use drush. If the string \"wp\" is found, it will use wp-cli. And if none of these\nare found, it will attempt to call the cv command line API.\n\n### API Version\nSet to \"3\" to use the CiviCRM v3 API, or \"4\" (the default) to use the CiviCRM v4 API.\n\n### Log File\nTo log to a file instead of the screen, set the Log File setting to the file path\nyou want to log to.\n\n### Config File\nYou can specify in an environment variable either a directory to find a `.civipy`\nconfiguration file in, or a file to read as a `.civipy` configuration file.\n\n## Usage\nThere is a Django-style `.objects` attribute on each record model with `filter`, `values`,\n`order_by`, and `all` methods for querying; and `create`, `delete`, and `update` methods\nfor making changes. Model instances also have `save` and `delete` methods.\n\n```python\nfrom civipy import CiviContact\n\ncontact = CiviContact.objects.filter(email_primary__email=\"ana@ananelson.com\")[0]\ncontact.nick_name = \"Ana\"\ncontact.save()\n```\n\nEach CiviCRM Entity is represented by a subclass of CiviCRMBase; if you need an entity\nthat is not in the project, you can easily add it by subclassing CiviCRMBase and naming\nit the entity name prepended with \"Civi\", e.g.\n\n```python\nimport civipy\n\nclass CiviNewEntity(civipy.CiviCRMBase):\n    pass\n```\n\n## Copyright & License\ncivipy Copyright &copy; 2020 Ana Nelson\n\nLicensed under the GPL v3\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see <https://www.gnu.org/licenses/>.\n\n<https://www.gnu.org/licenses/gpl-3.0.txt>\n",
    "bugtrack_url": null,
    "license": "GPLv3",
    "summary": "CiviCRM v3/v4 REST API Python wrapper",
    "version": "0.0.6",
    "project_urls": {
        "Homepage": "https://github.com/indepndnt/civipy"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c7297a64b466b00336848b06e5c24b910919a1a4f3c1e460c6e918f6450b0e7f",
                "md5": "59a1cbeda61e6a17ec7b6bb5dbbefcc9",
                "sha256": "ec7fdbf64e517c2288f968fa9f10814f3cc43dee5f64e233f9aec0f08578bc54"
            },
            "downloads": -1,
            "filename": "civipy-0.0.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "59a1cbeda61e6a17ec7b6bb5dbbefcc9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 38564,
            "upload_time": "2024-12-07T17:21:12",
            "upload_time_iso_8601": "2024-12-07T17:21:12.660161Z",
            "url": "https://files.pythonhosted.org/packages/c7/29/7a64b466b00336848b06e5c24b910919a1a4f3c1e460c6e918f6450b0e7f/civipy-0.0.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "46c0f8f76484803aa4b12985ecb05e0c3fd65813ec45b32c7b2619187a24f4a3",
                "md5": "e42cc980adf420caabd2463d3c32bb5b",
                "sha256": "9284290fb93856d7e2e045a7473972ff03f474fc94c392576451cd4a67741566"
            },
            "downloads": -1,
            "filename": "civipy-0.0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "e42cc980adf420caabd2463d3c32bb5b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 34379,
            "upload_time": "2024-12-07T17:21:13",
            "upload_time_iso_8601": "2024-12-07T17:21:13.723145Z",
            "url": "https://files.pythonhosted.org/packages/46/c0/f8f76484803aa4b12985ecb05e0c3fd65813ec45b32c7b2619187a24f4a3/civipy-0.0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-07 17:21:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "indepndnt",
    "github_project": "civipy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "civipy"
}
        
Elapsed time: 3.84654s