This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Octopus Energy Python service utilities

Project Description
# xocto - utilities for Python services

This repo houses various shared utilities for Python services.

CI status:

[![CircleCI](https://circleci.com/gh/octoenergy/xocto/tree/master.svg?style=svg)](https://circleci.com/gh/octoenergy/xocto/tree/master)

## Functionality

### Event publishing

Use `events.publish` to publish application events. These will be logged as JSON
to a logger named "events".

Sample usage:

```python
from xocto import events

events.publish(
event="ACCOUNT.CREATED",
params={
'name': 'Barry Chuckle',
'quote_id': 'xyz123',
},
meta={
'account_id': 'A-12312345'
},
account=account, # optional
request=request, # optional
)
```

### Event timing

Time events using:

```python
from xocto import events

with events.Timer() as t:
# do some things

events.publish(
event="SOMETHING.HAPPENED",
meta={
"duration_in_ms": t.duration_in_ms
}
)
```

## Contributing

Create and activate a virtualenv then:

$ make

Test package with:

$ make test

and:

$ make lint

Release to PyPI by:

1. Bumping the version in `setup.py`

2. Updating `CHANGELOG.md`

3. Committing

3. Running:

$ make publish


Release History

Release History

This version
History Node

1.0.2

History Node

1.0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
xocto-1.0.2-py2.py3-none-any.whl (5.6 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Jan 24, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting