activitystreampython
A Python 3 module for interacting with the Activity Stream Data Service API v1.
To find out more about the Activity Stream Data Service API, browse the Swagger documentation.
Usage
Installation
pip install activitystreampython
Sample usage
from activitystreampython import ActivityStreamAPI
from datetime import datetime, timezone, timedelta
tenant = "demo" # Your Activity Stream tenant (this will be the same as the Activity Stream subdomain)
username = "example@example.com" # The email address for your API user
password = "correct-horse-battery-staple" # The password for your API user - NB: don't store passwords in code!
end_datetime = datetime.now(timezone.utc)
start_datetime = end_datetime - timedelta(days=7)
activity_stream = ActivityStreamAPI(tenant=tenant, username=username, password=password)
# Retrieve customers
# This method initialises a generator which can be iterated over to retrieve customer data
customers = activity_stream.ticketing_data(
data_type="customers",
start_datetime=start_datetime,
end_datetime=end_datetime,
filter_type="updatedate",
)
for customer in customers:
print(customer)
# Retrieve tickets
# This method initialises a generator which can be iterated over to retrieve ticket data
tickets = activity_stream.ticketing_data(
data_type="tickets",
start_datetime=start_datetime,
end_datetime=end_datetime,
filter_type="updatedate",
)
for ticket in tickets:
print(ticket)
# Retrieve marketing permissions
# This method initialises a generator which can be iterated over to retrieve marketing permission data
marketing_permissions = activity_stream.marketing_data(start_datetime=start_datetime)
for marketing_permission in marketing_permissions:
print(marketing_permission)
Notes
We recommend using the updatedate filter_type if you are using this package to keep an external
database up-to-date with Activity Stream data. That way you can be sure that you will never miss out
on data even if historic records are backfilled in Activity Stream. For the initial import, using the
eventdate filter_type may be more predictable in terms of data volumes for each time period.
This package is not officially supported, although we do use it internally and will endeavour to avoid breaking changes.
License
Copyright 2023 crowdEngage Limited
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Metadata
Release files for activitystreampython 0.1.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| activitystreampython-0.1.11.tar.gz | 4.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| activitystreampython-0.1.11-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.1 kB
Release files / activitystreampython-0.1.11.tar.gz
| Download URL | activitystreampython-0.1.11.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
00eb082e9eac21b3215d6e3ae0092618b9680cda18e09320ddaed267f5c938c0
|
|
BLAKE2b-256 checksum How to use checksums |
5b97785b2d013f58c1774fb6b803a05ea7f60a744e7029c22fca0152094d307f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.1 CPython/3.11.2 Darwin/22.2.0
|
Release files / activitystreampython-0.1.11-py3-none-any.whl
| Download URL | activitystreampython-0.1.11-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0e19d0a07fc701f288a865197e900269dfcd154f58cc12232a8d8cb322968c5c
|
|
BLAKE2b-256 checksum How to use checksums |
7186644e3c317d8b3ed3cebfc8da2ef0ea14e959d17f20fba7a8fe0be562f71b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.1 CPython/3.11.2 Darwin/22.2.0
|
Security for activitystreampython 0.1.11
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.