semvec/pypi-packages huggingface dataset:
pyensign 0.12.1b0
Ensign driver, SDK, and helpers for Python
License: BSD
Keywords: python,setup,pypi

# PyEnsign

PyEnsign is the official Python SDK for [Ensign](https://rotational.io/ensign), a distributed event store and stream-processing platform. This library allows you to interact with the Ensign API directly from Python in order to create [publishers](https://ensign.rotational.dev/eventing/glossary/#publisher) and [subscribers](https://ensign.rotational.dev/eventing/glossary/#subscriber).

## Installation

```
pip install pyensign
```

## Usage

Create a client from a client ID and client secret. If not provided, these will be obtained from the `ENSIGN_CLIENT_ID` and `ENSIGN_CLIENT_SECRET` variables.

```python
from pyensign.ensign import Ensign

client = Ensign(client_id=<your client ID>, client_secret=<your client secret>)
```

The `Event` class can be used to create events from the raw data and mimetype.

```python
from pyensign.events import Event

event = Event(b'{"temp": 72, "units": "fahrenheit"}', "application/json")
```

Publish events to a topic. This coroutine accepts one or more events, so the following uses are all valid.

```python
await client.publish("weather", event)
await client.publish("weather", event1, event2)
await client.publish("weather", [event1, event2])
```

Publish is asynchronous. You should generally call `flush()` before your program exits to ensure that all events are published to the server.

```python
# Wait for events to be published with a default timeout of 2 seconds.
await client.flush()
```

For more precision, you can wait for individual events to be acked by the server.

```python
ack = await event.wait_for_ack()
print(ack)
```

Subscribe to one or more topics by providing the topic name(s) or ID(s).

```python
async for event in client.subscribe("weather"):
    print("Received event with data: {}".format(event.data))
    await event.ack()
```

## Advanced Usage

The `publish` coroutine accepts asynchronous callbacks so the client can distinguish between committed and uncommitted events. Callbacks are invoked when acks and nacks are received from the server and the first argument passed to the callback is the `Ack` or `Nack` itself. An `Ack` contains a committed timestamp. A `Nack` is returned if the event couldn't be committed and contains the ID of the event along with an error describing what went wrong.

```python
async def handle_ack(self, ack):
    ts = datetime.fromtimestamp(ack.committed.seconds + ack.committed.nanos / 1e9)
    print(f"Event committed at {ts}")

async def handle_nack(self, nack):
    print(f"Could not commit event {nack.id} with error {nack.code}: {nack.error}")

await client.publish("weather", event, on_ack=handle_ack, on_nack=handle_nack)
```
compmech 0.8.0
CompMech: Computational Mechanics in Python
License: BSD
Keywords: computational,mechanics,structural,analysis,analytical,Bardell,Ritz

Github Actions status:
[![Test and coverage](https://github.com/saullocastro/compmech/actions/workflows/pytest_and_coverage.yml/badge.svg)](https://github.com/saullocastro/compmech/actions/workflows/pytest_and_coverage.yml)
[![Release](https://github.com/saullocastro/compmech/actions/workflows/auto_release.yml/badge.svg)](https://github.com/saullocastro/compmech/actions/workflows/auto_release.yml)
[![Documentation](https://github.com/saullocastro/compmech/actions/workflows/auto_doc.yml/badge.svg)](https://github.com/saullocastro/compmech/actions/workflows/auto_doc.yml)
[![Deploy](https://github.com/saullocastro/compmech/actions/workflows/pythonpublish.yml/badge.svg)](https://github.com/saullocastro/compmech/actions/workflows/pythonpublish.yml)

Coverage status:
[![codecov](https://codecov.io/gh/saullocastro/compmech/branch/master/graph/badge.svg?token=12LJVZAYTL)](https://codecov.io/gh/saullocastro/compmech)


Computational Mechanics (compmech)
==================================

Semi-analytical models for thin-walled structures.

The models herein presented are described in detail in the following
publications:

Castro SPG, Mittelstedt C, Monteiro FAC, Arbelo MA, Ziegmann G, Degenhardt R.
Linear buckling predictions of unstiffened laminated composite cylinders and
cones under various loading and boundary conditions using semi-analytical
models. Composite Structures, Vol. 118, Pages 303-315, December 2014.
https://doi.org/10.1016/j.compstruct.2014.07.037

Castro SGP, Mittelstedt C, Monteiro FAC, Arbelo MA, Degenhardt R, Ziegmann G. A
semi-analytical approach for linear and non-linear analysis of unstiffened
laminated composite cylinders and cones under axial, torsion and pressure
loads. Thin-Walled Structures, Vol. 90, Pages 61-73, May, 2015.
https://doi.org/10.1016/j.tws.2015.01.002

Castro SGP, Mittelstedt C, Monteiro FAC, Degenhardt R, Ziegmann G. Evaluation
of non-linear buckling loads of geometrically imperfect composite cylinders and
cones with the Ritz method. Composite Structures, Vol. 122, Pages 284-299,
April, 2015. https://doi.org/10.1016/j.compstruct.2014.11.050

Castro SGP, Donadon MV. Assembly of Semi-Analytical models to Address Linear
Buckling and Vibration of Stiffened Composite Panels with Debonding Defect.
Composite Structures, Vol. 160, Pages 232–247, January, 2017.
https://doi.org/10.1016/j.compstruct.2016.10.026


Documentation
-------------

The documentation is available on: http://saullocastro.github.io/compmech/


Requirements
------------
- numpy
- scipy
- matplotlib
- (for building only) Cython and a C compiler


License
-------
Distrubuted under the 3-Clause BSD license
(https://raw.github.com/saullocastro/composites/master/LICENSE).

Contact: S.G.P.Castro@tudelft.nl