diff options
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-drift-python.spec | 529 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 531 insertions, 0 deletions
@@ -0,0 +1 @@ +/drift-python-1.1.1.tar.gz diff --git a/python-drift-python.spec b/python-drift-python.spec new file mode 100644 index 0000000..6895a69 --- /dev/null +++ b/python-drift-python.spec @@ -0,0 +1,529 @@ +%global _empty_manifest_terminate_build 0 +Name: python-drift-python +Version: 1.1.1 +Release: 1 +Summary: A Simple Drift API Wrapper. +License: MIT +URL: https://github.com/Driftt/drift-python +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/f0/fa/0489a166c695e678d82d8c76ffda4534921384d9fd392914e7ff7c0dbf64/drift-python-1.1.1.tar.gz +BuildArch: noarch + +Requires: python3-requests + +%description +[](https://github.com/ellerbrock/open-source-badge/) +[](https://badge.fury.io/py/drift-python) + +<p align="center"> + <img src="img/drift_python.png" width="300"/> +</p> + +# Drift Python +A [Drift API](https://devdocs.drift.com) wrapper written in Python. + + +## Getting Started +To get started run `pip install drift-python` + +```python +from drift import Drift +drift = Drift("YOUR ACCESS TOKEN") +``` + +## Contacts +Read the docs here: [Contacts API](https://devdocs.drift.com/docs/contact-model). + +**Available Methods** + +- `drift.contacts.get()` + - contact_id (required) + - email (optional) + - limit (optional) + - +- `drift.contacts.create()` + - **attributes (required) + + Example: + `drift.contacts.create(email='johndoe@drift.com')` + +- `drift.contacts.update()` + - contact_id (required) + - **attributes (required) + +- `drift.contacts.delete()` + - contact_id (required) + +- `drift.contacts.add_tags()` + - contact_id (required) + - tags (required) + + Example: + ``` + drift.contacts.add_tags( + conversation_id=1, + tags=[{'name': 'My Tag'}] + ) + ``` + +- `drift.contacts.remove_tag()` + - contact_id (required) + - tag_name (required) + +- `drift.contacts.remove_tags_bulk()` + - contact_id (required) + +## Conversations +Read the docs here [Conversations API](https://devdocs.drift.com/docs/conversation-overview) + +**Available Methods** + +- `drift.conversations.get()` + - conversation_id (required) + +- `drift.conversations.list()` + - limit (optional) - defaults to `50` + - next_ (optional) + +- `drift.conversations.create_message()` + - conversation_id (required) + - org_id (required) + - type (required) + - body (optional) + - buttons (optional) + - edited_message_id (optional) + - edit_type (optional) + + Example: + ``` + drift.conversations.create_message( + conversation_id=1, + org_id=1, + type='chat' + ) + ``` + +- `drift.conversations.get_messages()` + - conversation_id (required) + - next_ (optional) + +- `drift.conversations.get_attachments()` + - doc_id (required) + +- `drift.conversations.get_metrics()` + - query (required) + + Example: + ``` + drift.conversations.get_metrics( + { + "metrics": [ + { + "type": "AVG", + "property": "numBotMessages" + } + ], + "filters": [ + { + "property": "createdAt", + "operation": "BETWEEN", + "values": ["2018-01-01", "2018-07-31"] + } + ] + } + ) + + ``` + +## Users +Read the docs here [Users API](https://devdocs.drift.com/docs/user-model) + +**Available Methods** + +- `drift.users.get()` + - user_id (required) + +- `drift.users.list()` + +- `drift.users.update()` + - user_id (required) + - **attributes (required) + + Example: + drift.users.update(243266, phone='555-555-5555') + + +## Contributors +- Lemuel Boyce [rhymiz](https://github.com/rhymiz) +- Chris Buonocore [cbonoz](https://github.com/cbonoz) + + +## Support / Feedback / Bugs +For support and feedback, you can find us on [Slack](https://join.slack.com/t/devdrift/shared_invite/enQtMzg4MTI3NDk5NDQ0LWUwMWYzZTkyMmQ1YjdkNjkwZDg2Mzk2YjAyMDg4MWViYmIzZjVhZTczNDQwMDVjOGRjZGU5OTkxMWQ0ZGU0Mjg)! + +If you've found a bug, feel free to open up a PR with a fix or submit an issue. Let us know in the dev slack! + + + + +%package -n python3-drift-python +Summary: A Simple Drift API Wrapper. +Provides: python-drift-python +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-drift-python +[](https://github.com/ellerbrock/open-source-badge/) +[](https://badge.fury.io/py/drift-python) + +<p align="center"> + <img src="img/drift_python.png" width="300"/> +</p> + +# Drift Python +A [Drift API](https://devdocs.drift.com) wrapper written in Python. + + +## Getting Started +To get started run `pip install drift-python` + +```python +from drift import Drift +drift = Drift("YOUR ACCESS TOKEN") +``` + +## Contacts +Read the docs here: [Contacts API](https://devdocs.drift.com/docs/contact-model). + +**Available Methods** + +- `drift.contacts.get()` + - contact_id (required) + - email (optional) + - limit (optional) + - +- `drift.contacts.create()` + - **attributes (required) + + Example: + `drift.contacts.create(email='johndoe@drift.com')` + +- `drift.contacts.update()` + - contact_id (required) + - **attributes (required) + +- `drift.contacts.delete()` + - contact_id (required) + +- `drift.contacts.add_tags()` + - contact_id (required) + - tags (required) + + Example: + ``` + drift.contacts.add_tags( + conversation_id=1, + tags=[{'name': 'My Tag'}] + ) + ``` + +- `drift.contacts.remove_tag()` + - contact_id (required) + - tag_name (required) + +- `drift.contacts.remove_tags_bulk()` + - contact_id (required) + +## Conversations +Read the docs here [Conversations API](https://devdocs.drift.com/docs/conversation-overview) + +**Available Methods** + +- `drift.conversations.get()` + - conversation_id (required) + +- `drift.conversations.list()` + - limit (optional) - defaults to `50` + - next_ (optional) + +- `drift.conversations.create_message()` + - conversation_id (required) + - org_id (required) + - type (required) + - body (optional) + - buttons (optional) + - edited_message_id (optional) + - edit_type (optional) + + Example: + ``` + drift.conversations.create_message( + conversation_id=1, + org_id=1, + type='chat' + ) + ``` + +- `drift.conversations.get_messages()` + - conversation_id (required) + - next_ (optional) + +- `drift.conversations.get_attachments()` + - doc_id (required) + +- `drift.conversations.get_metrics()` + - query (required) + + Example: + ``` + drift.conversations.get_metrics( + { + "metrics": [ + { + "type": "AVG", + "property": "numBotMessages" + } + ], + "filters": [ + { + "property": "createdAt", + "operation": "BETWEEN", + "values": ["2018-01-01", "2018-07-31"] + } + ] + } + ) + + ``` + +## Users +Read the docs here [Users API](https://devdocs.drift.com/docs/user-model) + +**Available Methods** + +- `drift.users.get()` + - user_id (required) + +- `drift.users.list()` + +- `drift.users.update()` + - user_id (required) + - **attributes (required) + + Example: + drift.users.update(243266, phone='555-555-5555') + + +## Contributors +- Lemuel Boyce [rhymiz](https://github.com/rhymiz) +- Chris Buonocore [cbonoz](https://github.com/cbonoz) + + +## Support / Feedback / Bugs +For support and feedback, you can find us on [Slack](https://join.slack.com/t/devdrift/shared_invite/enQtMzg4MTI3NDk5NDQ0LWUwMWYzZTkyMmQ1YjdkNjkwZDg2Mzk2YjAyMDg4MWViYmIzZjVhZTczNDQwMDVjOGRjZGU5OTkxMWQ0ZGU0Mjg)! + +If you've found a bug, feel free to open up a PR with a fix or submit an issue. Let us know in the dev slack! + + + + +%package help +Summary: Development documents and examples for drift-python +Provides: python3-drift-python-doc +%description help +[](https://github.com/ellerbrock/open-source-badge/) +[](https://badge.fury.io/py/drift-python) + +<p align="center"> + <img src="img/drift_python.png" width="300"/> +</p> + +# Drift Python +A [Drift API](https://devdocs.drift.com) wrapper written in Python. + + +## Getting Started +To get started run `pip install drift-python` + +```python +from drift import Drift +drift = Drift("YOUR ACCESS TOKEN") +``` + +## Contacts +Read the docs here: [Contacts API](https://devdocs.drift.com/docs/contact-model). + +**Available Methods** + +- `drift.contacts.get()` + - contact_id (required) + - email (optional) + - limit (optional) + - +- `drift.contacts.create()` + - **attributes (required) + + Example: + `drift.contacts.create(email='johndoe@drift.com')` + +- `drift.contacts.update()` + - contact_id (required) + - **attributes (required) + +- `drift.contacts.delete()` + - contact_id (required) + +- `drift.contacts.add_tags()` + - contact_id (required) + - tags (required) + + Example: + ``` + drift.contacts.add_tags( + conversation_id=1, + tags=[{'name': 'My Tag'}] + ) + ``` + +- `drift.contacts.remove_tag()` + - contact_id (required) + - tag_name (required) + +- `drift.contacts.remove_tags_bulk()` + - contact_id (required) + +## Conversations +Read the docs here [Conversations API](https://devdocs.drift.com/docs/conversation-overview) + +**Available Methods** + +- `drift.conversations.get()` + - conversation_id (required) + +- `drift.conversations.list()` + - limit (optional) - defaults to `50` + - next_ (optional) + +- `drift.conversations.create_message()` + - conversation_id (required) + - org_id (required) + - type (required) + - body (optional) + - buttons (optional) + - edited_message_id (optional) + - edit_type (optional) + + Example: + ``` + drift.conversations.create_message( + conversation_id=1, + org_id=1, + type='chat' + ) + ``` + +- `drift.conversations.get_messages()` + - conversation_id (required) + - next_ (optional) + +- `drift.conversations.get_attachments()` + - doc_id (required) + +- `drift.conversations.get_metrics()` + - query (required) + + Example: + ``` + drift.conversations.get_metrics( + { + "metrics": [ + { + "type": "AVG", + "property": "numBotMessages" + } + ], + "filters": [ + { + "property": "createdAt", + "operation": "BETWEEN", + "values": ["2018-01-01", "2018-07-31"] + } + ] + } + ) + + ``` + +## Users +Read the docs here [Users API](https://devdocs.drift.com/docs/user-model) + +**Available Methods** + +- `drift.users.get()` + - user_id (required) + +- `drift.users.list()` + +- `drift.users.update()` + - user_id (required) + - **attributes (required) + + Example: + drift.users.update(243266, phone='555-555-5555') + + +## Contributors +- Lemuel Boyce [rhymiz](https://github.com/rhymiz) +- Chris Buonocore [cbonoz](https://github.com/cbonoz) + + +## Support / Feedback / Bugs +For support and feedback, you can find us on [Slack](https://join.slack.com/t/devdrift/shared_invite/enQtMzg4MTI3NDk5NDQ0LWUwMWYzZTkyMmQ1YjdkNjkwZDg2Mzk2YjAyMDg4MWViYmIzZjVhZTczNDQwMDVjOGRjZGU5OTkxMWQ0ZGU0Mjg)! + +If you've found a bug, feel free to open up a PR with a fix or submit an issue. Let us know in the dev slack! + + + + +%prep +%autosetup -n drift-python-1.1.1 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-drift-python -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Mon Apr 10 2023 Python_Bot <Python_Bot@openeuler.org> - 1.1.1-1 +- Package Spec generated @@ -0,0 +1 @@ +c61e7a899716215e1253643274bca07b drift-python-1.1.1.tar.gz |
